Comment by penteract
1 year ago
I think the author has underestimated the power of the substitution rules - it looks like it should be possible to drag a state machine along, hence recognise any regular language. Something like the following should handle quoted strings (untested and needs every character to be listed out in the definitions of @Char, @CharQuoted and @NonQuoteQuoted):
sub Quote @Char' by @CharQuoted;
sub Backslash.quoted Backslash' by Backslash.quoted2;
sub Backslash.quoted Quote' by Quote.escaped;
sub [@NonQuoteQuoted Quote.escaped Backslash.quoted2] @Char' by @CharQuoted;
I don't know if context can be carried between different lines.
How long until it runs Doom?
You may have already seen it (here on hn) but someone absolutely has made a game within a font: https://www.coderelay.io/fontemon.html
That's genius, thank you!! I will have to try that tomorrow but I have a feeling it might just work : - )
Here's a tested version that, given text containing only lower case letters, backslash and double quote, capitalizes the letters between quotes and handles escaping reasonably. (works with NotoSans-Regular.ttf)
Do you know if there is a programmatic way to convert multi character to multi character without intermediate glyphs? E.G. snake -> snāk
1 reply →
Imagine cross-compiling a 60MB tree-sitter grammar into your OpenFont file’s metadata!