You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow glyph sets to define a custom string for placeholders #2005
Some glyph sets contain many glyphs without code points (for example, in scripts like Arabic, most of the glyph sets has no code points), and currently the placeholders for such glyphs is an empty cell which makes it hard to navigate.
It is sometimes possible to have a usable placeholder using a string without necessarily wanting to set a code point for the glyph.
For example, in GF Arabic Plus, jeh-ar.fina does not have a code point, but for placeholder one can use the (legacy) Arabic Presentation Form character U+FB8B ARABIC LETTER JEH FINAL FORM. On the other hand, rehFourdots-ar.fina has no code point or even a Presentation Forms code point, but final form can be forced by using ZWJ + the base glyph code point i.e. the string U+200D U+0699.
I think allowing for an optional column for the placeholder string in the CSV format should allow having usable placeholders for many glyphs without code points.
I tried working on this, but it seems to require too many changes, so instead I tried something simpler: when getting the placeholder character, if the glyph has no code point and the name has ".init", ".medi", etc. extension, use get the code point for the base glyph name and ZWNJ to force the desired positional form. This is less flexible but the required changes are isolated and seems to work well enough for my use case.
I can open a PR if a change like this can be considered.
(There also is the concept of "associatedCodePoints", which is used to guess the script of unencoded glyphs. Not sure how useful that is for this use case.)
I like the idea of having an optional third column to explicitly specify a placeholder character (or char sequence?).
I am also not opposed to do some guessing based on glyph name extension, for well established common cases like these, so I'm curious about your changes.
Activity
khaledhosny commentedon Feb 2, 2025
I tried working on this, but it seems to require too many changes, so instead I tried something simpler: when getting the placeholder character, if the glyph has no code point and the name has ".init", ".medi", etc. extension, use get the code point for the base glyph name and ZWNJ to force the desired positional form. This is less flexible but the required changes are isolated and seems to work well enough for my use case.
I can open a PR if a change like this can be considered.
khaledhosny commentedon Feb 4, 2025
Current:

After proposed change:

justvanrossum commentedon Feb 5, 2025
(There also is the concept of "associatedCodePoints", which is used to guess the script of unencoded glyphs. Not sure how useful that is for this use case.)
I like the idea of having an optional third column to explicitly specify a placeholder character (or char sequence?).
I am also not opposed to do some guessing based on glyph name extension, for well established common cases like these, so I'm curious about your changes.
justvanrossum commentedon Apr 11, 2025
Did https://github.com/googlefonts/fontra/pull/2010 resolve this for you?
khaledhosny commentedon Apr 11, 2025
Yes, that covers my needs.