The grammar of TBC (Text by Code) should have:
– Primitives: Paths, Glyphs, Characters, Words, Strings, and Element
– Methods: To get text, parse it into primitives, manipulate it, place it, render it, and make it move.
1. A path is a line that moves through space.
2. A shape is a closed path with fill.
3. A glyph is a shape that for TBC is usually a letter.
4. A character is the semantic equivalent to a glyph. Thus Roman Character “I” is a character that corresponds to a family of shapes that are horizontal bars with serifs at the ends.
5. A word is a sequence of characters that usually does not include a space character and isn’t too long.
6. A string is a more general version of a word in that it can be longer and contain all characters.
7. An element is an xml object. I am not sure of this, but I would like an xml api native to the language.
So what could we do with these primitives?
1. In the simplest form we should be able to get text from a source like a keyboard, file, or URL and create a string. We should then be able to do things to the string like break it into words. The words we should be able to place in a 2D space.
2. At a more advanced level I should be able to break a text into characters and then do things to the corresponding glyphs. In other words I can not only manipulate the strings, but the shapes of the letters. Thus I could have letters that jitter on the screen or change shape.
3. The manipulation of text should be something I can do so I could create an Eliza like bot. Thus I need regular expressions and so on.
I can probably fake this out with Ruby in that I can create library of objects and a mechanism to output to html using divs and absolute placement.