• fullscreen
  • HScrollBar.pde
  • console.pde
  • font_builder_110529.pde
  • functions.pde
  • class HScrollbar
    {
      int swidth, sheight;    // width and height of bar
      int xpos, ypos;         // x and y position of bar
      float spos, newspos;    // x position of slider
      int sposMin, sposMax;   // max and min values of slider
      int loose;              // how loose/heavy
      boolean over;           // is the mouse over the slider?
      boolean locked;
      float ratio;
    
      HScrollbar (float startSPOS, int xp, int yp, int sw, int sh, int l) {
        swidth = sw;
        sheight = sh;
        int widthtoheight = sw - sh;
    
        xpos = xp;
        //ratio = (float)sw / (float)widthtoheight;
        ratio = 1;
        //println("ratio: " + ratio);
        ypos = yp-sheight/2;
        spos = startSPOS;
        //spos = xpos + swidth/2 - sheight/2;
        newspos = spos;
        sposMin = xpos;
        sposMax = xpos + swidth - sheight;
        loose = l;
      }
    
      void update() {
        if (over()) {
          over = true;
        } 
        else {
          over = false;
        }
        if (mousePressed && over) {
          locked = true;
        }
        if (!mousePressed) {
          locked = false;
        }
        if (locked) {
          newspos = constrain(mouseX-sheight/2, sposMin, sposMax);
        }
        if (abs(newspos - spos) > 1) {
          //spos = spos + (newspos-spos)/loose;
          spos = spos + (newspos-spos);
        }
      }
    
      int constrain(int val, int minv, int maxv) {
        return min(max(val, minv), maxv);
      }
    
      boolean over() {
        if (mouseX > xpos && mouseX < xpos+swidth &&
          mouseY > ypos && mouseY < ypos+sheight) {
          return true;
        } 
        else {
          return false;
        }
      }
    
      void display() {
        noStroke();
        fill(colorChangeR, colorChangeG, colorChangeB, 100);
        rect(xpos, ypos, swidth, sheight);
        if (over || locked) {
    
          fill(colorChangeR, colorChangeG, colorChangeB);
        } 
        else {
          fill(lightGray);
        }
        rect(spos, ypos, sheight, sheight);
      }
    
      float getPos() {
        // Convert spos to be values between
        // 0 and the total width of the scrollbar
    
        int pos = int(spos * ratio);
    
        //println(pos);
    
        float result = map(spos, sposMin, sposMax, charWidthMin, charWidthMax);
        return result;
      }
    }
    
    
    void createConsole() {
      if (!recording) {
        noStroke();
        fill(darkerGray);
        rect(0, 0, 200, height); 
        fill(60, 61, 62);
        text("CAP HEIGHT", 10, 20);
        text("THICKNESS", 10, 70);
        text("EM WIDTH", 10, 120);
        text("TYPE GREEN", 10, 170);
        text("TYPE BLUE", 10, 220);
        text("TYPE RED", 10, 270);
        text("BACKGROUND RED", 10, 320);
        text("BACKGROUND GREEN", 10, 370);
        text("BACKGROUND BLUE", 10, 420);
        fill(colorChangeR, colorChangeG, colorChangeB, 100);
        text("Press keys 1,2,3, or 4", 10, 500);
        text("to toggle textures on and off", 10, 515);
      }
    }
    
    void drawHorizontalRules(float xPos, float yPos) {
      if (!recording) {
        stroke(lightGray, 15);
        strokeWeight(1);
        fill(lightGray, 15);
        line(xPos, yPos, width, yPos);
        text("THE BASELINE", width - 100, yPos - 5);
        line(xPos, yPos - capHeight, width, yPos - capHeight);
        text("CAP HEIGHT", width - 100, (yPos - capHeight) - 5);
      }
    }
    
    void drawVerticalRules(float xPos) {
      if (!recording) {
        stroke(lightGray, 15);
        strokeWeight(1);
        fill(lightGray, 15);
        line(xPos, 0, xPos, height);
        line(xPos + emWidth, 0, xPos + emWidth, height);
        text("EM WIDTH", xPos + 10, height -10);
      }
    }
    
    
    /*   FontBuilder by Ray Elder -- May 2011
     *   Modifications and type design by Cory Crouch -- May 2011  */
    
    import processing.pdf.*;
    
    HScrollbar capHeightControl, thicknessControl, emWidthControl, theBaselineControl, redControl, greenControl, blueControl, bgRedControl, bgGreenControl, bgBlueControl;
    
    boolean recording;
    PGraphicsPDF pdf;
    PFont DIN;
    
    color white = color(255);
    color black = color(0);
    color lightGray = color(225);
    color extraLightGray = color(225, 200);
    color darkerGray = color(20, 21, 22);
    
    float capHeight = 50.0;
    float strokeThickness = 12.0;
    float emWidth = 50.0;
    float colorChangeR = 10.0;
    float colorChangeG = 85.0;
    float colorChangeB = 40.0;
    float bgColorChangeR = 15.0;
    float bgColorChangeG = 25.0;
    float bgColorChangeB = 35.0;
    
    float cX = 0;
    float charWidthMin = 0;
    float charWidthMax = 255;
    
    PImage imgGlass;
    PImage imgDarkWood;
    PImage imgMetal;
    PImage imgGrungePaper;
    
    boolean showGlass = false;
    boolean showWood = false;
    boolean showMetal = false;
    boolean showGPaper = false;
    
    void setup() {
      size(1440, 900);
      background(white);
    
      imgGlass = loadImage("glass1.png");
      imgDarkWood = loadImage("DarkWood.png");
      imgMetal = loadImage("metal.png");
      imgGrungePaper = loadImage("GrungePaper.png");
    
      pdf = (PGraphicsPDF) createGraphics(width, height, PDF, "HAMBURGEFONSTIV.pdf");
      cX = 200;
    
      //  String[] fontList = PFont.list();
      //  println(fontList);
    
      capHeightControl = new HScrollbar(capHeight, 10, 40, 100, 10, 10);
      thicknessControl = new HScrollbar(strokeThickness, 10, 90, 100, 10, 10);
      emWidthControl = new HScrollbar(emWidth, 10, 140, 100, 10, 10);
      redControl = new HScrollbar(colorChangeR, 10, 190, 100, 10, 10);
      greenControl = new HScrollbar(colorChangeG, 10, 240, 100, 10, 10);
      blueControl = new HScrollbar(colorChangeB, 10, 290, 100, 10, 10);
      bgRedControl = new HScrollbar(bgColorChangeR, 10, 340, 100, 10, 10);
      bgGreenControl = new HScrollbar(bgColorChangeG, 10, 390, 100, 10, 10);
      bgBlueControl = new HScrollbar(bgColorChangeB, 10, 440, 100, 10, 10);
    
      DIN = loadFont("DIN-Regular-12.vlw");
      textFont(DIN, 12);
    
      smooth();
    }
    
    void draw() {
    
      background(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      //console went here
    
      colorChangeB = blueControl.getPos();
      capHeight = capHeightControl.getPos();
      strokeThickness = thicknessControl.getPos();
      colorChangeR = redControl.getPos();
      emWidth = emWidthControl.getPos();
      colorChangeG = greenControl.getPos();
      bgColorChangeR = bgRedControl.getPos();
      bgColorChangeG = bgGreenControl.getPos();
      bgColorChangeB = bgBlueControl.getPos();
    
      float divider = 20.0;
    
      // draw vertical emWidth rules
      drawVerticalRules(cX+(emWidth * 0)+(divider * 1));
      drawVerticalRules(cX+(emWidth * 1)+(divider * 2));
      drawVerticalRules(cX+(emWidth * 2)+(divider * 3));
      drawVerticalRules(cX+(emWidth * 3)+(divider * 4));
      drawVerticalRules(cX+(emWidth * 4)+(divider * 5));
    
    
      // first row
      float firstRowY = 225.0;
      // draw first row horizontal rules
      drawHorizontalRules(cX, firstRowY);
      // draw first row of 5 letters
      drawH(cX+(emWidth * 0)+(divider * 1), firstRowY);
      drawA(cX+(emWidth * 1)+(divider * 2), firstRowY);
      drawM(cX+(emWidth * 2)+(divider * 3), firstRowY);
      drawB(cX+(emWidth * 3)+(divider * 4), firstRowY);
      drawU(cX+(emWidth * 4)+(divider * 5), firstRowY);
    
      // second row
      float secondRowY = 450.0;
      // draw second row horizontal rules
      drawHorizontalRules(cX, secondRowY);
      // draw second row of 5 letters
      drawR(cX+(emWidth * 0)+(divider * 1), secondRowY);
      drawG(cX+(emWidth * 1)+(divider * 2), secondRowY);
      drawE(cX+(emWidth * 2)+(divider * 3), secondRowY);
      drawF(cX+(emWidth * 3)+(divider * 4), secondRowY);
      drawO(cX+(emWidth * 4)+(divider * 5), secondRowY);
    
      // third row
      float thirdRowY = 675.0;
      // draw third row horizontal rules
      drawHorizontalRules(cX, thirdRowY);
      // draw third row of 5 letters
      drawN(cX+(emWidth * 0)+(divider * 1), thirdRowY);
      drawS(cX+(emWidth * 1)+(divider * 2), thirdRowY);
      drawT(cX+(emWidth * 2)+(divider * 3), thirdRowY);
      drawI(cX+(emWidth * 3)+(divider * 4), thirdRowY);
      drawV(cX+(emWidth * 4)+(divider * 5), thirdRowY);
    
      if (showGlass) image(imgGlass, 1440, 0);
      else image(imgGlass, 0, 0);
    
      if (showWood) image(imgDarkWood, 0, 0);
      else image(imgDarkWood, 1440, 0);
    
      if (showMetal) image(imgMetal, 0, 0);
      else image(imgMetal, 1440, 0);
    
      if (showGPaper) image(imgGrungePaper, 0, 0);
      else image(imgGrungePaper, 1440, 0);
    
      if (!recording) {
        createConsole();
      }
    
      noStroke();
    
      blueControl.update();
      capHeightControl.update();
      thicknessControl.update();
      redControl.update();
      emWidthControl.update();
      greenControl.update();
      bgRedControl.update();
      bgGreenControl.update();
      bgBlueControl.update();
    
      if (!recording) {
        blueControl.display();
        capHeightControl.display();
        thicknessControl.display();
        redControl.display();
        emWidthControl.display();
        greenControl.display();
        bgRedControl.display();
        bgGreenControl.display();
        bgBlueControl.display();
        fill(60, 61, 62);
        text(capHeight, 115, 45);
        text(strokeThickness, 115, 95);
        text(emWidth, 115, 145);
        text(colorChangeR, 115, 195);
        text(colorChangeG, 115, 245);
        text(colorChangeB, 115, 295);
        text(bgColorChangeR, 115, 345);
        text(bgColorChangeG, 115, 395);
        text(bgColorChangeB, 115, 435);
      }
    }
    
    void keyPressed() {
      if (key == 'r') {
        if (recording) {
          endRecord();
          println("Recording stopped.");
          recording = false;
        } 
        else {
          beginRecord(pdf);
          println("Recording started.");
          recording = true;
        }
      } 
      else if (key == 'q') {
        if (recording) {
          endRecord();
        }
        exit();
      }
    }
    
    void keyReleased() {
      switch(key) {
      case '1':
        if (showGlass) showGlass = false;
        else if (!showGlass) showGlass = true;
        break;
      }
      switch(key) {
      case '2':
        if (showWood) showWood = false;
        else if (!showWood) showWood = true;
        break;
      }
      switch(key) {
      case '3':
        if (showMetal) showMetal = false;
        else if (!showMetal) showMetal = true;
        break;
      }
      switch(key) {
      case '4':
        if (showGPaper) showGPaper = false;
        else if (!showGPaper) showGPaper = true;
        break;
      }
    }
    
    
    //HAMBURGEFONSTIV
    
    
    
    void drawH(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
    
      noStroke();
      beginShape();
      vertex(xPos, yPos);
      vertex(xPos, yPos - capHeight);
      vertex(xPos + emWidth, yPos - capHeight);
      vertex(xPos + emWidth, yPos);
      endShape(CLOSE);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos, yPos - (capHeight/2), xPos + emWidth, yPos - (capHeight/2));
    }
    
    void drawA(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
    
      noStroke();
      beginShape();
      vertex(xPos, yPos);
      vertex(xPos + (emWidth/2), yPos - capHeight);
      vertex(xPos + emWidth, yPos);
      endShape(CLOSE);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + (emWidth/2) - (emWidth*.2), yPos - capHeight, xPos + emWidth - (emWidth*.2), yPos);
    }
    
    void drawM(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
    
      noStroke();
      beginShape();
      vertex(xPos, yPos);
      vertex(xPos, yPos - capHeight);
      vertex(xPos + (emWidth/2), yPos - (capHeight*.8));
      vertex(xPos + emWidth, yPos - capHeight);
      vertex(xPos + emWidth, yPos);
      endShape(CLOSE);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos, yPos - (capHeight*.40), xPos + emWidth, yPos - (capHeight*.8));
    }
    
    void drawB(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
    
      noStroke();
      beginShape();
      vertex(xPos, yPos);
      vertex(xPos, yPos - capHeight);
      vertex(xPos + (emWidth*.7), yPos - capHeight);
      vertex(xPos + (emWidth*.7), yPos);
      endShape(CLOSE);
      ellipse(xPos + (emWidth*.7), yPos - (capHeight*.775), emWidth*.45, capHeight*.45);
      ellipse(xPos + (emWidth*.7), yPos - (capHeight*.33), emWidth*.65, capHeight*.65);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + (emWidth*.3), yPos - capHeight, xPos + (emWidth*.3), yPos);
    }
    
    void drawU(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
    
      noStroke();
      beginShape();
      vertex(xPos, yPos - (capHeight/2));
      vertex(xPos, yPos - capHeight);
      vertex(xPos + emWidth, yPos - capHeight);
      vertex(xPos + emWidth, yPos - (capHeight/2));
      endShape(CLOSE);
      ellipse(xPos + (emWidth/2) - .5, yPos - (capHeight/2), emWidth, capHeight);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + (emWidth*.4), yPos - capHeight, xPos, yPos);
    }
    
    void drawR(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
    
      noStroke();
      beginShape();
      vertex(xPos, yPos);
      vertex(xPos, yPos - capHeight);
      vertex(xPos + (emWidth*.7), yPos - capHeight);
      vertex(xPos + emWidth, yPos);
      endShape(CLOSE);
      ellipse(xPos + (emWidth*.7), yPos - (capHeight*.65), emWidth*.6, capHeight*.71); 
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + (emWidth*.45), yPos, xPos + (emWidth*.2), yPos - capHeight);
    }
    
    void drawG(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
    
      noStroke();
      beginShape();
      vertex(xPos, yPos - (capHeight*.2));
      vertex(xPos, yPos - (capHeight*.8));
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.8));
      vertex(xPos + (emWidth*.2), yPos - capHeight);
      vertex(xPos + (emWidth*.6), yPos - capHeight);
      vertex(xPos + (emWidth*.6), yPos - (capHeight*.6));
      vertex(xPos + emWidth, yPos - (capHeight*.6));
      vertex(xPos + emWidth, yPos - (capHeight*.2));
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.2));
      vertex(xPos + (emWidth*.8), yPos);
      vertex(xPos + (emWidth*.2), yPos);
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.2));
      endShape(CLOSE);
      ellipse(xPos + (emWidth*.2), yPos - (capHeight*.2), emWidth*.4, capHeight*.4);
      ellipse(xPos + (emWidth*.8), yPos - (capHeight*.2), emWidth*.4, capHeight*.4);
      ellipse(xPos + (emWidth*.2), yPos - (capHeight*.8), emWidth*.4, capHeight*.4);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + emWidth, yPos - capHeight, xPos + (emWidth/2), yPos - (capHeight/2));
      line(xPos + (emWidth/2), yPos - (capHeight/2), xPos + (emWidth/2), yPos - (capHeight*.4));
    }
    
    void drawE(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
    
      noStroke();
      beginShape();
      vertex(xPos, yPos);
      vertex(xPos, yPos - (capHeight*.8));
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.8));
      vertex(xPos + (emWidth*.2), yPos - capHeight);
      vertex(xPos + emWidth, yPos - capHeight);
      vertex(xPos + emWidth, yPos - (capHeight*.6));
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.6));
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.4));
      vertex(xPos + emWidth, yPos - (capHeight*.4));
      vertex(xPos + emWidth, yPos);
      endShape(CLOSE);
      ellipse(xPos + (emWidth*.2), yPos - (capHeight*.8), emWidth*.4, capHeight*.4);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + emWidth, yPos - (capHeight*.6), xPos + (emWidth*.5), yPos - (capHeight*.6));
      line(xPos + emWidth, yPos - (capHeight*.4), xPos + (emWidth*.5), yPos - (capHeight*.4));
    }
    
    void drawF(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
    
      noStroke();
      beginShape();
      vertex(xPos, yPos);
      vertex(xPos, yPos - (capHeight*.8));
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.8));
      vertex(xPos + (emWidth*.2), yPos - capHeight);
      vertex(xPos + emWidth, yPos - capHeight);
      vertex(xPos + emWidth, yPos - (capHeight*.6));
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.6));
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.3));
      vertex(xPos + (emWidth*.5), yPos - (capHeight*.3));
      vertex(xPos + (emWidth*.5), yPos);
      endShape(CLOSE);
      ellipse(xPos + (emWidth*.2), yPos - (capHeight*.8), emWidth*.4, capHeight*.4);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + emWidth, yPos - (capHeight*.6), xPos + (emWidth*.5), yPos - (capHeight*.6));
    }
    
    void drawO(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
    
      noStroke();
      beginShape();
      vertex(xPos, yPos - (capHeight*.2));
      vertex(xPos, yPos - (capHeight*.8));
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.8));
      vertex(xPos + (emWidth*.2), yPos - capHeight);
      vertex(xPos + (emWidth*.8), yPos - capHeight);
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.8));
      vertex(xPos + emWidth, yPos - (capHeight*.8));
      vertex(xPos + emWidth, yPos - (capHeight*.2));
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.2));
      vertex(xPos + (emWidth*.8), yPos);
      vertex(xPos + (emWidth*.2), yPos);
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.2));
      endShape(CLOSE);
      ellipse(xPos + (emWidth*.2), yPos - (capHeight*.2), emWidth*.4, capHeight*.4);
      ellipse(xPos + (emWidth*.8), yPos - (capHeight*.2), emWidth*.4, capHeight*.4);
      ellipse(xPos + (emWidth*.2), yPos - (capHeight*.8), emWidth*.4, capHeight*.4);
      ellipse(xPos + (emWidth*.8), yPos - (capHeight*.8), emWidth*.4, capHeight*.4);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + emWidth/2, yPos - capHeight, xPos + emWidth/2, yPos);
    }
    
    void drawN(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
      noStroke();
      beginShape();
      vertex(xPos, yPos);
      vertex(xPos, yPos - capHeight);
      vertex(xPos + (emWidth*.6), yPos - (capHeight*.5));
      vertex(xPos + (emWidth*.6), yPos - capHeight);
      vertex(xPos + emWidth, yPos - capHeight);
      vertex(xPos + emWidth, yPos);
      endShape(CLOSE);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos, yPos - (capHeight*.75), xPos + (emWidth*.9), yPos);
    }
    
    void drawS(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
      beginShape();
      noStroke();
      vertex(xPos, yPos - (capHeight*.2));
      vertex(xPos, yPos - (capHeight*.8));
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.8));
      vertex(xPos + (emWidth*.2), yPos - capHeight);
      vertex(xPos + (emWidth*.8), yPos - capHeight);
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.8));
      vertex(xPos + emWidth, yPos - (capHeight*.8));
      vertex(xPos + emWidth, yPos - (capHeight*.2));
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.2));
      vertex(xPos + (emWidth*.8), yPos);
      vertex(xPos + (emWidth*.2), yPos);
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.2));
      endShape(CLOSE);
      ellipse(xPos + (emWidth*.2), yPos - (capHeight*.2), emWidth*.4, capHeight*.4);
      ellipse(xPos + (emWidth*.8), yPos - (capHeight*.2), emWidth*.4, capHeight*.4);
      ellipse(xPos + (emWidth*.2), yPos - (capHeight*.8), emWidth*.4, capHeight*.4);
      ellipse(xPos + (emWidth*.8), yPos - (capHeight*.8), emWidth*.4, capHeight*.4);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos, yPos - (capHeight*.3), xPos + (emWidth*.6), yPos - (capHeight*.3));
      line(xPos + (emWidth*.4), yPos - (capHeight*.7), xPos + emWidth, yPos - (capHeight*.7));
    }
    
    void drawT(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
      noStroke();
      beginShape();
      vertex(xPos + (emWidth*.2), yPos);
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.6));
      vertex(xPos, yPos - (capHeight*.6));
      vertex(xPos, yPos - capHeight);
      vertex(xPos + emWidth, yPos - capHeight);
      vertex(xPos + emWidth, yPos - (capHeight*.6));
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.6));
      vertex(xPos + (emWidth*.8), yPos);
      endShape(CLOSE);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + (emWidth*.3), yPos - capHeight, xPos + (emWidth*.3), yPos);
    }
    
    void drawI(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
      noStroke();
      beginShape();
      vertex(xPos, yPos);
      vertex(xPos, yPos - (capHeight*.4));
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.4));
      vertex(xPos + (emWidth*.2), yPos - (capHeight*.6));
      vertex(xPos, yPos - (capHeight*.6));
      vertex(xPos, yPos - capHeight);
      vertex(xPos + emWidth, yPos - capHeight);
      vertex(xPos + emWidth, yPos - (capHeight*.6));
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.6));
      vertex(xPos + (emWidth*.8), yPos - (capHeight*.4));
      vertex(xPos + emWidth, yPos - (capHeight*.4));
      vertex(xPos + emWidth, yPos);
      endShape(CLOSE);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + (emWidth*.7), yPos - capHeight, xPos + (emWidth*.7), yPos);
    }
    
    void drawV(float xPos, float yPos) {
      fill(colorChangeR, colorChangeG, colorChangeB);
      noStroke();
      beginShape();
      vertex(xPos + emWidth/2, yPos);
      vertex(xPos, yPos - capHeight);
      vertex(xPos + emWidth, yPos - capHeight);
      endShape(CLOSE);
    
      stroke(bgColorChangeR, bgColorChangeG, bgColorChangeB);
      strokeWeight(strokeThickness*.5);
      line(xPos + (emWidth*.2), yPos - capHeight, xPos + (emWidth*.7), yPos);
    }
    
    

    code

    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.

    license

    advertisement

    Cory Crouch plus+

    Parameterize

    Add to Faves Me Likey@!
    You must login/register to add this sketch to your favorites.

    Toggle textures on and off by pressing 1,2,3, or 4. Multiple textures can be on at once. Press "r" twice quickly to capture a pdf. (note: texture opacity is not preserved in the pdf and will need to be adjusted in Illustrator)

    You need to login/register to comment.