xref: /aosp_15_r20/external/fonttools/Tests/feaLib/data/spec5d1.fea (revision e1fe3e4ad2793916b15cccdc4a7da52a7e1dd0e9)
1*e1fe3e4aSElliott Hughes# OpenType Feature File specification, section 5.d, example 1.
2*e1fe3e4aSElliott Hughes# http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html
3*e1fe3e4aSElliott Hughes
4*e1fe3e4aSElliott Hughesfeature F1 {
5*e1fe3e4aSElliott Hughes  sub [one one.oldstyle] [slash fraction] [two two.oldstyle] by onehalf;
6*e1fe3e4aSElliott Hughes} F1;
7*e1fe3e4aSElliott Hughes
8*e1fe3e4aSElliott Hughes# Since the OpenType specification does not allow ligature substitutions
9*e1fe3e4aSElliott Hughes# to be specified on target sequences that contain glyph classes, the
10*e1fe3e4aSElliott Hughes# implementation software will enumerate all specific glyph sequences
11*e1fe3e4aSElliott Hughes# if glyph classes are detected in <glyph sequence>.  Thus, the above
12*e1fe3e4aSElliott Hughes# example produces an identical representation in the font as if all
13*e1fe3e4aSElliott Hughes# the sequences were manually enumerated by the font editor:
14*e1fe3e4aSElliott Hughes#
15*e1fe3e4aSElliott Hughes# NOTE(anthrotype): The previous sentence is no longer entirely true, since we
16*e1fe3e4aSElliott Hughes# now preserve the order in which the ligatures (with same length and first glyph)
17*e1fe3e4aSElliott Hughes# were specified in the feature file and do not sort them alphabetically
18*e1fe3e4aSElliott Hughes# by the ligature component names. Therefore, the way this particular example from
19*e1fe3e4aSElliott Hughes# the FEA spec is written will produce two slightly different representations
20*e1fe3e4aSElliott Hughes# in the font in which the ligatures are enumerated differently, however the two
21*e1fe3e4aSElliott Hughes# lookups are functionally equivalent.
22*e1fe3e4aSElliott Hughes# See: https://github.com/fonttools/fonttools/issues/3428
23*e1fe3e4aSElliott Hughes# https://github.com/adobe-type-tools/afdko/issues/1727
24*e1fe3e4aSElliott Hughesfeature F2 {
25*e1fe3e4aSElliott Hughes  sub one slash two by onehalf;
26*e1fe3e4aSElliott Hughes  sub one.oldstyle slash two by onehalf;
27*e1fe3e4aSElliott Hughes  sub one fraction two by onehalf;
28*e1fe3e4aSElliott Hughes  sub one.oldstyle fraction two by onehalf;
29*e1fe3e4aSElliott Hughes  sub one slash two.oldstyle by onehalf;
30*e1fe3e4aSElliott Hughes  sub one.oldstyle slash two.oldstyle by onehalf;
31*e1fe3e4aSElliott Hughes  sub one fraction two.oldstyle by onehalf;
32*e1fe3e4aSElliott Hughes  sub one.oldstyle fraction two.oldstyle by onehalf;
33*e1fe3e4aSElliott Hughes} F2;
34