Changeset 229
- Timestamp:
- 02/13/11 17:13:54 (1 year ago)
- Files:
-
- trunk/Lib/robofab/objects/objectsFL.py (modified) (3 diffs)
- trunk/Lib/robofab/tools/toolsFL.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Lib/robofab/objects/objectsFL.py
r226 r229 660 660 661 661 def newGlyph(self, glyphName, clear=True): 662 """Make a new glyph""" 663 #if generate: 664 # g = GenerateGlyph(self._object, glyphName, replace=clear) 665 #else: 666 g = NewGlyph(self._object, glyphName, clear) 662 """Make a new glyph.""" 663 # the old implementation always updated the font. 664 # that proved to be very slow. so, the updating is 665 # now left up to the caller where it can be more 666 # efficiently managed. 667 g = NewGlyph(self._object, glyphName, clear, updateFont=False) 667 668 return RGlyph(g) 668 669 … … 1122 1123 if glyph.lib.has_key(postScriptHintDataLibKey): 1123 1124 del glyph.lib[postScriptHintDataLibKey] 1124 glyph.update()1125 1125 if bar and not count % 10: 1126 1126 bar.tick(count) … … 1163 1163 if bar: 1164 1164 bar.tick() 1165 # update the font 1166 self.update() 1165 1167 # only blindly stop if the user says to 1166 1168 except KeyboardInterrupt: trunk/Lib/robofab/tools/toolsFL.py
r1 r229 202 202 # 203 203 204 def NewGlyph(font, glyphName, clear=False ):204 def NewGlyph(font, glyphName, clear=False, updateFont=True): 205 205 """Make a new glyph if it doesn't already exist, return the glyph. 206 font is either a FL Font or RF RFont object. 206 font is either a FL Font or RF RFont object. If updateFont is True 207 the (very slow) fl.UpdateFont function will be called. 207 208 """ 208 209 font = unwrapFont(font) … … 214 215 new.name = glyphName 215 216 font.glyphs.append(new) 216 fl.UpdateFont(FontIndex(font)) 217 if updateFont: 218 fl.UpdateFont(FontIndex(font)) 217 219 glyph = font[glyphName] 218 220 elif clear:
