fontInfoData
This file provides fallback data for info attributes
that are required for building OTFs. There are two main
functions that are important:
There are a set of other functions that are used internally
for synthesizing values for specific attributes. These can be
used externally as well.
Main Functions
-
ufo2fdk.fontInfoData.getAttrWithFallback(info, attr)
- Get the value for attr from the info object.
If the object does not have the attribute or the value
for the atribute is None, this will either get a
value from a predefined set of attributes or it
will synthesize a value from the available data.
-
ufo2fdk.fontInfoData.preflightInfo(info)
Returns a dict containing two items. The value for each
item will be a list of info attribute names.
missingRequired |
Required data that is missing. |
missingRecommended |
Recommended data that is missing. |
Static Fallbacks
Most of the fallbacks have static values. To see what is set for these, look at the source code’s staticFallbackData definition.
Special Fallbacks
In some cases, the fallback values are dynamically generated from other data in the info object. These are handled internally with functions.
-
ufo2fdk.fontInfoData.styleMapFamilyNameFallback(info)
- Fallback to openTypeNamePreferredFamilyName openTypeNamePreferredSubfamilyName.
-
ufo2fdk.fontInfoData.openTypeHeadCreatedFallback(info)
- Fallback to now.
-
ufo2fdk.fontInfoData.openTypeHheaAscenderFallback(info)
- Fallback to unitsPerEm + descender.
-
ufo2fdk.fontInfoData.openTypeHheaDescenderFallback(info)
- Fallback to descender.
-
ufo2fdk.fontInfoData.openTypeNameVersionFallback(info)
- Fallback to versionMajor.versionMinor in the form 0.000.
-
ufo2fdk.fontInfoData.openTypeNameUniqueIDFallback(info)
- Fallback to openTypeNameVersion;openTypeOS2VendorID;styleMapFamilyName styleMapStyleName.
-
ufo2fdk.fontInfoData.openTypeNamePreferredFamilyNameFallback(info)
- Fallback to familyName.
-
ufo2fdk.fontInfoData.openTypeNamePreferredSubfamilyNameFallback(info)
- Fallback to styleName.
-
ufo2fdk.fontInfoData.openTypeNameCompatibleFullNameFallback(info)
- Fallback to styleMapFamilyName styleMapStyleName.
If styleMapStyleName is regular this will not add
the style name.
-
ufo2fdk.fontInfoData.openTypeOS2TypoAscenderFallback(info)
- Fallback to unitsPerEm + descender.
-
ufo2fdk.fontInfoData.openTypeOS2TypoDescenderFallback(info)
- Fallback to descender.
-
ufo2fdk.fontInfoData.openTypeOS2WinAscentFallback(info)
- Fallback to the maximum y value of the font’s bounding box.
If that is not available, fallback to ascender.
-
ufo2fdk.fontInfoData.openTypeOS2WinDescentFallback(info)
- Fallback to the minimum y value of the font’s bounding box.
If that is not available, fallback to descender.
-
ufo2fdk.fontInfoData.postscriptFontNameFallback(info)
- Fallback to a string containing only valid characters
as defined in the specification. This will draw from
openTypeNamePreferredFamilyName and openTypeNamePreferredSubfamilyName.
-
ufo2fdk.fontInfoData.postscriptFullNameFallback(info)
- Fallback to openTypeNamePreferredFamilyName openTypeNamePreferredSubfamilyName.
-
ufo2fdk.fontInfoData.postscriptSlantAngleFallback(info)
- Fallback to italicAngle.
-
ufo2fdk.fontInfoData.postscriptWeightNameFallback(info)
Fallback to the closest match of the openTypeOS2WeightClass
in this table:
100 |
Thin |
200 |
Extra-light |
300 |
Light |
400 |
Normal |
500 |
Medium |
600 |
Semi-bold |
700 |
Bold |
800 |
Extra-bold |
900 |
Black |