Merge pull request #3216 from fonttools/document-instance-labels

Document instance labelling
This commit is contained in:
Cosimo Lupo 2023-07-21 11:40:10 +01:00 committed by GitHub
commit bc5f6e1e32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -892,6 +892,11 @@ The ``<instances>`` element contains one or more ``<instance>`` elements.
with ``styleMapFamilyName``
- ``stylemapstylename``: string. Optional for MutatorMath. Corresponds
with ``styleMapStyleName``
- ``location``: string. Optional. Describes the location of this instance,
taking it from the root level ``<labels>`` (STAT format 4) element with the
same name as the string.
.. versionadded:: 5.0
``<location>`` element (instance)
@ -961,6 +966,30 @@ Example for varLib
</instance>
Here is an example using STAT format 4 labels to define the location of the
instance directly.
.. code:: xml
<?xml version='1.0' encoding='utf-8'?>
<designspace format="5.0">
<!-- ... -->
<labels>
<!-- define STAT format 4 labels here -->
<!-- New in version 5.0 -->
<label name="Extra Light">
<location>
<dimension name="weight" uservalue="123" />
</location>
</label>
</labels>
<!-- ... -->
<instances>
<instance filename="instances/labelled.ufo" location="Extra Light" />
</instances>
</designspace>
``<glyphs>`` element (instance)
-------------------------------