diff --git a/Lib/fontTools/feaLib/ast.py b/Lib/fontTools/feaLib/ast.py index b0f805a7e..f998e306c 100644 --- a/Lib/fontTools/feaLib/ast.py +++ b/Lib/fontTools/feaLib/ast.py @@ -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: diff --git a/Tests/feaLib/data/ChainPosSubtable.fea b/Tests/feaLib/data/ChainPosSubtable.fea index 46506229a..e64f88678 100644 --- a/Tests/feaLib/data/ChainPosSubtable.fea +++ b/Tests/feaLib/data/ChainPosSubtable.fea @@ -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; diff --git a/Tests/feaLib/data/GSUB_6.fea b/Tests/feaLib/data/GSUB_6.fea index 82fdac250..223067016 100644 --- a/Tests/feaLib/data/GSUB_6.fea +++ b/Tests/feaLib/data/GSUB_6.fea @@ -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 { diff --git a/Tests/feaLib/data/GSUB_8.fea b/Tests/feaLib/data/GSUB_8.fea index 62c7bee4c..8f417496f 100644 --- a/Tests/feaLib/data/GSUB_8.fea +++ b/Tests/feaLib/data/GSUB_8.fea @@ -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 diff --git a/Tests/feaLib/data/bug514.fea b/Tests/feaLib/data/bug514.fea index 26da86557..1ef5af6ae 100644 --- a/Tests/feaLib/data/bug514.fea +++ b/Tests/feaLib/data/bug514.fea @@ -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; diff --git a/Tests/feaLib/data/language_required.fea b/Tests/feaLib/data/language_required.fea index 4005a781b..687c48a1c 100644 --- a/Tests/feaLib/data/language_required.fea +++ b/Tests/feaLib/data/language_required.fea @@ -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; diff --git a/Tests/feaLib/data/spec4h1.fea b/Tests/feaLib/data/spec4h1.fea index b43e13b0d..a3d249468 100644 --- a/Tests/feaLib/data/spec4h1.fea +++ b/Tests/feaLib/data/spec4h1.fea @@ -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 diff --git a/Tests/feaLib/data/spec5f_ii_2.fea b/Tests/feaLib/data/spec5f_ii_2.fea index b20a74c3b..916f797a8 100644 --- a/Tests/feaLib/data/spec5f_ii_2.fea +++ b/Tests/feaLib/data/spec5f_ii_2.fea @@ -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; diff --git a/Tests/feaLib/data/spec5f_ii_3.fea b/Tests/feaLib/data/spec5f_ii_3.fea index 5fd19916e..af06770de 100644 --- a/Tests/feaLib/data/spec5f_ii_3.fea +++ b/Tests/feaLib/data/spec5f_ii_3.fea @@ -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; diff --git a/Tests/feaLib/data/spec5f_ii_4.fea b/Tests/feaLib/data/spec5f_ii_4.fea index 731a1f643..bc6fda43e 100644 --- a/Tests/feaLib/data/spec5f_ii_4.fea +++ b/Tests/feaLib/data/spec5f_ii_4.fea @@ -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]; diff --git a/Tests/feaLib/data/spec5fi3.fea b/Tests/feaLib/data/spec5fi3.fea index e47a6f8aa..e44a7324b 100644 --- a/Tests/feaLib/data/spec5fi3.fea +++ b/Tests/feaLib/data/spec5fi3.fea @@ -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; diff --git a/Tests/feaLib/data/spec8a.fea b/Tests/feaLib/data/spec8a.fea index b4d7dd299..405482137 100644 --- a/Tests/feaLib/data/spec8a.fea +++ b/Tests/feaLib/data/spec8a.fea @@ -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;