I'm wondering if there aren't any methods to make a typeface toggle between a few variants of each letter as you type. I've been looking into the possibilities and realized true randomize features as seen in Beowolf are no longer possible, and it seems like the only way to go is adding contextual alternate features. Is this true? Are there no easier ways?
Mind you, unlike Beowolf, I don't need to randomize the design of the letters. I really just want my typeface to toggle between a few variants of each letter, and a feature to prevent double instances of one variant.
0
Comments
It's not a proper randomized cycling feature however. So this is actually what I'm getting at. I can code this contextual alternates feature, but it will still always start with the same standard glyph. It would be great to truly have the cycling randomize. I suppose it's not possible however. The randomized typefaces I found (including Chapter11, Outcast Pro and Populaire) seem to be utilizing the method you linked to.
Anyway, the authoritative answer as I remember was that while the operator exists in the spec and theoretically you could use it to implement glyph variations with it in CFF opentype, the major rendering engine - we mean Freetype
I suggest that a equivalent feature might exist in SVG. But I don't remember anybody mentioning a truetype-based approach other than the contextual clues mentioned, which is not truly random.
Martin, I believe you can indeed create the kind of effect you want, using 'backtrack' sequences; so it will still always start with the same standard glyph, but then that initial glyph will change because of the characters that follow it.
Also, curiously Behdad has recently proposed that OpenType Layout code can indeed be Turing Complete, c.f. https://github.com/behdad/harfbuzz/issues/139#issuecomment-151991107 . You may also find http://ansuz.sooke.bc.ca/entry/131 a good read
Random substitution of glyphs can be implemented by using the random operator in drawing letter forms - if that operator works , which it does not...
Could someone explain this? Does it start at a different place of the cycle each time as you type? I now have the method Georg Seifert linked to implemented, which works beautifully. I'm just wondering how to add a backtrack feature so the first letter isn't always the same variant. Phinney's method doesn't differentiate between vowels and consonants. I suppose if it changes the starting position of the cycles, it wouldn't need such differentiation, or does it?
I'm wondering which method is ultimately going to create a more randomized effect.
If Phinney's method does start at a different point in the cycle each time, that would be optimal. I'm adding more letters now while I await response to elaborate on which method I should implement, and why Thomas repeats the lookup rotate function 13 times; how many times would I need for my 4 variants?
I saved the typeface with the other method and with Phinney's method, closed them, opened them again and now neither compiles while they both did a moment ago. In both cases, when I remove everything in the calt feature that refers to the classes, I can compile again. Does anyone know what's going on?
Also, how do I define the default class? Can I just add A B C D E etc. a b c d e etc.? Because in the other article I read all classes have to be the same size and order. I'm wondering if I need to create a second class for the lowercase.
If you want a more realistic randomness, you have to work at the layout level, not the font level. I once wrote a small proof-of-concept script for InDesign to randomize a setting of Cyrus Highsmith’s Icebox Magnet by accessing the selection of stylistic alternates via under-the-hood properties. (I don’t think FB ever decided to offer it.)
But for the font itself, the best we could do was one of these pseudo-random cycles of calt substitutions.
1) The Beowolf font in PostScript type 3 format used the random operator in PS code to make random variations in the node positions. No two instances of a glyph would ever appear the same (well, there would be some absurdly large number of possibly variations, anyway). Outside of sending a font file directly to a PostScript interpreter (such as a PS printer or Acrobat Distiller), not much supports Type 3, and even those cases are not very interesting most of the time.
2) There is a random operator in the CFF format, and hence by extension possible in OpenType CFF fonts, which could be used in much the same way. However, no important infrastructure supports it.
3) There is an OpenType layout feature "rand" which in theory would select at random from two or more pre-built alternate glyphs. It is not well supported. (Some web browsers may support it, though?)
4) One can achieve some degree of pseudo-random behavior by rotating through a number of available alternate glyphs. This is what I suggested and coded as an example, when LettError wanted to do an OT version of Beowolf. (I am sure their OpenType coding skills have long since outpaced my own, btw, this was early days.) Code samples of this and some other odd effects: https://forums.adobe.com/thread/395648 (thanks to @Ramiro Espinoza for bringing it up)
5) As described by @""Kent Lew" , depending on how the font is built and the environment it is operating in, one can sometimes script or otherwise drive a layout engine to achieve more random glyph choices from a given font.
There is probably something else I am not thinking of, but that might be all.
I also forgot to remove the extra alt classes, as I'm only using 4 variants. Now that is fixed, FontLab no longer jumps to the lookup rotate syntax.
In case of the other method, I must have messed up the feature somewhere, as I can't explain what went wrong there. It's fixed in any case.
So I have both methods working again. The result of both methods is exactly the same though. I think I rather use Phinney's method as it's a lot more elegant. However, I don't quite understand what the lookup rotate syntax does and if it's even working. Is it supposed to change the starting point of the cycle?
Also, if I want to add lowercase as well with variants, how do I specify this? In the same classes, as long as they all contain the same amount of glyphs?
Where can I find a backtrack feature to have a few more specific letters randomize on top of Phinney's method? If I type ABRAXAS for example, I would like all As to be different. Right now only the third one changes. I believe Nick Shinn's method may do this, correct?
I wrote an article about the subject and also made some tools to streamline this. Have a look: http://learn.scannerlicker.net/2015/06/12/making-a-font-maximal-part-iii/
Hope it helps! Cheers!