Text processing/display in Processing

Notes on text display and fonts is not in-appropriate


Cannot apply stroke to text, only fill.
Paint it twice -- with an offset
Might be easier with a pushMatrix, translate, popMatrix to paint from a center location (if centering).
Processing 2, Creative Programming Cookbook Chapter 2 - Drawing Text, Curves and Shapes in 2D







Random notes/observations

Text is far slower than graphics.
Outlines not possible.
Look at the source-code of processing.js for computeFontMetrics() and PFont


Rendering large amounts of text FAST

Suggests rendering text to images, and THEN moving the associated images around. A-ha!

This would not work for dynamic text, however, I think. Unless we go so far as to have images of each letter, and then... kerning &c &c &c.




http://www.rednoise.org/rita/ - I tried this as a replacement for a sequential text streamer, and it was SLOOOOOOW in Java. whoah. :-(


http://www.rednoise.org/rita/documentation/rita/RiMarkov.html - docs, including how to change the tokenizer regex, which apparently is the only method to split on characters. Docs elsewhere say that character n-grams are supported, but give no indication of how to get them.



Text Manager

This is a dumb class I’ve created for some simple text output.
It takes an input and tokenizes it, on whitespace.
Then you can iterate through characters and words, or get a random one.
No markov yet, or anything smart. Can’t even return an iterator.
Oh, well!
There’s a glitch in the non-whitespace checker that requires a code-change from Java to JavaScript. OF COURSE.



some examples

http://www.openprocessing.org/sketch/130014 - uses it’s own special code.
http://www.openprocessing.org/sketch/90414 - uses rita (see above). Displays a markov’d text. Nothing especially “Processing” about the output.
http://www.openprocessing.org/sketch/44133 - wow! text analysis and visualization
http://www.openprocessing.org/sketch/66456 - also
http://www.openprocessing.org/sketch/71988 - randomizes a text. awkward code.
http://www.openprocessing.org/sketch/55581 - drawing text with vector-lines. Text is rendered to image, then if the pixel has a value, a line is drawn on display.
http://www.m-i-b.com.ar/letters/en/ - Letter-pair analysis (processing.js)
http://nossidge.tumblr.com/page/2 - Paul Thompson’s processing experiments with and without text.
http://blog.blprnt.com/blog/blprnt/avengers-assembled-and-visualized-part-2 - data analysis of Marvel’s _The Avengers_ comics; ends with a good-looking text piece.





My text sketches

Sketch:024 - polychrometext
Sketch:025 - ImageTexter
Sketch:026 - flocklex



HTML canvas notes




Computational Typography

http://printingcode.runemadsen.com/lecture-typography/ from http://printingcode.runemadsen.com/, found via Making Photomosaics in Processing, which is also reffed from Mosaic which ruminates on text-based mosaics.
Madsen references the unavailable book Typeface as Programme which is now available online.





http://nexttext.net/ - java library, not js
http://code.andreaskoller.com/libraries/fontastic/ - a library to create font files




// All ASCII characters, sorted according to their visual density
String letterOrder =
  " .`-_':,;^=+/\"|)\\<>)iv%xclrs{*}I?!][1taeo7zjLu" +


Now say we replace the square blobs in a pixellated image with text (color optional, but comes from the blob-average).
We now have a “text” -- it’s abstract and “meaningless” [by common conventions].
However -- what happens to that text as the size of the blobs change -- the density of the blob changes, and so too does the associated text (character[s]) [the color too]. ....



See Also

WordSalad.TextShopping - for sources to fiddle with
WordSalad.WritingMachines - which, after all, is what I’m talking about building, here.
letters in sequences [0..n] - my Pinterest board relating to text and texters.