Features¶
Description¶
Features is text in the Adobe Font Development Kit for OpenType .fea syntax that describes the OpenType features of your font. The OpenType Cookbook is a great place to start learning how to write features. Your features must be self-contained; for example, any glyph or mark classes must be defined within the file. No assumption should be made about the validity of the syntax, and FontParts does not check the validity of the syntax.
Note
It is important to note that the features file may contain data that is a duplicate of or data that is in conflict with the data in BaseKerning, BaseGroups, and BaseInfo. Synchronization is up to the user and application developers.
font = CurrentFont()
print(font.features)
Overview¶
Copy the current object into a new object of the same type. |
|
Get the feature's parent font object. |
|
Get or set the features text. |
Reference¶
- class fontParts.base.BaseFeatures(*args: Any, **kwargs: Any)[source]¶
Represent the basis for a features object.
This class contains the font’s Adobe Font Development Kit for OpenType (AFDKO) feature definitions.
Copy¶
- BaseFeatures.copy() BaseObjectType¶
Copy the current object into a new object of the same type.
The returned object will not have a parent object.
- Returns:
A new
BaseObjectsubclass instance with the same attributes.
Parents¶
- BaseFeatures.font: dynamicProperty¶
Get the feature’s parent font object.
This property is read-only.
- Returns:
- Raises:
If attempting to set the font when it has already been set and is not the same as the provided font.
Example:
>>> font = features.font