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).
NOT TESTED
http://forum.processing.org/one/topic/text-outline.html
http://forum.processing.org/one/topic/shadow-and-outline-a-text.html
http://wiki.processing.org/w/Font_outline
Processing 2, Creative Programming Cookbook Chapter 2 - Drawing Text, Curves and Shapes in 2D

 

http://pomax.nihongoresources.com/index.php?entry=1327200006
http://processingjs.nihongoresources.com/glyphing/

 

http://blog.blprnt.com/blog/blprnt/text-comparison-tool-source-code

 

 

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.

 

 

Rita

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.

 

http://www.creativeapplications.net/?s=words

 

 

My text sketches

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

 

 

HTML canvas notes

http://diveintohtml5.info/canvas.html#text
https://developer.mozilla.org/en-US/docs/Drawing_text_using_a_canvas

 

 

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://workshop.evolutionzone.com/2008/11/18/exercise-computational-typography/
http://www.yeoahn.com/tac/
http://issuu.com/jpagecorrigan/docs/type-code_yeohyun-ahn/89
http://www.danieldavis.com/parametric-typography/

 

 

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

 

 

ASCII art

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

 

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.WritingMachines
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.