question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[glyphdata] glyphdata.get_glyph sometimes returns multiple chars for `unicode` when `name` implies a ligature

See original GitHub issue

Here’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:closed
  • Created 7 years ago
  • Comments:23 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
anthrotypecommented, Mar 1, 2017

you mean, “unicode stuff is FUBAR in Python 2”.

⌛️ https://pythonclock.org/

0reactions
madigcommented, Sep 6, 2018

Should be fixed in master, we only return what the XML says now.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found