From 9b2bc47a73a1e453aed95df907b1b120bd32b7b4 Mon Sep 17 00:00:00 2001 From: Adrien Tétar Date: Sat, 7 Nov 2015 12:33:02 +0100 Subject: meta: add custom glyphList support --- Lib/defconQt/objects/defcon.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Lib/defconQt/objects/defcon.py') 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) -- cgit v1.2.3