[feaLib] Emit spaces around hyphens in ranges
This commit is contained in:
parent
e7fd47336d
commit
ec4273bbfd
@ -109,7 +109,7 @@ def asFea(g):
|
||||
if hasattr(g, 'asFea'):
|
||||
return g.asFea()
|
||||
elif isinstance(g, tuple) and len(g) == 2:
|
||||
return asFea(g[0]) + "-" + asFea(g[1]) # a range
|
||||
return asFea(g[0]) + " - " + asFea(g[1]) # a range
|
||||
elif g.lower() in fea_keywords:
|
||||
return "\\" + g
|
||||
else:
|
||||
|
@ -1,7 +1,7 @@
|
||||
feature test {
|
||||
pos X [A-B]' -40 B' -40 A' -40 Y;
|
||||
pos X [A - B]' -40 B' -40 A' -40 Y;
|
||||
subtable;
|
||||
pos X A' -111 Y;
|
||||
subtable;
|
||||
pos X B' -40 A' -111 [A-C]' -40 Y;
|
||||
pos X B' -40 A' -111 [A - C]' -40 Y;
|
||||
} test;
|
||||
|
@ -1,10 +1,10 @@
|
||||
lookup ChainedSingleSubst {
|
||||
sub [one two] three A' by A.sc;
|
||||
sub [B-D]' seven [eight nine] by [B.sc-D.sc];
|
||||
sub [B - D]' seven [eight nine] by [B.sc - D.sc];
|
||||
} ChainedSingleSubst;
|
||||
|
||||
lookup ChainedMultipleSubst {
|
||||
sub [A-C a-c] [D d] E c_t' V [W w] [X-Z x-z] by c t;
|
||||
sub [A - C a - c] [D d] E c_t' V [W w] [X - Z x - z] by c t;
|
||||
} ChainedMultipleSubst;
|
||||
|
||||
lookup ChainedAlternateSubst {
|
||||
|
@ -2,7 +2,7 @@ languagesystem DFLT dflt;
|
||||
|
||||
feature test {
|
||||
rsub [a A] [b B] [c C] q' [d D] [e E] [f F] by Q;
|
||||
rsub [a A] [b B] [c C] [s-z]' [d D] [e E] [f F] by [S-Z];
|
||||
rsub [a A] [b B] [c C] [s - z]' [d D] [e E] [f F] by [S - Z];
|
||||
|
||||
# Having no context for a reverse chaining substitution rule
|
||||
# is a little degenerate (we define a chain without linking it
|
||||
|
@ -5,7 +5,7 @@
|
||||
# makeotf produces {A:-40, B:-40, C:-40} and {A:-111, B:-40} which
|
||||
# is redundant. https://github.com/adobe-type-tools/afdko/issues/169
|
||||
feature test {
|
||||
pos X [A-B]' -40 B' -40 A' -40 Y;
|
||||
pos X [A - B]' -40 B' -40 A' -40 Y;
|
||||
pos X A' -111 Y;
|
||||
pos X B' -40 A' -111 [A-C]' -40 Y;
|
||||
pos X B' -40 A' -111 [A - C]' -40 Y;
|
||||
} test;
|
||||
|
@ -18,5 +18,5 @@ feature liga {
|
||||
} liga;
|
||||
|
||||
feature scmp {
|
||||
sub [a-z] by [A.sc-Z.sc];
|
||||
sub [a - z] by [A.sc - Z.sc];
|
||||
} scmp;
|
||||
|
@ -8,7 +8,7 @@ languagesystem latn TRK;
|
||||
languagesystem cyrl dflt;
|
||||
|
||||
feature smcp {
|
||||
sub [a-z] by [A.sc-Z.sc];
|
||||
sub [a - z] by [A.sc - Z.sc];
|
||||
|
||||
# Since all the rules in this feature are of the same type, they
|
||||
# will be grouped in a single lookup. Since no script or language
|
||||
|
@ -3,7 +3,7 @@
|
||||
# http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html
|
||||
|
||||
feature test {
|
||||
@LETTER = [a-z];
|
||||
@LETTER = [a - z];
|
||||
ignore sub @LETTER f' i';
|
||||
sub f' i' by f_i.begin;
|
||||
} test;
|
||||
|
@ -3,7 +3,7 @@
|
||||
# http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html
|
||||
|
||||
feature test {
|
||||
@LETTER = [a-z];
|
||||
@LETTER = [a - z];
|
||||
ignore sub @LETTER a' n' d', a' n' d' @LETTER;
|
||||
sub a' n' d' by a_n_d;
|
||||
} test;
|
||||
|
@ -2,13 +2,13 @@
|
||||
# "Specifying exceptions to the Chain Sub rule"
|
||||
# http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html
|
||||
|
||||
@LETTER = [A-Z a-z];
|
||||
@LETTER = [A - Z a - z];
|
||||
|
||||
feature cswh {
|
||||
|
||||
# --- Glyph classes used in this feature:
|
||||
@BEGINNINGS = [A-N P-Z T_h m];
|
||||
@BEGINNINGS_SWASH = [A.swash-N.swash P.swash-Z.swash T_h.swash m.begin];
|
||||
@BEGINNINGS = [A - N P - Z T_h m];
|
||||
@BEGINNINGS_SWASH = [A.swash - N.swash P.swash - Z.swash T_h.swash m.begin];
|
||||
@ENDINGS = [a e z];
|
||||
@ENDINGS_SWASH = [a.end e.end z.end];
|
||||
|
||||
|
@ -5,5 +5,5 @@
|
||||
languagesystem latn dflt;
|
||||
|
||||
feature test {
|
||||
sub [A-Z] [A.sc-Z.sc]' by [a-z];
|
||||
sub [A - Z] [A.sc - Z.sc]' by [a - z];
|
||||
} test;
|
||||
|
@ -10,7 +10,7 @@ feature aalt {
|
||||
} aalt;
|
||||
|
||||
feature smcp {
|
||||
sub [a-c] by [A.sc-C.sc];
|
||||
sub [a - c] by [A.sc - C.sc];
|
||||
sub f i by f_i; # not considered for aalt
|
||||
} smcp;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user