I have a script font with three sets of contextual alternates. Everything's working fine except when two consecutive paragraphs start with the same capital letter – they're always from the default set. I tried adding /CR, /lineseparator and /paragraphseparator to the code but it didn't do anything.
0
Comments
There's no way to reference a carriage return since that's going to define a new text run. If you want to avoid having the same character at the beginning of successive characters about the only way I can think of doing that is to divide the characters in your font into three sets and then do something like the following:
That will select an alternate based on the fifth character in the paragraph (I chose the 5th character over the 2-4th since a substantial number of paragraphs begin with 'The ').
André
can be used for a paragraph-initial alternate, but it won't help with the problem you're trying to solve.
(I bring this up only because I just spent some time fixing a font that used sub space X' by X.init for all of its word initial alternates which, of course, prevented them from being used at the beginning of a paragraph).
André
Is it possible to go backwards? Because both paragraphs start with the same two words. I tried but couldn't make it work. I guess one workaround would be to add a ton of @AllChars in the code so it samples not the 5th, but 15th letter or so...
This matters because I'm doing a digitization of a lettering from a document. Its text will be inevitably typed in the font for comparison.
In the situation which you describe, I'd probably not worry about it in the code. My suggestion would prevent the same alternate from being used in many successive paragraphs, but not all, and the same would hold for any workable solution. You can always use the glyph palette to make your own selection in cases where your code produces undesired results
André
My alternates are split into consonants (con0, con1, con2) and vowels. The first part checks the combination of letters following the "Lietuvos Taryba", which is reoccurring phrase throughout the document, and changes /L accordingly. Since main #calt lookup comes later, this slightly cascades the substitutions and /T changes too.
Since I don't /L to be always followed by the default /i, I added substitution for it too, which changes sets based on a letter away from the phrase.
Finally, I added your substitution for capitals too.
André