Makes the fontinfo file for the Adobe FDK Setting 'IsOS/2OBLIQUE' causes weird things to happen with italic fonts so we never set that to true. *stylename* is a `string` of the font's style (font.info.styleName) *dir* is a `string` of the path to the directory where the UFO is
(stylename, dir)
| 214 | |
| 215 | |
| 216 | def buildFontInfo(stylename, dir): |
| 217 | """ |
| 218 | Makes the fontinfo file for the Adobe FDK |
| 219 | |
| 220 | Setting 'IsOS/2OBLIQUE' causes weird things to happen with italic fonts |
| 221 | so we never set that to true. |
| 222 | |
| 223 | *stylename* is a `string` of the font's style (font.info.styleName) |
| 224 | *dir* is a `string` of the path to the directory where the UFO is |
| 225 | """ |
| 226 | |
| 227 | style = stylename.split() |
| 228 | bold = italic = "false" |
| 229 | if "Bold" in style: |
| 230 | bold = "true" |
| 231 | if "Italic" in style: |
| 232 | italic = "true" |
| 233 | fontinfo = (f"IsBoldStyle {bold}\n" |
| 234 | f"IsItalicStyle {italic}\n" |
| 235 | "PreferOS/2TypoMetrics true\n" |
| 236 | "IsOS/2WidthWeigthSlopeOnly true\n" |
| 237 | "IsOS/2OBLIQUE false\n") |
| 238 | path = os.path.join(dir, "fontinfo") |
| 239 | with open(path, "w") as f: |
| 240 | f.write(fontinfo) |
| 241 | |
| 242 | |
| 243 | def writeFeature(font): |