From e57491754ec76ecb492a4a56307e1b87fc899510 Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Wed, 19 Apr 2023 09:55:17 -0700 Subject: [PATCH] calt improvement: 0x{numeral} no longer substitutes /multiply re #404 --- src/features/calt.fea | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/src/features/calt.fea b/src/features/calt.fea index 93fef6c64..5c1200c5d 100644 --- a/src/features/calt.fea +++ b/src/features/calt.fea @@ -351,18 +351,36 @@ sub @Numeral @Whitespace @Whitespace @between_num_L' @Whitespace @Whitespace @Nu # END case # ------------------------------------------------------------------------------------- # BEGIN NxN +# x surrounded by numbers, e.g: +# 3x4 -> 3×4 +# 10x20 -> 10×20 +# 0x10 -> 0x10 No substitution +# +@NumNoZero = [ + # + # NOTE! Keep this up to date with @Whitespace + # + # 1. in glyphs, copy list from font into > features > Whitespace class + # 2. paste & replace this list here + # 3. remove all "zero" glyphs + # + one two twostroke three four five Tonefive six seven eight nine + one.ss01 three.1 four.ss01 six.ss01 nine.ss01 + one.tf two.tf three.tf four.tf five.tf six.tf seven.tf eight.tf + nine.tf one.tf.ss01 three.1.tf four.tf.ss01 six.tf.ss01 + nine.tf.ss01 +]; -# x surrounded by numbers, e.g. 3x4 -> 3×4 -sub @Numeral x' @Numeral by multiply.case; # 3x9 -sub @Numeral @Whitespace x' @Numeral by multiply.case; # 3 x9 -sub @Numeral @Whitespace @Whitespace x' @Numeral by multiply.case; # 3 x9 -sub @Numeral x' @Whitespace @Numeral by multiply.case; # 3x 9 -sub @Numeral @Whitespace x' @Whitespace @Numeral by multiply.case; # 3 x 9 -sub @Numeral @Whitespace @Whitespace x' @Whitespace @Numeral by multiply.case; # 3 x 9 -sub @Numeral x' @Whitespace @Whitespace @Numeral by multiply.case; # 3x 9 -sub @Numeral @Whitespace x' @Whitespace @Whitespace @Numeral by multiply.case; # 3 x 9 -sub @Numeral @Whitespace @Whitespace x' @Whitespace @Whitespace @Numeral by multiply.case; # 3 x 9 +sub @NumNoZero x' @Numeral by multiply.case; # "3x9" "1x0" +sub @Numeral @Numeral x' @Numeral by multiply.case; # "10x0" + +sub @NumNoZero @Whitespace x' @Numeral by multiply.case; # "3 x9" "1 x0" +sub @NumNoZero @Whitespace x' @Whitespace @Numeral by multiply.case; # "3 x 9" "1 x 0" +sub @NumNoZero x' @Whitespace @Numeral by multiply.case; # "3x 9" "1x 0" + +sub @Numeral @Numeral @Whitespace x' @Numeral by multiply.case; # "10 x0" +sub @Numeral @Numeral @Whitespace x' @Whitespace @Numeral by multiply.case; # "10 x 0" +sub @Numeral @Numeral x' @Whitespace @Numeral by multiply.case; # "10x 0" # END NxN # ------------------------------------------------------------------------------------- -