diff --git a/font-src/glyphs/symbol/math/arith.ptl b/font-src/glyphs/symbol/math/arith.ptl index 02e5af7c7..c13da53a4 100644 --- a/font-src/glyphs/symbol/math/arith.ptl +++ b/font-src/glyphs/symbol/math/arith.ptl @@ -157,12 +157,12 @@ glyph-block Symbol-Math-Arith : begin include : DrawAt Middle (SymbolMid + gap) (dr * sw / OperatorStroke - overshoot) include : DrawAt Middle (SymbolMid - gap) (dr * sw / OperatorStroke - overshoot) - select-variant 'dotplus' 0x2214 (follow -- 'smallPunctuation') - select-variant 'minusDot' 0x2238 (follow -- 'smallPunctuation') - select-variant 'geometricProportion' 0x223A (follow -- 'smallPunctuation') - select-variant 'minusColon' 0x2239 (follow -- 'smallPunctuation') - select-variant 'divide' 0xF7 (follow -- 'smallPunctuation') - select-variant 'divisionTimes' 0x22C7 (follow -- 'smallPunctuation') + select-variant 'dotplus' 0x2214 (follow -- 'punctuationDot') + select-variant 'minusDot' 0x2238 (follow -- 'punctuationDot') + select-variant 'geometricProportion' 0x223A (follow -- 'punctuationDot') + select-variant 'minusColon' 0x2239 (follow -- 'punctuationDot') + select-variant 'divide' 0xF7 (follow -- 'punctuationDot') + select-variant 'divisionTimes' 0x22C7 (follow -- 'punctuationDot') do define fine : AdviceStroke 5.5 diff --git a/font-src/glyphs/symbol/math/dots-and-colons.ptl b/font-src/glyphs/symbol/math/dots-and-colons.ptl index b87fdb729..92be6bbfd 100644 --- a/font-src/glyphs/symbol/math/dots-and-colons.ptl +++ b/font-src/glyphs/symbol/math/dots-and-colons.ptl @@ -51,11 +51,11 @@ glyph-block Symbol-Math-Dots-And-Colons : begin set-width MosaicWidth include : DrawAt MosaicMiddle SymbolMid (radius1 - overshoot) - select-variant 'therefore' 0x2234 (follow -- 'smallPunctuation') - select-variant 'because' 0x2235 (follow -- 'smallPunctuation') - select-variant 'mathcolon' 0x2236 (follow -- 'smallPunctuation') - select-variant 'coloncolon' 0x2237 (follow -- 'smallPunctuation') - select-variant 'mathcdot' (follow -- 'smallPunctuation') + select-variant 'therefore' 0x2234 (follow -- 'punctuationDot') + select-variant 'because' 0x2235 (follow -- 'punctuationDot') + select-variant 'mathcolon' 0x2236 (follow -- 'punctuationDot') + select-variant 'coloncolon' 0x2237 (follow -- 'punctuationDot') + select-variant 'mathcdot' (follow -- 'punctuationDot') for-width-kinds WideWidth1 - select-variant [MangleName 'mathcdotBig'] (follow -- 'smallPunctuation') + select-variant [MangleName 'mathcdotBig'] (follow -- 'punctuationDot') diff --git a/font-src/glyphs/symbol/math/relation.ptl b/font-src/glyphs/symbol/math/relation.ptl index 3f45c2a95..07b7e4560 100644 --- a/font-src/glyphs/symbol/math/relation.ptl +++ b/font-src/glyphs/symbol/math/relation.ptl @@ -39,7 +39,7 @@ glyph-block Symbol-Math-Relation-Common : begin define [WithDotVariants name unicode F] : begin foreach { suffix { DrawAt kDotRadius overshoot } } [Object.entries DotVariants] : do create-glyph "\(name).\(suffix)" : F DrawAt kDotRadius overshoot - select-variant name unicode (follow -- 'smallPunctuation') + select-variant name unicode (follow -- 'punctuationDot') glyph-block Symbol-Math-Relation-Equal : begin glyph-block-import CommonShapes diff --git a/font-src/glyphs/symbol/punctuation/ellipsis.ptl b/font-src/glyphs/symbol/punctuation/ellipsis.ptl index 236e7b9b1..515a5d0a7 100644 --- a/font-src/glyphs/symbol/punctuation/ellipsis.ptl +++ b/font-src/glyphs/symbol/punctuation/ellipsis.ptl @@ -65,13 +65,13 @@ glyph-block Symbol-Punctuation-Ellipsis : begin create-forked-glyph "\[MangleName 'mathCD2Dots'].\(suffix)" : begin VThreeDotsShape DrawAt kDotRadius overshoot left right (+1) OperBot OperTop - select-variant [MangleName 'onedotLeader'] [MangleUnicode 0x2024] (follow -- 'smallPunctuation') - select-variant [MangleName 'twodotsLEader'] [MangleUnicode 0x2025] (follow -- 'smallPunctuation') - select-variant [MangleName 'ellipsis'] [MangleUnicode 0x2026] (follow -- 'smallPunctuation') - select-variant [MangleName 'mathCDots'] [MangleUnicode 0x22EF] (follow -- 'smallPunctuation') - select-variant [MangleName 'mathCVDots'] [MangleUnicode 0x22EE] (follow -- 'smallPunctuation') - select-variant [MangleName 'mathCD1Dots'] [MangleUnicode 0x22F1] (follow -- 'smallPunctuation') - select-variant [MangleName 'mathCD2Dots'] [MangleUnicode 0x22F0] (follow -- 'smallPunctuation') + select-variant [MangleName 'onedotLeader'] [MangleUnicode 0x2024] (follow -- 'punctuationDot') + select-variant [MangleName 'twodotsLEader'] [MangleUnicode 0x2025] (follow -- 'punctuationDot') + select-variant [MangleName 'ellipsis'] [MangleUnicode 0x2026] (follow -- 'punctuationDot') + select-variant [MangleName 'mathCDots'] [MangleUnicode 0x22EF] (follow -- 'punctuationDot') + select-variant [MangleName 'mathCVDots'] [MangleUnicode 0x22EE] (follow -- 'punctuationDot') + select-variant [MangleName 'mathCD1Dots'] [MangleUnicode 0x22F1] (follow -- 'punctuationDot') + select-variant [MangleName 'mathCD2Dots'] [MangleUnicode 0x22F0] (follow -- 'punctuationDot') foreach { suffix { DrawAt kDotRadius overshoot } } [Object.entries DotVariants] : do @@ -80,4 +80,4 @@ glyph-block Symbol-Punctuation-Ellipsis : begin set-width df.width include : VThreeDotsShape DrawAt kDotRadius overshoot 0 df.width 0 0 XH - select-variant "triColon" 0x205D (follow -- 'smallPunctuation') + select-variant "triColon" 0x205D (follow -- 'punctuationDot') diff --git a/font-src/glyphs/symbol/punctuation/emotion.ptl b/font-src/glyphs/symbol/punctuation/emotion.ptl index 744b8cfe8..59566f3bd 100644 --- a/font-src/glyphs/symbol/punctuation/emotion.ptl +++ b/font-src/glyphs/symbol/punctuation/emotion.ptl @@ -30,8 +30,8 @@ glyph-block Symbol-Punctuation-Emotion : begin include : DrawAt Middle dr (dr - overshoot) set-mark-anchor 'cvDecompose' 0 0 - select-variant 'exclam' '!' (follow -- 'smallPunctuation') - select-variant 'question/dotPart' (follow -- 'smallPunctuation') + select-variant 'exclam' '!' (follow -- 'punctuationDot') + select-variant 'question/dotPart' (follow -- 'punctuationDot') alias 'alveolarclick' 0x1C3 'exclam' turned 'exclamDown' 0xA1 'exclam' [DivFrame para.diversityF].middle (XH / 2) diff --git a/font-src/glyphs/symbol/punctuation/interpuncts.ptl b/font-src/glyphs/symbol/punctuation/interpuncts.ptl index f7017b98d..79575ca5e 100644 --- a/font-src/glyphs/symbol/punctuation/interpuncts.ptl +++ b/font-src/glyphs/symbol/punctuation/interpuncts.ptl @@ -21,7 +21,7 @@ glyph-block Symbol-Punctuation-Interpuncts : begin set-width df.width include : DrawAt df.middle SymbolMid (PeriodRadius * kDotRadius - overshoot) - select-variant 'interpunct' 0xB7 (follow -- 'smallPunctuation') + select-variant 'interpunct' 0xB7 (follow -- 'punctuationDot') alias 'period/mid' null 'interpunct' alias 'greekbullet' 0x387 'interpunct' alias 'hyphenpoint' 0x2027 'interpunct' diff --git a/font-src/glyphs/symbol/punctuation/percentages.ptl b/font-src/glyphs/symbol/punctuation/percentages.ptl index eb87ca921..095c788d9 100644 --- a/font-src/glyphs/symbol/punctuation/percentages.ptl +++ b/font-src/glyphs/symbol/punctuation/percentages.ptl @@ -38,7 +38,7 @@ glyph-block Symbol-Punctuation-Percentages : begin include : DrawAt (SB + r) (CAP - r) (r - overshoot) include : DrawAt (RightSB - r) (0 + r) (r - overshoot) - select-variant 'commercialMinusSign' 0x2052 (follow -- 'smallPunctuation') + select-variant 'commercialMinusSign' 0x2052 (follow -- 'punctuationDot') create-glyph 'permille.NWID.dots' : glyph-proc define df : DivFrame para.diversityM diff --git a/font-src/glyphs/symbol/punctuation/small.ptl b/font-src/glyphs/symbol/punctuation/small.ptl index 1458e7ef1..16eb69913 100644 --- a/font-src/glyphs/symbol/punctuation/small.ptl +++ b/font-src/glyphs/symbol/punctuation/small.ptl @@ -24,7 +24,7 @@ glyph-block Symbol-Punctuation-Small : begin set-width df.width include : DotAt df.middle (XH - PeriodRadius * kDotRadius) (PeriodRadius * kDotRadius - overshoot) - select-variant 'period' '.' (follow -- 'smallPunctuation') + select-variant 'period' '.' (follow -- 'punctuationDot') define [CommaShapeT cx cy gp] : new-glyph : glyph-proc set currentGlyph.gizmo [Translate 0 0] @@ -133,8 +133,8 @@ glyph-block Symbol-Punctuation-Small : begin quadcontrols (0 - TanSlope / 2) (0.5 - TanSlope * r / Descender) 12 g4 (commaOverflow + Descender * TanSlope) Descender [widths.lhs swEnd] - select-variant 'comma' ',' (follow -- 'smallPunctuation') - select-variant 'invertComma' (follow -- 'smallPunctuation') + select-variant 'comma' ',' (follow -- 'punctuationDot') + select-variant 'invertComma' (follow -- 'punctuationDot') foreach { suffix { DrawAt kDotRadius overshoot } } [Object.entries DotVariants] : do @@ -158,10 +158,10 @@ glyph-block Symbol-Punctuation-Small : begin include [refer-glyph "comma.\(suffix)"] AS_BASE ALSO_METRICS include [refer-glyph "xhPeriod.\(suffix)"] - select-variant 'colon' ':' (follow -- 'smallPunctuation') - select-variant 'colon/mid' (follow -- 'smallPunctuation') - select-variant 'modifierLetterColon' 0xA789 (follow -- 'smallPunctuation') - select-variant 'semicolon' ';' (follow -- 'smallPunctuation') + select-variant 'colon' ':' (follow -- 'punctuationDot') + select-variant 'colon/mid' (follow -- 'punctuationDot') + select-variant 'modifierLetterColon' 0xA789 (follow -- 'punctuationDot') + select-variant 'semicolon' ';' (follow -- 'punctuationDot') alias 'greekquestion' 0x37E 'semicolon' # Hollow (no CV) diff --git a/font-src/support/variant-data.js b/font-src/support/variant-data.js index ecb404803..79eebfd51 100644 --- a/font-src/support/variant-data.js +++ b/font-src/support/variant-data.js @@ -79,6 +79,7 @@ class Prime { this.tag = cfg.tag; this.slopeDependent = !!cfg.slopeDependent; this.variants = new Map(); + this.hotChars = cfg.hotChars ? [...cfg.hotChars] : this.descSampleText; for (const varKey in cfg.variants) { const variant = cfg.variants[varKey]; this.variants.set(varKey, new PrimeVariant(varKey, cfg.tag, variant)); @@ -100,6 +101,7 @@ class Prime { slopeDependent: this.slopeDependent, ligatureSampler: this.ligatureSampler, descSampleText: this.descSampleText, + hotChars: this.hotChars, variants: [] }; for (const variant of this.variants.values()) { diff --git a/params/variants.toml b/params/variants.toml index b312d6a93..e3658ab6f 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -6085,20 +6085,21 @@ selector.question = "cornerFlatHooked" -[prime.small-punctuation] -sampler = ".," +[prime.punctuation-dot] +sampler = "., :;" +hotChars = ".,:;?!" samplerExplain = "Dot and Comma shape in punctuations and symbols" tag = "cv99" -[prime.small-punctuation.variants.round] +[prime.punctuation-dot.variants.round] rank = 1 description = "Small punctuations (like `.`, `,`) use round dots" -selector.smallPunctuation = "round" +selector.punctuationDot = "round" -[prime.small-punctuation.variants.square] +[prime.punctuation-dot.variants.square] rank = 2 description = "Small punctuations (like `.`, `,`) use square dots" -selector.smallPunctuation = "square" +selector.punctuationDot = "square" @@ -6205,7 +6206,7 @@ bar = "natural-slope" ascii-single-quote = "straight" ascii-grave = "straight" question = "smooth" -small-punctuation = "round" +punctuation-dot = "round" # m, n, h has tailed variant, but not very ideal # Do not make them default diff --git a/utility/export-data/variants-data.js b/utility/export-data/variants-data.js index 4ed09596f..670040a13 100644 --- a/utility/export-data/variants-data.js +++ b/utility/export-data/variants-data.js @@ -136,7 +136,9 @@ function buildupComposite(variants, para, ...composites) { for (const [prime, variant] of composite.decompose(para, variants.selectorTree)) { if (!prime.sampler) continue; const key = getSelectorKey(prime, variant); - if (/ /.test(prime.sampler)) { + if (prime.hotChars) { + for (const ch of prime.hotChars) hotChars.set(ch, key); + } else if (isLigatureSampler(prime)) { for (const ch of prime.sampler.split(" ")) hotChars.set(ch, key); } else { for (const ch of prime.sampler) hotChars.set(ch, key);