{"action":"opened","issue":{"url":"https://api.github.com/repos/googlei18n/ufo2ft/issues/261","repository_url":"https://api.github.com/repos/googlei18n/ufo2ft","labels_url":"https://api.github.com/repos/googlei18n/ufo2ft/issues/261/labels{/name}","comments_url":"https://api.github.com/repos/googlei18n/ufo2ft/issues/261/comments","events_url":"https://api.github.com/repos/googlei18n/ufo2ft/issues/261/events","html_url":"https://github.com/googlei18n/ufo2ft/issues/261","id":333219373,"node_id":"MDU6SXNzdWUzMzMyMTkzNzM=","number":261,"title":"how to decide which glyphs should be considered \"mark\", \"base\" or \"ligature\"?","user":{"login":"anthrotype","id":6939968,"node_id":"MDQ6VXNlcjY5Mzk5Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/6939968?v=4","gravatar_id":"","url":"https://api.github.com/users/anthrotype","html_url":"https://github.com/anthrotype","followers_url":"https://api.github.com/users/anthrotype/followers","following_url":"https://api.github.com/users/anthrotype/following{/other_user}","gists_url":"https://api.github.com/users/anthrotype/gists{/gist_id}","starred_url":"https://api.github.com/users/anthrotype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthrotype/subscriptions","organizations_url":"https://api.github.com/users/anthrotype/orgs","repos_url":"https://api.github.com/users/anthrotype/repos","events_url":"https://api.github.com/users/anthrotype/events{/privacy}","received_events_url":"https://api.github.com/users/anthrotype/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-18T10:48:08Z","updated_at":"2018-06-18T10:48:08Z","closed_at":null,"author_association":"MEMBER","body":"This issue https://github.com/googlei18n/noto-fonts/issues/1223 prompted me to reconsider the way the MarkFeatureWriter currently classifies glyphs into marks, bases or ligatures.\r\n\r\nThe way Glyphs.app does it, is by using its GlyphData.xml database, where hardcoded glyph names map to some Unicode properties and a predefined list of anchor names that each can have. Glyph names that are not contained in that global database can be classified via the glyph property panel (CMD+ALT+I) which stores these override values inside the source file.\r\nIn glyphsLib we use this information to generate a GDEF GlyphClassDef table in the feature file.\r\n\r\nHowever, in the ufo2ft MarkFeatureWriter, the way we classify glyphs into these three categories is simply the following:\r\n- we check for the presence of an underscore-prefixed anchor, e.g. \"_top\", and if that has some corresponding anchor named \"top\" anywhere else in the font, we automatically consider that glyph a combining mark.\r\n- anything that does not have an underscore prefixed anchor, but has some non-underscore-prefixed anchors, e.g. \"top\", we consider a base glyph\r\n- anything that has a base anchor with some numbered suffix, e.g. \"top_1\", \"top_2\", we consider a ligature glyph and include in the mark2liga lookup.\r\n\r\nWe don't take into account the Unicode properties of the glyph involved, nor we read the GDEF GlyphClassDef which the user (or glyphsLib) may have defined in the features.fea.\r\n\r\nThis leads to, e.g., spacing diacritic glyphs -- that by definition are supposed to _not_ be considered combining marks --, be erroneously treated as mark glyphs in the `mark` feature, just because they happen to have a `_top` anchor. But the designer may have placed an anchor in there because she wanted to reuse that glyph as a component in an accented composite glyph.\r\n\r\nWhen exporting from, say, Glyphs.app, those glyphs won't be considered \"mark\" glyphs because their \"subCategory\" in the GlyphData.xml is \"Spacing\".\r\n\r\nWe have to think of a way to determine/store these glyph categories that we could generalise to both the Glyphs and the UFO workflow, which is not tied too much with the former.\r\n\r\nMaybe the MarkFeatureWriter should parse the GDEF GlyphClasDef statement in the feature file and use that to group the glyphs into these three non-overlapping sets.\r\n\r\ncomments? "}}
{"actor":{"display_login":"anthrotype"}}