From d22e4a4df80b8c136663c791545926d75dd84ce8 Mon Sep 17 00:00:00 2001 From: be5invis Date: Sat, 29 May 2021 15:24:35 -0700 Subject: [PATCH] * Fix broken geometry of Single-arch Latin Capital Letter Turned M (`U+019C`) (#1083). * Fix broken geometry of Single-arch Mathematical Bold Small M (`U+1D426`) (#1084). --- changes/7.0.1.md | 2 ++ font-src/glyphs/auto-build/transformed.ptl | 3 ++- font-src/glyphs/letter/latin/lower-m.ptl | 14 +++++++------- font-src/index.js | 18 +++++++++++++----- params/parameters.toml | 2 ++ params/shape-weight.toml | 1 - 6 files changed, 26 insertions(+), 14 deletions(-) diff --git a/changes/7.0.1.md b/changes/7.0.1.md index 9eb9246c9..86ca78290 100644 --- a/changes/7.0.1.md +++ b/changes/7.0.1.md @@ -1,5 +1,7 @@ * Add cursive for Latin Small Letter W with Hook (`U+2C73`) (#1081). * Fix missing variants of Latin Small Letter Turned M with Long Leg (`U+0270`) (#1082). + * Fix broken geometry of Single-arch Latin Capital Letter Turned M (`U+019C`) (#1083). + * Fix broken geometry of Single-arch Mathematical Bold Small M (`U+1D426`) (#1084). * Fix missing serif and `cv39` variants of Latin Small Letter Feng Digraph (`U+02A9`) (#1085). * Fix missing variant of Latin Small Letter Ue (`U+1D6B`) (#1086). * Fix missing serif of Italic Latin Phi (#1087). diff --git a/font-src/glyphs/auto-build/transformed.ptl b/font-src/glyphs/auto-build/transformed.ptl index 644b0970a..01b1a3f77 100644 --- a/font-src/glyphs/auto-build/transformed.ptl +++ b/font-src/glyphs/auto-build/transformed.ptl @@ -481,7 +481,8 @@ glyph-block Autobuild-Transformed-Mathematical : begin define [createMathDerivedSeriesImpl groupName tfm _records] : begin local { records relSets targetNameMap } : extendRelatedGlyphs groupName _records local pendingGlyphs : records.map : [record] => record.1 - local forked : Fork pendingGlyphs [para.reinit tfm] + local forkedPara : para.reinit tfm + local forked : Fork pendingGlyphs forkedPara foreach {unicode glyphid} [items-of records] : if [not : query-glyph targetNameMap.(glyphid)] create-glyph targetNameMap.(glyphid) unicode : glyph-proc if [not : forked.queryByName glyphid] : console.log glyphid diff --git a/font-src/glyphs/letter/latin/lower-m.ptl b/font-src/glyphs/letter/latin/lower-m.ptl index 90be93d0f..f6695a587 100644 --- a/font-src/glyphs/letter/latin/lower-m.ptl +++ b/font-src/glyphs/letter/latin/lower-m.ptl @@ -172,14 +172,14 @@ glyph-block Letter-Latin-Lower-M : begin fine -- (df.mvs * CThin) define [EarlessSingleArchSmallMShape top lbot mbot rbot df] : glyph-proc - include : tagged 'barL' : VBarLeft df.leftSB lbot (XH - DToothlessRise) df.mvs - include : tagged 'barM' : VBar df.middle mbot XH df.mvs + include : tagged 'barL' : VBarLeft df.leftSB lbot (top - DToothlessRise) df.mvs + include : tagged 'barM' : VBar df.middle mbot top df.mvs include : dispiro widths.rhs df.mvs - g4 df.leftSB (XH - DToothlessRise) - g4 (df.middle - CorrectionOMidS) (XH - O) + g4 df.leftSB (top - DToothlessRise) + g4 (df.middle - CorrectionOMidS) (top - O) archv - flat df.rightSB [Math.max (XH - [SmallMSmooth df]) (rbot + 0.1)] + flat df.rightSB [Math.max (top - [SmallMSmooth df]) (rbot + 0.1)] curl df.rightSB rbot [heading Downward] define SmallMConfig : object @@ -217,7 +217,7 @@ glyph-block Letter-Latin-Lower-M : begin include : df.markSet.e include : Body XH 0 [if shortLeg [SmallMShortLegHeight df] 0] [if tailed ([SmallMSmoothHeight df] + O) 0] df if tailed : include : RightwardTailedBar df.rightSB 0 [SmallMSmoothHeight df] (sw -- df.mvs) - include : Serifs df XH 0 [SmallMSmoothHeight df] 0 tailed earless + include : Serifs df XH 0 [if shortLeg [SmallMShortLegHeight df] 0] 0 tailed earless create-glyph "capitalSmallM.\(suffix)" : glyph-proc local df : dfM @@ -225,7 +225,7 @@ glyph-block Letter-Latin-Lower-M : begin include : df.markSet.capital include : Body CAP 0 [if shortLeg [SmallMShortLegHeight df] 0] [if tailed ([SmallMSmoothHeight df] + O) 0] df if tailed : include : RightwardTailedBar df.rightSB 0 [SmallMSmoothHeight df] (sw -- df.mvs) - include : Serifs df CAP 0 [SmallMSmoothHeight df] 0 tailed earless + include : Serifs df CAP 0 [if shortLeg [SmallMShortLegHeight df] 0] 0 tailed earless create-glyph "mLTail.\(suffix)" : glyph-proc local df : dfM diff --git a/font-src/index.js b/font-src/index.js index d42f62290..628515591 100644 --- a/font-src/index.js +++ b/font-src/index.js @@ -40,10 +40,10 @@ async function getParameters() { const rawVariantsData = await tryParseToml(VARIANTS_TOML); const rawLigationData = await tryParseToml(LIGATIONS_TOML); - function reinit(argv) { - let para = Parameters.init(parametersData, argv); - VariantData.apply(rawVariantsData, para, argv); - ApplyLigationData(rawLigationData, para, argv); + function createParaImpl(argv) { + let para = Parameters.init(deepClone(parametersData), argv); + VariantData.apply(deepClone(rawVariantsData), para, argv); + ApplyLigationData(deepClone(rawLigationData), para, argv); if (argv.excludedCharRanges) para.excludedCharRanges = argv.excludedCharRanges; if (argv.compatibilityLigatures) para.compLig = argv.compatibilityLigatures; @@ -57,9 +57,13 @@ async function getParameters() { width: argv.menu.width - 0, slope: argv.menu.slope }; + return para; + } + function reinit(argv) { + const para = createParaImpl(argv); para.reinit = function (tf) { - const argv1 = JSON.parse(JSON.stringify(argv)); + const argv1 = deepClone(argv); tf(argv1, argv); return reinit(argv1); }; @@ -78,6 +82,10 @@ async function tryParseToml(str) { } } +function deepClone(pod) { + return JSON.parse(JSON.stringify(pod)); +} + // Save TTF async function saveTTF(argv, font) { const sfnt = FontIo.writeFont(font, { diff --git a/params/parameters.toml b/params/parameters.toml index 1581d7b15..477d8ffb9 100644 --- a/params/parameters.toml +++ b/params/parameters.toml @@ -37,6 +37,8 @@ overshoot = -8 # Vertical overshoot for arcs. overshootx = -8 # Horizontal overshoot for arcs. oxhook = -2 # Horizontal overshoot for hook tips. +refJut = 85 + shoulderfineMin = 0.8 isItalic = false # Use italic shapes? diff --git a/params/shape-weight.toml b/params/shape-weight.toml index 4ab5ce69d..32cd66154 100644 --- a/params/shape-weight.toml +++ b/params/shape-weight.toml @@ -11,7 +11,6 @@ dotsize = 125 # Size of dots periodsize = 140 # Size of period jut = 85 # Length of slab serif -refJut = 85 # Reference JUT, used in `m` vjut = 145 # Length of vertical slab serif longjut = 175 # Length of long serifs, like that in `i`.