@@ -182,7 +182,6 @@ def subset_font(font_in, font_out, unicodes, opts):
182182
183183def getsubset (subset , font_in ):
184184 subsets = subset .split ('+' )
185-
186185 quotes = [
187186 0x2013 , # endash
188187 0x2014 , # emdash
@@ -220,16 +219,16 @@ def getsubset(subset, font_in):
220219
221220 result = quotes
222221
223- if 'menu' in subset :
222+ if 'menu' in subsets :
224223 font = fontforge .open (font_in )
225224 result = [
226225 * map (ord , font .familyname ),
227226 0x0020 ,
228227 ]
229228
230- if 'latin' in subset :
229+ if 'latin' in subsets :
231230 result += latin
232- if 'latin-ext' in subset :
231+ if 'latin-ext' in subsets :
233232 # These ranges include Extended A, B, C, D, and Additional with the
234233 # exception of Vietnamese, which is a separate range
235234 result += [
@@ -240,7 +239,7 @@ def getsubset(subset, font_in):
240239 * range (0x2c60 , 0x2c80 ),
241240 * range (0xa700 , 0xa800 ),
242241 ]
243- if 'vietnamese' in subset :
242+ if 'vietnamese' in subsets :
244243 # 2011-07-16 DC: Charset from
245244 # http://vietunicode.sourceforge.net/charset/ + U+1ef9 from Fontaine
246245 result += [0x00c0 , 0x00c1 , 0x00c2 , 0x00c3 , 0x00C8 , 0x00C9 ,
@@ -251,16 +250,16 @@ def getsubset(subset, font_in):
251250 0x00FA , 0x00FD , 0x0102 , 0x0103 , 0x0110 , 0x0111 ,
252251 0x0128 , 0x0129 , 0x0168 , 0x0169 , 0x01A0 , 0x01A1 ,
253252 0x01AF , 0x01B0 , 0x20AB , * range (0x1EA0 , 0x1EFA )]
254- if 'greek' in subset :
253+ if 'greek' in subsets :
255254 # Could probably be more aggressive here and exclude archaic
256255 # characters, but lack data
257256 result += [* range (0x370 , 0x400 )]
258- if 'greek-ext' in subset :
257+ if 'greek-ext' in subsets :
259258 result += [* range (0x370 , 0x400 ), * range (0x1f00 , 0x2000 )]
260- if 'cyrillic' in subset :
259+ if 'cyrillic' in subsets :
261260 # Based on character frequency analysis
262261 result += [* range (0x400 , 0x460 ), 0x490 , 0x491 , 0x4b0 , 0x4b1 , 0x2116 ]
263- if 'cyrillic-ext' in subset :
262+ if 'cyrillic-ext' in subsets :
264263 result += [
265264 * range (0x400 , 0x530 ),
266265 0x20b4 ,
@@ -270,7 +269,7 @@ def getsubset(subset, font_in):
270269 * range (0x2de0 , 0x2e00 ),
271270 * range (0xa640 , 0xa6a0 ),
272271 ]
273- if 'arabic' in subset :
272+ if 'arabic' in subsets :
274273 # Based on Droid Arabic Kufi 1.0
275274 result += [0x000D , 0x0020 , 0x0621 , 0x0627 , 0x062D ,
276275 0x062F , 0x0631 , 0x0633 , 0x0635 , 0x0637 , 0x0639 ,
@@ -322,7 +321,7 @@ def getsubset(subset, font_in):
322321 0x063b , 0x063c , 0x063d , 0x063e , 0x063f , 0x0620 ,
323322 0x0674 , 0x0674 , 0x06EC ]
324323
325- if 'dejavu-ext' in subset :
324+ if 'dejavu-ext' in subsets :
326325 # add all glyphnames ending in .display
327326 font = fontforge .open (font_in )
328327 for glyph in font .glyphs ():
@@ -335,10 +334,10 @@ def getsubset(subset, font_in):
335334# code for extracting vertical metrics from a TrueType font
336335class Sfnt :
337336 def __init__ (self , data ):
338- version , numTables , _ , _ , _ = struct .unpack ('>IHHHH' , data [:12 ])
337+ _ , numTables , _ , _ , _ = struct .unpack ('>IHHHH' , data [:12 ])
339338 self .tables = {}
340339 for i in range (numTables ):
341- tag , checkSum , offset , length = struct .unpack (
340+ tag , _ , offset , length = struct .unpack (
342341 '>4sIII' , data [12 + 16 * i : 28 + 16 * i ])
343342 self .tables [tag ] = data [offset : offset + length ]
344343
0 commit comments