Refine names of dot variants (#927)
This commit is contained in:
parent
90bcf7fff8
commit
205cb5958a
11 changed files with 45 additions and 40 deletions
|
@ -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)
|
||||||
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 'dotplus' 0x2214 (follow -- 'punctuationDot')
|
||||||
select-variant 'minusDot' 0x2238 (follow -- 'smallPunctuation')
|
select-variant 'minusDot' 0x2238 (follow -- 'punctuationDot')
|
||||||
select-variant 'geometricProportion' 0x223A (follow -- 'smallPunctuation')
|
select-variant 'geometricProportion' 0x223A (follow -- 'punctuationDot')
|
||||||
select-variant 'minusColon' 0x2239 (follow -- 'smallPunctuation')
|
select-variant 'minusColon' 0x2239 (follow -- 'punctuationDot')
|
||||||
select-variant 'divide' 0xF7 (follow -- 'smallPunctuation')
|
select-variant 'divide' 0xF7 (follow -- 'punctuationDot')
|
||||||
select-variant 'divisionTimes' 0x22C7 (follow -- 'smallPunctuation')
|
select-variant 'divisionTimes' 0x22C7 (follow -- 'punctuationDot')
|
||||||
|
|
||||||
do
|
do
|
||||||
define fine : AdviceStroke 5.5
|
define fine : AdviceStroke 5.5
|
||||||
|
|
|
@ -51,11 +51,11 @@ glyph-block Symbol-Math-Dots-And-Colons : begin
|
||||||
set-width MosaicWidth
|
set-width MosaicWidth
|
||||||
include : DrawAt MosaicMiddle SymbolMid (radius1 - overshoot)
|
include : DrawAt MosaicMiddle SymbolMid (radius1 - overshoot)
|
||||||
|
|
||||||
select-variant 'therefore' 0x2234 (follow -- 'smallPunctuation')
|
select-variant 'therefore' 0x2234 (follow -- 'punctuationDot')
|
||||||
select-variant 'because' 0x2235 (follow -- 'smallPunctuation')
|
select-variant 'because' 0x2235 (follow -- 'punctuationDot')
|
||||||
select-variant 'mathcolon' 0x2236 (follow -- 'smallPunctuation')
|
select-variant 'mathcolon' 0x2236 (follow -- 'punctuationDot')
|
||||||
select-variant 'coloncolon' 0x2237 (follow -- 'smallPunctuation')
|
select-variant 'coloncolon' 0x2237 (follow -- 'punctuationDot')
|
||||||
select-variant 'mathcdot' (follow -- 'smallPunctuation')
|
select-variant 'mathcdot' (follow -- 'punctuationDot')
|
||||||
|
|
||||||
for-width-kinds WideWidth1
|
for-width-kinds WideWidth1
|
||||||
select-variant [MangleName 'mathcdotBig'] (follow -- 'smallPunctuation')
|
select-variant [MangleName 'mathcdotBig'] (follow -- 'punctuationDot')
|
||||||
|
|
|
@ -39,7 +39,7 @@ glyph-block Symbol-Math-Relation-Common : begin
|
||||||
define [WithDotVariants name unicode F] : begin
|
define [WithDotVariants name unicode F] : begin
|
||||||
foreach { suffix { DrawAt kDotRadius overshoot } } [Object.entries DotVariants] : do
|
foreach { suffix { DrawAt kDotRadius overshoot } } [Object.entries DotVariants] : do
|
||||||
create-glyph "\(name).\(suffix)" : F DrawAt kDotRadius overshoot
|
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 Symbol-Math-Relation-Equal : begin
|
||||||
glyph-block-import CommonShapes
|
glyph-block-import CommonShapes
|
||||||
|
|
|
@ -65,13 +65,13 @@ glyph-block Symbol-Punctuation-Ellipsis : begin
|
||||||
create-forked-glyph "\[MangleName 'mathCD2Dots'].\(suffix)" : begin
|
create-forked-glyph "\[MangleName 'mathCD2Dots'].\(suffix)" : begin
|
||||||
VThreeDotsShape DrawAt kDotRadius overshoot left right (+1) OperBot OperTop
|
VThreeDotsShape DrawAt kDotRadius overshoot left right (+1) OperBot OperTop
|
||||||
|
|
||||||
select-variant [MangleName 'onedotLeader'] [MangleUnicode 0x2024] (follow -- 'smallPunctuation')
|
select-variant [MangleName 'onedotLeader'] [MangleUnicode 0x2024] (follow -- 'punctuationDot')
|
||||||
select-variant [MangleName 'twodotsLEader'] [MangleUnicode 0x2025] (follow -- 'smallPunctuation')
|
select-variant [MangleName 'twodotsLEader'] [MangleUnicode 0x2025] (follow -- 'punctuationDot')
|
||||||
select-variant [MangleName 'ellipsis'] [MangleUnicode 0x2026] (follow -- 'smallPunctuation')
|
select-variant [MangleName 'ellipsis'] [MangleUnicode 0x2026] (follow -- 'punctuationDot')
|
||||||
select-variant [MangleName 'mathCDots'] [MangleUnicode 0x22EF] (follow -- 'smallPunctuation')
|
select-variant [MangleName 'mathCDots'] [MangleUnicode 0x22EF] (follow -- 'punctuationDot')
|
||||||
select-variant [MangleName 'mathCVDots'] [MangleUnicode 0x22EE] (follow -- 'smallPunctuation')
|
select-variant [MangleName 'mathCVDots'] [MangleUnicode 0x22EE] (follow -- 'punctuationDot')
|
||||||
select-variant [MangleName 'mathCD1Dots'] [MangleUnicode 0x22F1] (follow -- 'smallPunctuation')
|
select-variant [MangleName 'mathCD1Dots'] [MangleUnicode 0x22F1] (follow -- 'punctuationDot')
|
||||||
select-variant [MangleName 'mathCD2Dots'] [MangleUnicode 0x22F0] (follow -- 'smallPunctuation')
|
select-variant [MangleName 'mathCD2Dots'] [MangleUnicode 0x22F0] (follow -- 'punctuationDot')
|
||||||
|
|
||||||
|
|
||||||
foreach { suffix { DrawAt kDotRadius overshoot } } [Object.entries DotVariants] : do
|
foreach { suffix { DrawAt kDotRadius overshoot } } [Object.entries DotVariants] : do
|
||||||
|
@ -80,4 +80,4 @@ glyph-block Symbol-Punctuation-Ellipsis : begin
|
||||||
set-width df.width
|
set-width df.width
|
||||||
include : VThreeDotsShape DrawAt kDotRadius overshoot 0 df.width 0 0 XH
|
include : VThreeDotsShape DrawAt kDotRadius overshoot 0 df.width 0 0 XH
|
||||||
|
|
||||||
select-variant "triColon" 0x205D (follow -- 'smallPunctuation')
|
select-variant "triColon" 0x205D (follow -- 'punctuationDot')
|
||||||
|
|
|
@ -30,8 +30,8 @@ glyph-block Symbol-Punctuation-Emotion : begin
|
||||||
include : DrawAt Middle dr (dr - overshoot)
|
include : DrawAt Middle dr (dr - overshoot)
|
||||||
set-mark-anchor 'cvDecompose' 0 0
|
set-mark-anchor 'cvDecompose' 0 0
|
||||||
|
|
||||||
select-variant 'exclam' '!' (follow -- 'smallPunctuation')
|
select-variant 'exclam' '!' (follow -- 'punctuationDot')
|
||||||
select-variant 'question/dotPart' (follow -- 'smallPunctuation')
|
select-variant 'question/dotPart' (follow -- 'punctuationDot')
|
||||||
|
|
||||||
alias 'alveolarclick' 0x1C3 'exclam'
|
alias 'alveolarclick' 0x1C3 'exclam'
|
||||||
turned 'exclamDown' 0xA1 'exclam' [DivFrame para.diversityF].middle (XH / 2)
|
turned 'exclamDown' 0xA1 'exclam' [DivFrame para.diversityF].middle (XH / 2)
|
||||||
|
|
|
@ -21,7 +21,7 @@ glyph-block Symbol-Punctuation-Interpuncts : begin
|
||||||
set-width df.width
|
set-width df.width
|
||||||
include : DrawAt df.middle SymbolMid (PeriodRadius * kDotRadius - overshoot)
|
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 'period/mid' null 'interpunct'
|
||||||
alias 'greekbullet' 0x387 'interpunct'
|
alias 'greekbullet' 0x387 'interpunct'
|
||||||
alias 'hyphenpoint' 0x2027 'interpunct'
|
alias 'hyphenpoint' 0x2027 'interpunct'
|
||||||
|
|
|
@ -38,7 +38,7 @@ glyph-block Symbol-Punctuation-Percentages : begin
|
||||||
include : DrawAt (SB + r) (CAP - r) (r - overshoot)
|
include : DrawAt (SB + r) (CAP - r) (r - overshoot)
|
||||||
include : DrawAt (RightSB - r) (0 + 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
|
create-glyph 'permille.NWID.dots' : glyph-proc
|
||||||
define df : DivFrame para.diversityM
|
define df : DivFrame para.diversityM
|
||||||
|
|
|
@ -24,7 +24,7 @@ glyph-block Symbol-Punctuation-Small : begin
|
||||||
set-width df.width
|
set-width df.width
|
||||||
include : DotAt df.middle (XH - PeriodRadius * kDotRadius) (PeriodRadius * kDotRadius - overshoot)
|
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
|
define [CommaShapeT cx cy gp] : new-glyph : glyph-proc
|
||||||
set currentGlyph.gizmo [Translate 0 0]
|
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
|
quadcontrols (0 - TanSlope / 2) (0.5 - TanSlope * r / Descender) 12
|
||||||
g4 (commaOverflow + Descender * TanSlope) Descender [widths.lhs swEnd]
|
g4 (commaOverflow + Descender * TanSlope) Descender [widths.lhs swEnd]
|
||||||
|
|
||||||
select-variant 'comma' ',' (follow -- 'smallPunctuation')
|
select-variant 'comma' ',' (follow -- 'punctuationDot')
|
||||||
select-variant 'invertComma' (follow -- 'smallPunctuation')
|
select-variant 'invertComma' (follow -- 'punctuationDot')
|
||||||
|
|
||||||
foreach { suffix { DrawAt kDotRadius overshoot } } [Object.entries DotVariants] : do
|
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 "comma.\(suffix)"] AS_BASE ALSO_METRICS
|
||||||
include [refer-glyph "xhPeriod.\(suffix)"]
|
include [refer-glyph "xhPeriod.\(suffix)"]
|
||||||
|
|
||||||
select-variant 'colon' ':' (follow -- 'smallPunctuation')
|
select-variant 'colon' ':' (follow -- 'punctuationDot')
|
||||||
select-variant 'colon/mid' (follow -- 'smallPunctuation')
|
select-variant 'colon/mid' (follow -- 'punctuationDot')
|
||||||
select-variant 'modifierLetterColon' 0xA789 (follow -- 'smallPunctuation')
|
select-variant 'modifierLetterColon' 0xA789 (follow -- 'punctuationDot')
|
||||||
select-variant 'semicolon' ';' (follow -- 'smallPunctuation')
|
select-variant 'semicolon' ';' (follow -- 'punctuationDot')
|
||||||
alias 'greekquestion' 0x37E 'semicolon'
|
alias 'greekquestion' 0x37E 'semicolon'
|
||||||
|
|
||||||
# Hollow (no CV)
|
# Hollow (no CV)
|
||||||
|
|
|
@ -79,6 +79,7 @@ class Prime {
|
||||||
this.tag = cfg.tag;
|
this.tag = cfg.tag;
|
||||||
this.slopeDependent = !!cfg.slopeDependent;
|
this.slopeDependent = !!cfg.slopeDependent;
|
||||||
this.variants = new Map();
|
this.variants = new Map();
|
||||||
|
this.hotChars = cfg.hotChars ? [...cfg.hotChars] : this.descSampleText;
|
||||||
for (const varKey in cfg.variants) {
|
for (const varKey in cfg.variants) {
|
||||||
const variant = cfg.variants[varKey];
|
const variant = cfg.variants[varKey];
|
||||||
this.variants.set(varKey, new PrimeVariant(varKey, cfg.tag, variant));
|
this.variants.set(varKey, new PrimeVariant(varKey, cfg.tag, variant));
|
||||||
|
@ -100,6 +101,7 @@ class Prime {
|
||||||
slopeDependent: this.slopeDependent,
|
slopeDependent: this.slopeDependent,
|
||||||
ligatureSampler: this.ligatureSampler,
|
ligatureSampler: this.ligatureSampler,
|
||||||
descSampleText: this.descSampleText,
|
descSampleText: this.descSampleText,
|
||||||
|
hotChars: this.hotChars,
|
||||||
variants: []
|
variants: []
|
||||||
};
|
};
|
||||||
for (const variant of this.variants.values()) {
|
for (const variant of this.variants.values()) {
|
||||||
|
|
|
@ -6085,20 +6085,21 @@ selector.question = "cornerFlatHooked"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[prime.small-punctuation]
|
[prime.punctuation-dot]
|
||||||
sampler = ".,"
|
sampler = "., :;"
|
||||||
|
hotChars = ".,:;?!"
|
||||||
samplerExplain = "Dot and Comma shape in punctuations and symbols"
|
samplerExplain = "Dot and Comma shape in punctuations and symbols"
|
||||||
tag = "cv99"
|
tag = "cv99"
|
||||||
|
|
||||||
[prime.small-punctuation.variants.round]
|
[prime.punctuation-dot.variants.round]
|
||||||
rank = 1
|
rank = 1
|
||||||
description = "Small punctuations (like `.`, `,`) use round dots"
|
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
|
rank = 2
|
||||||
description = "Small punctuations (like `.`, `,`) use square dots"
|
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-single-quote = "straight"
|
||||||
ascii-grave = "straight"
|
ascii-grave = "straight"
|
||||||
question = "smooth"
|
question = "smooth"
|
||||||
small-punctuation = "round"
|
punctuation-dot = "round"
|
||||||
|
|
||||||
# m, n, h has tailed variant, but not very ideal
|
# m, n, h has tailed variant, but not very ideal
|
||||||
# Do not make them default
|
# Do not make them default
|
||||||
|
|
|
@ -136,7 +136,9 @@ function buildupComposite(variants, para, ...composites) {
|
||||||
for (const [prime, variant] of composite.decompose(para, variants.selectorTree)) {
|
for (const [prime, variant] of composite.decompose(para, variants.selectorTree)) {
|
||||||
if (!prime.sampler) continue;
|
if (!prime.sampler) continue;
|
||||||
const key = getSelectorKey(prime, variant);
|
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);
|
for (const ch of prime.sampler.split(" ")) hotChars.set(ch, key);
|
||||||
} else {
|
} else {
|
||||||
for (const ch of prime.sampler) hotChars.set(ch, key);
|
for (const ch of prime.sampler) hotChars.set(ch, key);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue