• fullscreen
  • usConstitution.pde
  • /*
    Built with WordCram 0.2, http://code.google.com/p/wordcram/
    US Constitution text from http://www.usconstitution.net/const.txt
    Liberation Serif font from RedHat: https://www.redhat.com/promo/fonts/
    */
    
    import wordcram.*;
    import wordcram.text.*;
    
    WordCram wordCram;
    Word[] words;
    
    void setup() {
      size(800, 600);
      background(255);
      colorMode(HSB);
      
      String[] usConst = loadStrings("usconst.txt");
      words = new TextSplitter(StopWords.ENGLISH + " shall").split(usConst);
      initWordCram();
    }
    
    void initWordCram() {
      wordCram = new WordCram(this,
          words,
          Fonters.alwaysUse(createFont("LiberationSerif-Regular.ttf", 1)),
          Sizers.byWeight(10, 90),
          Colorers.pickFrom(color(0, 250, 200), color(30), color(170, 230, 200)),
          Anglers.mostlyHoriz(),
          Placers.horizLine());
    }
    
    void draw() {
      if (wordCram.hasMore()) {
        wordCram.drawNext();
      }
    }
    
    void mouseClicked() {
      background(255);
      initWordCram();
    }
    

    code

    tweaks (0)

    about this sketch

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

    license

    advertisement

    Dan Bernier

    US Constitution WordCram

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

    A WordCram of the US Constitution. Click to re-start.

    Built with WordCram 0.2, http://code.google.com/p/wordcram/

    US Constitution text from http://www.usconstitution.net/const.txt

    Liberation Serif font from RedHat: https://www.redhat.com/promo/fonts/

    jean
    4 Apr 2012
    I wonder why though if I try to export the applet, it won't work on the web?
    Dan Bernier
    9 Apr 2012
    It should...are you loading all your files from inside the data folder?
    "Tudd"
    13 Apr 2012
    Libraries are broken n applet export, but OpenProcessing fixes them :)
    You need to login/register to comment.