Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contextual substitution Beginning does not work like kerning classes #172

Open
ciqven opened this issue Jun 26, 2024 · 3 comments
Open

Contextual substitution Beginning does not work like kerning classes #172

ciqven opened this issue Jun 26, 2024 · 3 comments

Comments

@ciqven
Copy link

ciqven commented Jun 26, 2024

OS: Linux x86_64
Birdfont version: 6.7.1 (installed via the flatpak from the website)

tldr: Contextual substitution beginning field does not specify a character class, but an exact sequence needed. This is not intuitive (to me) and contrary to the manual. How can I specify a kerning-like class here?

Greetings, I am trying to make a font for an abugida with initial and isolated vowel forms. In other words, a vowel will have three forms. Initial: Ox, combining: xO, and isolated when not preceded by a valid consonant: xaO).

I am trying to use contextual substitution to handle these vowel forms. I want a rule that converts the initial form to a combining form when preceded by a consonant, so per the manual I tried to setup the following rule:

Ligature: o.combining
Beginning: b c
Middle: o
End:

However, this does not work. In the spacing view, whenever I type bo or co, the o does not get substituted. Only when I type exactly bco does the o get substituted. This looks like the Beginning field does not specify a character class, but rather an exact character sequence. So I would need one rule per consonant-vowel combination.

  • Is this intended to work like this? The manual (https://birdfont.org/doku/doku.php/ligatures) says it "follows the same format as the kerning classes"
  • If this is the intended behavior, is there a way to simplify/automate the act of adding over a thousand (20+ consonants * 10 vowels * 5 diacritical marks) rules?
@johanmattssonm
Copy link
Owner

Yes, the beginning is a character sequence not a class.

Could mark classes be a solution?

@ciqven
Copy link
Author

ciqven commented Jun 26, 2024

Thank you for the quick reply.

I am new to Birdfont so I might be misunderstanding this, but from what I can see in the manual mark classes are used to position a glyph relative to another for diacritics, not for replacing one glyph with another based on surrounding characters.

For my (simplified) use-case I need each vowel to resolve to 3 different glyphs based on the preceding character. One of these 3 glyphs is a diacritic for some vowels and for that I plan to use mark classes, but before that I need to convert the vowel to the right glyph.

So I am looking for a way to type e.g [b c d k v] in the beginning field, or even better type e.g @classname and then add the right glyphs to the right class in the overview. I recall FontForge does something similar (https://fontforge.org/docs/tutorial/editexample6-5.html 2nd screenshot) allowing you to define classes, only in true FontForge fashion this is both complicated and crashed when attempting it :)

Edit I see that the birdfont save-file is XML, so in the worst case I could just all all rules programmatically myself. Still, GUI for this would be less clutter.

@johanmattssonm
Copy link
Owner

Thanks I will look into that later. It is not something I have added support for in Birdfont at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants