aboutsummaryrefslogtreecommitdiffstats
path: root/Lib/defconQt/objects/defcon.py
diff options
context:
space:
mode:
authorAdrien Tétar2015-10-08 22:44:08 +0200
committerAdrien Tétar2015-10-08 22:44:08 +0200
commit35b6257f0f39f18b668e45905b31d5a4f63762e6 (patch)
tree2b0802900fb114f3995bee42777cf99a6ea94c66 /Lib/defconQt/objects/defcon.py
parentf0ffdc1a606db8af02463f164017fdefa6e68819 (diff)
downloadtrufont-35b6257f0f39f18b668e45905b31d5a4f63762e6.tar.bz2
fontView: don't add characterSet glyphs in SortingDialog, beef up AddGlyphsDialog
Diffstat (limited to 'Lib/defconQt/objects/defcon.py')
-rw-r--r--Lib/defconQt/objects/defcon.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/defconQt/objects/defcon.py b/Lib/defconQt/objects/defcon.py
index 51fca47..f195c8c 100644
--- a/Lib/defconQt/objects/defcon.py
+++ b/Lib/defconQt/objects/defcon.py
@@ -1,5 +1,6 @@
from defcon import Font, Contour, Glyph, Point
from defcon.objects.base import BaseObject
+from fontTools.agl import AGL2UV
class TFont(Font):
def __init__(self, *args, **kwargs):
@@ -11,6 +12,22 @@ class TFont(Font):
kwargs["glyphPointClass"] = TPoint
super(TFont, self).__init__(*args, **kwargs)
+ def newStandardGlyph(self, name, override=False, addUnicode=True, asTemplate=False, width=500):
+ if not override:
+ if name in self:
+ return None
+ # XXX(defcon): newGlyph should return the glyph
+ self.newGlyph(name)
+ glyph = self[name]
+ glyph.width = width
+ # TODO: list ought to be changeable from AGL2UV
+ if addUnicode:
+ if name in AGL2UV:
+ glyph.unicode = AGL2UV[name]
+ glyph.template = asTemplate
+ return glyph
+
+ # TODO: stop using that workaround now that we're ufo3
def save(self, path=None, formatVersion=None):
for glyph in self:
if glyph.template: