From 95db38ba9dd6e734218d458a00f8988800e263bc Mon Sep 17 00:00:00 2001 From: John McWilliams <37010132+jmcwilliams403@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:46:33 -0500 Subject: [PATCH] Optimize glyphs/widths for five characters under Quasi-Proportional. (#2615) * Optimize glyphs for Gha and Cyrillic Dche. * Make two characters slightly wider. * Cleanup of `upper-ae-oe.ptl`. * Fix broken glyph for `cyrl/Dje` under heavy italic slab. * Shrink diagonal tail of `cyrl/ef` under QP. --- changes/32.3.0.md | 8 +++--- .../font-glyphs/src/auto-build/composite.ptl | 2 +- .../font-glyphs/src/letter/cyrillic/dche.ptl | 10 +++++--- .../font-glyphs/src/letter/cyrillic/dje.ptl | 2 +- .../font-glyphs/src/letter/cyrillic/tshe.ptl | 2 +- packages/font-glyphs/src/letter/greek/phi.ptl | 8 +++--- .../font-glyphs/src/letter/latin-ext/gha.ptl | 25 +++++++++++-------- .../src/letter/latin-ext/upper-ae-oe.ptl | 12 ++++----- 8 files changed, 36 insertions(+), 33 deletions(-) diff --git a/changes/32.3.0.md b/changes/32.3.0.md index 0c4c8d317c..43b4c38217 100644 --- a/changes/32.3.0.md +++ b/changes/32.3.0.md @@ -8,7 +8,6 @@ - LATIN CAPITAL LETTER W WITH CIRCUMFLEX (`U+0174`) ... LATIN SMALL LETTER W WITH CIRCUMFLEX (`U+0175`). - LATIN SMALL LETTER HV (`U+0195`). - LATIN CAPITAL LETTER TURNED M (`U+019C`). - - LATIN CAPITAL LETTER GHA (`U+01A2`) ... LATIN SMALL LETTER GHA (`U+01A3`). - LATIN CAPITAL LETTER AE WITH MACRON (`U+01E2`) ... LATIN SMALL LETTER AE WITH MACRON (`U+01E3`). - LATIN CAPITAL LETTER HWAIR (`U+01F6`). - LATIN CAPITAL LETTER AE WITH ACUTE (`U+01FC`) ... LATIN SMALL LETTER AE WITH ACUTE (`U+01FD`). @@ -57,6 +56,8 @@ - LATIN CAPITAL LETTER W WITH GRAVE (`U+1E80`) ... LATIN SMALL LETTER W WITH DOT BELOW (`U+1E89`). - LATIN SMALL LETTER W WITH RING ABOVE (`U+1E98`). - LATIN SUBSCRIPT SMALL LETTER M (`U+2098`). + - TELEPHONE SIGN (`U+2121`). + - FACSIMILE SIGN (`U+213B`). - MILL SIGN (`U+20A5`). - WON SIGN (`U+20A9`). - SMALL ROMAN NUMERAL ONE THOUSAND (`U+217F`) ... ROMAN NUMERAL ONE THOUSAND C D (`U+2180`). @@ -91,8 +92,6 @@ - CYRILLIC SUBSCRIPT SMALL LETTER EF (`U+1E060`). - CYRILLIC SUBSCRIPT SMALL LETTER SHA (`U+1E064`). * Add characters: - - DOUBLE INTERSECTION (`U+22D2`). - - DOUBLE UNION (`U+22D3`). - LEFT OUTER JOIN (`U+27D5`) ... FULL OUTER JOIN (`U+27D7`). - Z NOTATION LEFT BINDING BRACKET (`U+2989`). - Z NOTATION RIGHT BINDING BRACKET (`U+298A`). @@ -111,6 +110,5 @@ - Z NOTATION RANGE ANTIRESTRICTION (`U+2A65`). - SMALLER THAN (`U+2AAA`) ... LARGER THAN OR EQUAL TO (`U+2AAD`). - CLOSED SUBSET (`U+2ACF`) ... CLOSED SUPERSET OR EQUAL TO (`U+2AD2`). - - ANTICLOCKWISE TRIANGLE-HEADED RIGHT U-SHAPED ARROW (`U+2B8C`) ... ANTICLOCKWISE TRIANGLE-HEADED TOP U-SHAPED ARROW (`U+2B8F`). - - RETURN LEFT (`U+2B90`) ... FOUR CORNER ARROWS CIRCLING ANTICLOCKWISE (`U+2B94`). + - ANTICLOCKWISE TRIANGLE-HEADED RIGHT U-SHAPED ARROW (`U+2B8C`) ... FOUR CORNER ARROWS CIRCLING ANTICLOCKWISE (`U+2B94`). - DOWNWARDS TRIANGLE-HEADED ARROW WITH LONG TIP LEFTWARDS (`U+2BA0`) ... RIGHTWARDS TRIANGLE-HEADED ARROW WITH LONG TIP DOWNWARDS (`U+2BA7`). diff --git a/packages/font-glyphs/src/auto-build/composite.ptl b/packages/font-glyphs/src/auto-build/composite.ptl index f6168d383b..a9e555bd44 100644 --- a/packages/font-glyphs/src/auto-build/composite.ptl +++ b/packages/font-glyphs/src/auto-build/composite.ptl @@ -1644,7 +1644,7 @@ glyph-block Autobuild-Pnonetic-Ligatures : begin list 0xFB03 { 'f/compLigLeft1' 'f/compLigLeft1' 'dotlessi/compLigRight' } null list 0xFB04 { 'f/compLigLeft3' 'f/compLigLeft2' 'l/compLigRight' } null - createPhoneticLigatures ToLetter 'phoneticSmcp' para.diversityMM 3 1 0.5 : list + createPhoneticLigatures ToLetter 'phoneticSmcp' (para.diversityT * para.diversityMM) 3 1 0.5 : list list 0x2121 { 'smcpT' 'smcpE' 'smcpL' } 'e' list 0x213B { 'smcpF' 'smcpA' 'smcpX' } 'e' diff --git a/packages/font-glyphs/src/letter/cyrillic/dche.ptl b/packages/font-glyphs/src/letter/cyrillic/dche.ptl index 5291088623..fefc1b2805 100644 --- a/packages/font-glyphs/src/letter/cyrillic/dche.ptl +++ b/packages/font-glyphs/src/letter/cyrillic/dche.ptl @@ -14,7 +14,7 @@ glyph-block Letter-Cyrillic-Dche : begin create-glyph 'cyrl/Dche' 0x52C : glyph-proc include : MarkSet.capital include : ExtendBelowBaseAnchors BottomExtension - include : CyrCheShape [DivFrame 1] CAP [if SLAB 0.5 0.4] BODY.STRAIGHT + include : CyrCheShape [DivFrame 1] CAP [if SLAB 0.45 0.4] BODY.STRAIGHT if SLAB SERIFS.TOP SERIFS.NONE include : CyrDeBottom SB RightSB @@ -26,7 +26,7 @@ glyph-block Letter-Cyrillic-Dche : begin create-glyph 'cyrl/dche.upright' : glyph-proc include : MarkSet.e include : ExtendBelowBaseAnchors BottomExtension - include : CyrCheShape [DivFrame 1] XH [if SLAB 0.5 0.4] BODY.STRAIGHT + include : CyrCheShape [DivFrame 1] XH [if SLAB 0.45 0.4] BODY.STRAIGHT if SLAB SERIFS.TOP SERIFS.NONE include : CyrDeBottom SB RightSB @@ -40,10 +40,12 @@ glyph-block Letter-Cyrillic-Dche : begin define df : include : DivFrame para.diversityM 3 include : df.markSet.e - local subDf : df.slice 3 2 OX + local gap : 0.375 * (df.width - 2 * df.leftSB - 2.5 * df.mvs) - [HSwToV : 0.25 * df.mvs] + local divSub : (df.width - gap - df.mvs) / Width + local subDf : DivFrame divSub 2 include : CyrDeItalicShapeT dispiro subDf df.mvs include : difference CyrCheShape df XH 0.5 body [if SLAB slabItalic SERIFS.NONE] (sw -- df.mvs) - MaskLeft df.middle + MaskLeft : subDf.rightSB - [HSwToV : 0.5 * df.mvs] select-variant 'cyrl/dche.italic' (follow -- 'cyrl/che') diff --git a/packages/font-glyphs/src/letter/cyrillic/dje.ptl b/packages/font-glyphs/src/letter/cyrillic/dje.ptl index e6b19775ef..b14479dae5 100644 --- a/packages/font-glyphs/src/letter/cyrillic/dje.ptl +++ b/packages/font-glyphs/src/letter/cyrillic/dje.ptl @@ -26,7 +26,7 @@ glyph-block Letter-Cyrillic-Dje : begin include : MidHook.general left -- (left + [HSwToV sw]) right -- right - top -- [Math.min XH : if SLAB (CAP - 1.25 * VJut) XH] + top -- [Math.min XH : if SLAB (CAP - VJut - sw / 4) XH] bottom -- (Hook + sw / 2 + O) ada -- ArchDepthA adb -- ArchDepthB diff --git a/packages/font-glyphs/src/letter/cyrillic/tshe.ptl b/packages/font-glyphs/src/letter/cyrillic/tshe.ptl index 88bcce9b07..2048ba899e 100644 --- a/packages/font-glyphs/src/letter/cyrillic/tshe.ptl +++ b/packages/font-glyphs/src/letter/cyrillic/tshe.ptl @@ -24,7 +24,7 @@ glyph-block Letter-Cyrillic-Tshe : begin include : nShoulder.shape left -- (left + [HSwToV sw]) right -- right - top -- [Math.min XH : if SLAB (CAP - 1.25 * VJut) XH] + top -- [Math.min XH : if SLAB (CAP - VJut - sw / 4) XH] stroke -- sw include : VBar.l left 0 CAP sw include : HBar.t xTopBarLeft xTopBarRight CAP sw diff --git a/packages/font-glyphs/src/letter/greek/phi.ptl b/packages/font-glyphs/src/letter/greek/phi.ptl index 3678f2da76..3cac3517b9 100644 --- a/packages/font-glyphs/src/letter/greek/phi.ptl +++ b/packages/font-glyphs/src/letter/greek/phi.ptl @@ -65,8 +65,8 @@ glyph-block Letter-Greek-Phi : begin define [CursiveBar df y1 y2 y3 y4 sw] : glyph-proc local hd : FlatHookDepth df - local xCrossLeft : mix 0 df.leftSB [mix 1 df.div 2] - local xCrossRight : mix df.width df.rightSB [mix 1 df.div 2] + local xCrossLeft : mix 0 df.leftSB : mix 1 df.div 2 + local xCrossRight : mix df.width df.rightSB : mix 1 df.div 2 local xBarLeft : df.middle - [HSwToV : 0.5 * sw] local xBarRight : df.middle + [HSwToV : 0.5 * sw] @@ -88,7 +88,7 @@ glyph-block Letter-Greek-Phi : begin define [DiagonalTailCursiveBar df y1 y2 y3 y4 sw] : glyph-proc local hd : FlatHookDepth df - local xCrossRight : mix df.width df.rightSB [mix 1 df.div 2] + local xCrossRight : mix df.width df.rightSB : mix 1 df.div 2 local xBarLeft : df.middle - [HSwToV : 0.5 * sw] include : dispiro @@ -100,7 +100,7 @@ glyph-block Letter-Greek-Phi : begin include : dispiro flat df.middle (y2 - O) [widths.center.heading sw Downward] - DiagTail.L df.middle y1 [DiagTail.StdDepth df sw] sw + DiagTail.L df.middle y1 [DiagTail.StdDepth [DivFrame para.diversityF] sw] sw define [MtSerif df y sw] : tagged 'serifMT' : HSerif.lt df.middle y Jut sw define [MbSerif df y sw] : tagged 'serifMB' : HSerif.mb df.middle y Jut sw diff --git a/packages/font-glyphs/src/letter/latin-ext/gha.ptl b/packages/font-glyphs/src/letter/latin-ext/gha.ptl index 45141f9547..f90f0c469f 100644 --- a/packages/font-glyphs/src/letter/latin-ext/gha.ptl +++ b/packages/font-glyphs/src/letter/latin-ext/gha.ptl @@ -16,19 +16,22 @@ glyph-block Letter-Latin-Gha : begin define TERMINAL-TAILED 1 define TERMINAL-DIAG 2 - define [GhaShape df terminal top bot slab] : glyph-proc - local abarRight : df.middle + [HSwToV : 0.5 * df.mvs] - local ada : ArchDepthAOf [Math.max (df.mvs * 1.125) (SmallArchDepth * 0.6 * df.div)] (Width * df.div) - local adb : ArchDepthBOf [Math.max (df.mvs * 1.125) (SmallArchDepth * 0.6 * df.div)] (Width * df.div) - include : OShape top 0 df.leftSB abarRight df.mvs ada adb + define [GhaShape df terminal top bot _ada _adb slab] : glyph-proc + local gap : 0.375 * (df.width - 2 * df.leftSB - 2.5 * df.mvs) - [HSwToV : 0.25 * df.mvs] + local divSub : (df.width - gap - df.mvs) / Width + local subDf : DivFrame divSub 2 + + local ada : _ada * 0.7 * df.div + local adb : _adb * 0.7 * df.div + include : OShape top 0 subDf.leftSB subDf.rightSB df.mvs ada adb include : match terminal [Just TERMINAL-NORMAL] : VBar.r (df.rightSB - O) bot top df.mvs [Just TERMINAL-TAILED] : RightwardTailedBar (df.rightSB - O) bot top df.mvs [Just TERMINAL-DIAG] : RDiagTailedBar (df.rightSB - O) bot top df.mvs include : dispiro widths.lhs df.mvs - flat df.middle (top - adb) [heading Rightward] - curl (df.middle + 1) (top - adb) [heading Rightward] + flat (subDf.rightSB - [HSwToV : 0.5 * df.mvs]) (top - adb) [heading Rightward] + curl (subDf.rightSB - [HSwToV : 0.5 * df.mvs] + TINY) (top - adb) [heading Rightward] alsoThru 0.5 0.15 g4 (df.rightSB - O - [HSwToV df.mvs]) top [widths 0 df.mvs] @@ -44,15 +47,15 @@ glyph-block Letter-Latin-Gha : begin foreach { suffix { terminal doSerif } } [Object.entries GhaConfig] : do create-glyph "Gha.\(suffix)" : glyph-proc - local df : include : DivFrame para.diversityMM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.capDesc - include : GhaShape df terminal CAP Descender doSerif + include : GhaShape df terminal CAP Descender ArchDepthA ArchDepthB doSerif include : LeaningAnchor.Below.VBar.r (df.rightSB - O) create-glyph "gha.\(suffix)" : glyph-proc - local df : include : DivFrame para.diversityMM 3 + local df : include : DivFrame para.diversityM 3 include : df.markSet.p - include : GhaShape df terminal XH Descender doSerif + include : GhaShape df terminal XH Descender SmallArchDepthA SmallArchDepthB doSerif include : LeaningAnchor.Below.VBar.r (df.rightSB - O) select-variant 'Gha' 0x1A2 (follow -- 'gha') diff --git a/packages/font-glyphs/src/letter/latin-ext/upper-ae-oe.ptl b/packages/font-glyphs/src/letter/latin-ext/upper-ae-oe.ptl index 8e03dc2a46..c154ba34c4 100644 --- a/packages/font-glyphs/src/letter/latin-ext/upper-ae-oe.ptl +++ b/packages/font-glyphs/src/letter/latin-ext/upper-ae-oe.ptl @@ -48,7 +48,7 @@ glyph-block Letter-Latin-Upper-AE-OE : begin define [AEAHalfStraight df top eleft sw] : glyph-proc - define StraightSbShrink : mix 1 (DesignParameters.straightVShapeSbShrink * [StrokeWidthBlend 1 0.75]) [if SLAB 0.75 1] + define StraightSbShrink : mix 1 (DesignParameters.straightVShapeSbShrink * [StrokeWidthBlend 1 0.75]) : if SLAB 0.75 1 define fine : sw * CThin * 1.15 define pInktrap : 2 / 3 define clearance : 0 - OX @@ -76,13 +76,13 @@ glyph-block Letter-Latin-Upper-AE-OE : begin define ada : df.archDepthA ArchDepth sw define adb : df.archDepthB ArchDepth sw - local yMidDepth : if (top > ada + adb) ada (top * (ada / (ada + adb))) + local yMidLeft : if (top > ada + adb) (top - ada) : mix top 0 (ada / (ada + adb)) include : HBar.t df.leftSB eleft (XH * 0.75 / CAP * top) sw include : dispiro widths.rhs sw flat df.leftSB 0 [heading Upward] - curl df.leftSB (top - yMidDepth) + curl df.leftSB yMidLeft arcvh straight.right.end eleft top [heading Rightward] @@ -111,7 +111,7 @@ glyph-block Letter-Latin-Upper-AE-OE : begin define eBarPos DesignParameters.upperEBarPos define sw : AESW df top define eleft : df.middle - [HSwToV : 0.25 * sw] - define swVJut : Math.min sw ((df.rightSB - eleft - [HSwToV sw]) * (4 / 5)) + define swVJut : Math.min sw : (df.rightSB - eleft - [HSwToV sw]) * (4 / 5) local xMidRight : df.rightSB - sw / 4 local yBar : top * eBarPos @@ -132,8 +132,8 @@ glyph-block Letter-Latin-Upper-AE-OE : begin local fine : swVJut * [AdviceStroke 3.5] / Stroke include : VBar.r xMidRight (yBar - jutMid) (yBar + jutMid) fine - do "P/Ya Half" - glyph-block-import Letter-Latin-Upper-P : PShape PBarPosY + do "Ya Half" + glyph-block-import Letter-Latin-Upper-P : PShape glyph-block-import Letter-Latin-Upper-R : RevRShape RConfig RBarPos foreach { suffix { legShape fOpen fTailed {slabs revSlabs doLegSlab} } } [Object.entries RConfig] : begin