From f7a80d60d25dacc94eb803371d0f46a081327e17 Mon Sep 17 00:00:00 2001 From: be5invis Date: Sun, 9 Jul 2023 15:10:08 -0700 Subject: [PATCH] Refine shape of U+A666 and U+A667 (#1838). --- changes/25.0.2.md | 1 + font-src/glyphs/letter/latin/upper-m.ptl | 11 ++++++-- font-src/glyphs/letter/shared.ptl | 35 ++++++++++++++++-------- 3 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 changes/25.0.2.md diff --git a/changes/25.0.2.md b/changes/25.0.2.md new file mode 100644 index 000000000..47fc4d405 --- /dev/null +++ b/changes/25.0.2.md @@ -0,0 +1 @@ +* Refine shape of U+A666 and U+A667 (#1838). diff --git a/font-src/glyphs/letter/latin/upper-m.ptl b/font-src/glyphs/letter/latin/upper-m.ptl index 5d36a378a..1f74d85b7 100644 --- a/font-src/glyphs/letter/latin/upper-m.ptl +++ b/font-src/glyphs/letter/latin/upper-m.ptl @@ -28,6 +28,11 @@ glyph-block Letter-Latin-Upper-M : begin local xLeftTop : df.leftSB + top * sidesSlope local xRightTop : df.rightSB - top * sidesSlope + local fHasBottomInnerSerif : match slabType + [Just SLAB-FULL] true + [Just SLAB-AUTO] SLAB + __ false + local swSideBot : match form [Just FORM-SAN-SMALL] : AdviceStroke 2.5 df.div [Just FORM-SAN] : AdviceStroke 2.5 df.div @@ -45,7 +50,7 @@ glyph-block Letter-Latin-Upper-M : begin [Just FORM-SAN] : top * 0.55 [Just FORM-TURN-W] : top * 0.45 [Just FORM-HANGING] : top * 0.3 / (kMidHang * kMidHang) - __ : if SLAB Stroke 0 + __ : if fHasBottomInnerSerif swSideBot 0 local kMidShift : match form [Just FORM-FLAT] 0.75 __ 0.5 @@ -69,8 +74,8 @@ glyph-block Letter-Latin-Upper-M : begin flat (xRightTop - kMidShift * swSideTop * HVContrast) top [widths.rhs.heading swMiddle Downward] curl (df.middle + 0.5 * swMiddleShrunk * HVContrast) middleY [widths.rhs.heading swMiddleShrunk Downward] - local sfT : SerifFrame top 0 xLeftTop xRightTop (swRef -- swSideBot) (hSplit -- 3) - local sfB : SerifFrame top 0 df.leftSB df.rightSB (swRef -- swSideBot) (hSplit -- 3) + local sfT : SerifFrame top 0 xLeftTop xRightTop (swRef -- swSideBot) (hSplit -- 3) (fForceSymmetric -- (form !== FORM-FLAT)) + local sfB : SerifFrame top 0 df.leftSB df.rightSB (swRef -- swSideBot) (hSplit -- 3) (fForceSymmetric -- (form !== FORM-FLAT)) include : match slabType [Just SLAB-NONE] : no-shape [Just SLAB-FULL] : composite-proc sfT.lt.outer sfT.rt.outer sfB.lb.full sfB.rb.full diff --git a/font-src/glyphs/letter/shared.ptl b/font-src/glyphs/letter/shared.ptl index 1924b615d..a0756eda0 100644 --- a/font-src/glyphs/letter/shared.ptl +++ b/font-src/glyphs/letter/shared.ptl @@ -590,15 +590,16 @@ glyph-block Letter-Shared-Shapes : begin Math.min jut (0.5 * ink + [Math.max (Stroke * TanSlope) (0.375 * gap)]) class CSerifFrame - public [new top bot left right swRef swSerif div hSplit] : begin - set this.top top - set this.bot bot - set this.left left - set this.right right - set this.swRef swRef - set this.swSerif swSerif - set this.div div - set this.hSplit hSplit + public [new top bot left right swRef swSerif div hSplit fForceSymmetric] : begin + set this.top top + set this.bot bot + set this.left left + set this.right right + set this.swRef swRef + set this.swSerif swSerif + set this.div div + set this.hSplit hSplit + set this.fForceSymmetric fForceSymmetric local ink : HVContrast * swRef local gap : (right - left - hSplit * ink) / (hSplit - 1) @@ -608,7 +609,7 @@ glyph-block Letter-Shared-Shapes : begin local jut : mix (0.5 * HVContrast * swRef) Jut [Math.min 1 : div * 2.25 / hSplit] local sideJut : jut - 0.5 * ink - local jutIn : JutIn left right jut swRef hSplit + local jutIn : if fForceSymmetric jut : JutIn left right jut swRef hSplit local sideJutIn : jutIn - 0.5 * ink local lBarCenter : left + 0.5 * ink @@ -661,8 +662,18 @@ glyph-block Letter-Shared-Shapes : begin return : new CSerifFrame this.top this.bot l1 r1 this.swRef this.swSerif this.div (r - l + 1) glyph-block-export SerifFrame - define [SerifFrame] : with-params [top bot left right [swRef Stroke] [swSerif swRef] [div 1] [hSplit 2]] : begin - return : new CSerifFrame top bot left right swRef swSerif div hSplit + define [SerifFrame] : begin + postulate + top + bot + left + right + swRef -- Stroke + swSerif -- swRef + div -- 1 + hSplit -- 2 + fForceSymmetric -- false + return : new CSerifFrame top bot left right swRef swSerif div hSplit fForceSymmetric define SerifFrame.fromDf : function [] : with-params [df top bot [swSerif df.mvs]] : begin return : SerifFrame top bot df.leftSB df.rightSB