[glyphdata] glyphdata.get_glyph sometimes returns multiple chars for `unicode` when `name` implies a ligature
See original GitHub issueHere’s an example:
>>> from glyphsLib import glyphdata
>>> glyphdata.get_glyph('T_h')
Glyph(name='T_h', production_name='T_h', unicode=u'Th', category=u'Letter', subCategory=u'Ligature')
The unicode
value comes from the call to agl.toUnicode(prodname
>>> from fontTools import agl
>>> agl.toUnicode('T_h')
u'Th'
agl.toUnicode
splits the string on _
and maps each component to the result string.
I did expect as result a unicode string with a length of 1 or None
. So that I can do ord(result.unicode)
if unicode is not None.
Issue Analytics
- State:
- Created 7 years ago
- Comments:23 (14 by maintainers)
Top Results From Across the Web
Name change in GlyphData.xml - Glyphs Forum
Hi, I'm looking to the possibilities of changing the glyph names (to a different extend depending the case) in GlyphData.xml (only the ...
Read more >Ligature (writing) - Wikipedia
In writing and typography, a ligature occurs where two or more graphemes or letters are joined to form a single glyph. Examples are...
Read more >Ligatures, Digraphs, Presentation Forms vs. Plain Text - Unicode
Ligatures, Digraphs and Presentation Forms. ... If the digraph sorts differently than the two separate characters, then it can be added to a...
Read more >Element: Private Character (Custom or Unicode)
The corresponding image for the glyph may be given in the <glyph-data> ... two-headed, Northwest to Southeast” and a unique name for the...
Read more >ConstFont | TouchGFX Documentation
Finds the glyph data associated with the specified unicode. ... Gets the kerning distance between two characters.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you mean, “unicode stuff is FUBAR in Python 2”.
⌛️ https://pythonclock.org/
Should be fixed in master, we only return what the XML says now.