@@ -122,14 +122,6 @@ def write_recipe(self):
122122 else :
123123 self .fvarInstancesFile = None
124124
125- if "fontsetter" in self .config :
126- self .fontsetterfiles = {}
127- for font in list (self .config ["fontsetter" ].keys ()):
128- tmp_file = NamedTemporaryFile (delete = False , mode = "w+" )
129- self .config ["fontsetter" ][font ] = self .config ["fontsetter" ][font ]
130- yaml .dump (self .config ["fontsetter" ][font ], tmp_file )
131- self .fontsetterfiles [font ] = tmp_file
132-
133125 # Find variable fonts
134126 self .recipe = {}
135127 self .build_all_variables ()
@@ -285,8 +277,6 @@ def build_all_variables(self):
285277 self .build_avar2 ()
286278 if "fvarInstances" in self .config :
287279 self .build_fvar_instances ()
288- if "fontsetter" in self .config :
289- self .build_fontsetter ()
290280
291281 def build_spacing_axis (self ):
292282 vfs = [x for x in self .recipe .keys () if x .endswith ("ttf" )]
@@ -341,18 +331,6 @@ def build_fvar_instances(self):
341331 self .recipe [vf ].append (args )
342332 self .fvarInstancesFile .close ()
343333
344- def build_fontsetter (self ):
345- vfs = [x for x in self .recipe .keys () if x .endswith ("ttf" )]
346- for vf in vfs :
347- filename = os .path .basename (vf )
348- if filename not in self .fontsetterfiles :
349- continue
350- args = {
351- "args" : self .fontsetterfiles [filename ].name ,
352- "postprocess" : "fontsetter" ,
353- }
354- self .recipe [vf ].append (args )
355-
356334 def _vtt_steps (self , target : str ):
357335 if os .path .basename (target ) in self .config .get ("vttSources" , {}):
358336 return [
@@ -452,8 +430,6 @@ def build_all_statics(self):
452430 self .build_a_static (source , instance , output = "ttf" )
453431 if self .config ["buildOTF" ]:
454432 self .build_a_static (source , instance , output = "otf" )
455- if "fontsetter" in self .config :
456- self .build_fontsetter ()
457433
458434 def build_a_static (self , source : File , instance : InstanceDescriptor , output ):
459435 suffix = self .config .get ("filenameSuffix" , "" )
@@ -585,17 +561,25 @@ def _italic_fixup(self):
585561 # "italic enough" to convince gftools-fix-font to apply all its italic
586562 # font fixes (post.italicAngle etc.) when we call it with
587563 # --include-source-fixes.
564+ configfile = NamedTemporaryFile (delete = False , mode = "w+" )
588565 family_name = self .sources [0 ].family_name .replace (" " , "" )
566+ # Since this is mad YAML, we can't use the normal YAML library
567+ # to write this. We'll just write it out manually.
568+ configfile .write (
569+ f"""
570+ OS/2->fsSelection: 129
571+ head->macStyle: "|= 0x02"
572+ name->setName: ["{ family_name } Italic", 25, 3, 1, 0x409]
573+ name->setName: ["Italic", 2, 3, 1, 0x409]
574+ name->setName: ["Italic", 17, 3, 1, 0x409]
575+ """
576+ )
577+ configfile .close ()
589578 return [
590579 {
591- "operation" : "fontsetter" ,
592- "values" : [
593- ["OS/2->fsSelection" , 129 ],
594- ["head->macStyle" , "|= 0x02" ],
595- ["name->setName" , [f"{ family_name } Italic" , 25 , 3 , 1 , 0x409 ]],
596- ["name->setName" , ["Italic" , 2 , 3 , 1 , 0x409 ]],
597- ["name->setName" , ["Italic" , 17 , 3 , 1 , 0x409 ]],
598- ],
580+ "operation" : "exec" ,
581+ "exe" : "gftools-fontsetter" ,
582+ "args" : "-o $out $in " + configfile .name ,
599583 },
600584 {
601585 "operation" : "fix" ,
0 commit comments