googlefonts / googlefonts/glyphsLib

Clarification of logic in `_build_public_opentype_categories`

Open
#1,024 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
201
Forks
56
Avg merge
17m
Merged PRs (30d)
1

Description

Investigating another minor difference between fontc and fontmake. When assigning the 'ligature' class, the stated logic involves two checks:
- that the glyph has the 'Ligature' subcategory,
- *and* the glyph has an "attaching anchor".

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":
https://github.com/googlefonts/glyphsLib/blob/e2ebf5b517d59bec0c9437da3a748c58f2999911/Lib/glyphsLib/builder/features.py#L241-L245

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.