Changeset 99
- Timestamp:
- 10/28/07 21:38:26 (15 months ago)
- Files:
-
- 1 modified
-
hacks/trunk/automatic_text.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hacks/trunk/automatic_text.py
r98 r99 30 30 31 31 __author__ = "Antonio Cavedoni <http://cavedoni.com/>" 32 __version__ = "0. 1"32 __version__ = "0.2" 33 33 __svnid__ = "$Id$" 34 34 __license__ = "Python" 35 __contributors__ = [ 36 "Claudio Piccinini <http://www.tht.it/>" 37 "Karsten Luecke <http://www.kltf.de/>" 38 ] 35 39 36 40 UPPERCASE = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z".split() … … 163 167 164 168 def get_all_glyphs(): 165 # sort the glyphs by Unicode 169 # generate a temp font so we can sort its glyphs 170 # by Unicode name without damaging the original 171 tempfont = Font(fl.font) 172 fl.Add(tempfont) 173 tempfontid = fl.ifont 166 174 fl.CallCommand(fl_cmd.FontSortByUnicode) 167 175 168 176 # build a string with all the characters 169 177 glyphs = [] 170 for i in range(len( fl.font)):178 for i in range(len(tempfont)): 171 179 n = fl.font[i].name 172 180 if n not in ['.notdef', '.null', 'CR']: 173 181 glyphs.append(get_glyph_name(fl.font[i].name)) 182 183 # close the temp font 184 tempfont.modified = 0 185 fl.Close(tempfontid) 186 174 187 return glyphs 175 188 … … 198 211 199 212 def generate(glyph_set, glyph_name=None): 200 # sort the glyphs by Unicode201 fl.CallCommand(fl_cmd.FontSortByUnicode)202 203 213 # open metrics window 204 214 fl.CallCommand(fl_cmd.WindowNewMetrics)