-
Notifications
You must be signed in to change notification settings - Fork 51
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
Clarification of logic in _build_public_opentype_categories
#1024
Comments
yeah I noticed that too, the logic is arguably too liberal. |
It should be enough to consider a glyph a ligature when it has a Ligature subcategory, why do we check for anchors at all? |
we could even go further and ignore the attaching-anchor check, and just take any glyph whose subCateogory is 'Ligature' to be in a ligature class for GDEF. honestly I'm not entirely sure why the code currently restricts it to only ligatures with (non-underscore-prefixed) anchors; the GDEF ligature class can potentially be of use e.g. setting lookupflag IgnoreLigatures independently of them having anchors or not |
ofc khaled beat me to it |
glyphsLib/Lib/glyphsLib/builder/features.py Lines 206 to 228 in e2ebf5b
Someone needs to re-read the linked old discussions, though I feel the check for the anchors is superfluous, or at least should be a fallback when no explicit subcategory is set. |
okay so for the time being I am going to match the implementation here, and treat any anchor that doesn't begin with '_' as 'an attaching anchor'. |
Investigating another minor difference between fontc and fontmake. When assigning the 'ligature' class, the stated logic involves two checks:
However the logic for deciding if something is an attaching anchor is very simple and considers any anchor that does not start with an underscore to be an "attaching anchor":
glyphsLib/Lib/glyphsLib/builder/features.py
Lines 241 to 245 in e2ebf5b
This has the concrete consequence that caret anchors ('caret_1', etc) are considered 'attaching anchors'. As these anchors are common in ligature glyphs, this happens to mean that various ligature glyphs will end up in the ligature category, even if they do not have any attaching marks.
Is this behaviour desired? If it is, then I think this can be addressed with a comment, or by renaming the
has_attaching_anchors
variable. If it is not desired, then the logic should be reworked somewhat.The text was updated successfully, but these errors were encountered: