xref: /aosp_15_r20/external/fonttools/Doc/source/feaLib/index.rst (revision e1fe3e4ad2793916b15cccdc4a7da52a7e1dd0e9)
1#########################################
2feaLib: Read/write OpenType feature files
3#########################################
4
5fontTools' ``feaLib`` allows for the creation and parsing of Adobe
6Font Development Kit for OpenType feature (``.fea``) files. The syntax
7of these files is described `here <https://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html>`_.
8
9The :class:`fontTools.feaLib.parser.Parser` class can be used to parse files
10into an abstract syntax tree, and from there the
11:class:`fontTools.feaLib.builder.Builder` class can add features to an existing
12font file. You can inspect the parsed syntax tree, walk the tree and do clever
13things with it, and also generate your own feature files programmatically, by
14using the classes in the :mod:`fontTools.feaLib.ast` module.
15
16Parsing
17-------
18
19.. autoclass:: fontTools.feaLib.parser.Parser
20   :members: parse
21   :member-order: bysource
22
23Building
24---------
25
26.. automodule:: fontTools.feaLib.builder
27   :members: addOpenTypeFeatures, addOpenTypeFeaturesFromString
28
29Generation/Interrogation
30------------------------
31
32.. _`glyph-containing object`:
33.. _`glyph-containing objects`:
34
35In the below, a **glyph-containing object** is an object of one of the following
36classes: :class:`GlyphName`, :class:`GlyphClass`, :class:`GlyphClassName`.
37
38.. automodule:: fontTools.feaLib.ast
39   :member-order: bysource
40   :members:
41