diff options
| author | Adrien Tétar | 2015-11-07 12:33:02 +0100 | 
|---|---|---|
| committer | Adrien Tétar | 2015-11-07 18:52:51 +0100 | 
| commit | 9b2bc47a73a1e453aed95df907b1b120bd32b7b4 (patch) | |
| tree | 78160fa57f08865d08204097e938d16eb47e8455 /Lib/defconQt/objects/defcon.py | |
| parent | d648e2cb3f0a7bf7644dd2b2e610804e6e943a46 (diff) | |
| download | trufont-9b2bc47a73a1e453aed95df907b1b120bd32b7b4.tar.bz2 | |
meta: add custom glyphList support
Diffstat (limited to 'Lib/defconQt/objects/defcon.py')
| -rw-r--r-- | Lib/defconQt/objects/defcon.py | 12 | 
1 files changed, 9 insertions, 3 deletions
| diff --git a/Lib/defconQt/objects/defcon.py b/Lib/defconQt/objects/defcon.py index bb1336b..48de173 100644 --- a/Lib/defconQt/objects/defcon.py +++ b/Lib/defconQt/objects/defcon.py @@ -1,6 +1,7 @@  from defcon import Font, Contour, Glyph, Point  from defcon.objects.base import BaseObject -from fontTools.agl import AGL2UV +from PyQt5.QtWidgets import QApplication +import fontTools  class TFont(Font): @@ -59,10 +60,15 @@ class TGlyph(Glyph):      dirty = property(BaseObject._get_dirty, _set_dirty)      def autoUnicodes(self): +        app = QApplication.instance() +        if app.GL2UV is not None: +            GL2UV = app.GL2UV +        else: +            GL2UV = fontTools.agl.AGL2UV          hexes = "ABCDEF0123456789"          name = self.name -        if name in AGL2UV: -            uni = AGL2UV[name] +        if name in GL2UV: +            uni = GL2UV[name]          elif (name.startswith("uni") and len(name) == 7 and                all(c in hexes for c in name[3:])):              uni = int(name[3:], 16) | 
