add the generic getGlyphSet() API to T1Font as well.

git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@423 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
jvr 2003-08-25 17:53:29 +00:00
parent 1c9917bcf4
commit 7d4b693627

View File

@ -63,6 +63,17 @@ class T1Font:
# recreate the PS stream
return self.data
def getGlyphSet(self):
"""Return a generic GlyphSet, which is a dict-like object
mapping glyph names to glyph objects. The returned glyph objects
have a .draw() method that supports the Pen protocol, and will
have an attribute named 'width', but only *after* the .draw() method
has been called.
In the case of Type 1, the GlyphSet is simply the CharStrings dict.
"""
return self["CharStrings"]
def __getitem__(self, key):
if not hasattr(self, "font"):
self.parse()