Lines Matching refs:varfont
105 def interpolate_cff2_metrics(varfont, topDict, glyphOrder, loc): argument
114 hmtx = varfont['hmtx']
116 if 'HVAR' in varfont:
117 hvar_table = varfont['HVAR'].table
118 fvar = varfont['fvar']
152 def instantiateVariableFont(varfont, location, inplace=False, overlap=True): argument
169 varfont.save(stream)
171 varfont = TTFont(stream)
173 fvar = varfont['fvar']
176 if 'avar' in varfont:
177 maps = varfont['avar'].segments
184 if 'gvar' in varfont:
186 gvar = varfont['gvar']
187 glyf = varfont['glyf']
197 coordinates, _ = glyf.getCoordinatesAndControls(glyphname, varfont)
205 origCoords, g = glyf.getCoordinatesAndControls(glyphname, varfont)
208 glyf.setCoordinates(glyphname, coordinates, varfont)
212 if 'cvar' in varfont:
214 cvar = varfont['cvar']
215 cvt = varfont['cvt ']
226 if 'CFF2' in varfont:
228 glyphOrder = varfont.getGlyphOrder()
229 CFF2 = varfont['CFF2']
236 interpolate_cff2_metrics(varfont, topDict, glyphOrder, loc)
240 if 'MVAR' in varfont:
242 mvar = varfont['MVAR'].table
253 setattr(varfont[tableTag], itemName,
254 getattr(varfont[tableTag], itemName) + delta)
258 if not tableTag in varfont:
260 table = varfont[tableTag].table
287 if 'GDEF' in varfont and varfont['GDEF'].table.Version >= 0x00010003:
289 gdef = varfont['GDEF'].table
292 merger = MutatorMerger(varfont, instancer)
293 merger.mergeTables(varfont, [varfont], ['GDEF', 'GPOS'])
307 del varfont['GDEF']
330 if 'fpgm' in varfont:
331 fpgm = varfont['fpgm']
336 varfont['fpgm'] = fpgm
347 if 'maxp' in varfont:
348 maxp = varfont['maxp']
352 if 'name' in varfont:
358 if 'ltag' in varfont:
363 n.langID for n in varfont['name'].names
366 if set(excludedUnicodeLangIDs) == set(range(len((varfont['ltag'].tags)))):
367 del varfont['ltag']
368 varfont['name'].names[:] = [
369 n for n in varfont['name'].names
373 if "wght" in location and "OS/2" in varfont:
374 varfont["OS/2"].usWeightClass = otRound(
381 varfont["OS/2"].usWidthClass = widthClass
384 varfont["OS/2"].usWidthClass = 9
385 if "slnt" in location and "post" in varfont:
386 varfont["post"].italicAngle = max(-90, min(location["slnt"], 90))
390 if tag in varfont:
391 del varfont[tag]
393 return varfont
446 varfont = TTFont(varfilename)
448 instantiateVariableFont(varfont, loc, inplace=True, overlap=options.overlap)
451 varfont.save(outfile)