From 2fffa76d54caaca5882e392d9a3645f98f3b58c1 Mon Sep 17 00:00:00 2001 From: Logo <21302803+Logo121@users.noreply.github.com> Date: Sun, 14 May 2023 06:55:49 +0800 Subject: [PATCH] Combining Es-te, Monographic Uk (#1721) * Combining Es-te, Monographic Uk * separate variant? --- changes/22.1.3.md | 2 + font-src/glyphs/auto-build/transformed.ptl | 2 + font-src/glyphs/letter/cyrillic/big-yus.ptl | 2 +- font-src/glyphs/letter/cyrillic/djerv.ptl | 2 +- font-src/glyphs/letter/cyrillic/tse.ptl | 2 +- font-src/glyphs/letter/cyrillic/yeri.ptl | 2 +- .../glyphs/letter/latin-ext/lower-ae-oe.ptl | 55 ++++++++++++++++++- font-src/glyphs/letter/latin/c.ptl | 9 +++ font-src/meta/aesthetics.ptl | 12 ++-- params/variants.toml | 5 ++ 10 files changed, 84 insertions(+), 9 deletions(-) diff --git a/changes/22.1.3.md b/changes/22.1.3.md index 2edd96a78..0bc556461 100644 --- a/changes/22.1.3.md +++ b/changes/22.1.3.md @@ -1,6 +1,8 @@ Add Characters: - CYRILLIC SMALL LETTER NARROW O (`U+1C82`) (#1517). - CYRILLIC SMALL LETTER UNBLENDED UK (`U+1C88`) (#1517). + - COMBINING CYRILLIC LETTER ES-TE (`U+2DF5`) (#1720). + - COMBINING CYRILLIC LETTER MONOGRAPH UK (`U+2DF9`) (#1720). - CYRILLIC CAPITAL LETTER MONOGRAPH UK (`U+A64A`) (#1517). - CYRILLIC SMALL LETTER MONOGRAPH UK (`U+A64B`) (#1517). - CYRILLIC CAPITAL LETTER YN (`U+A65E`) (#1142, #1517). diff --git a/font-src/glyphs/auto-build/transformed.ptl b/font-src/glyphs/auto-build/transformed.ptl index 5d930a4de..fe9992cf0 100644 --- a/font-src/glyphs/auto-build/transformed.ptl +++ b/font-src/glyphs/auto-build/transformed.ptl @@ -616,9 +616,11 @@ glyph-block Autobuild-Transformed : begin list 0x2DF2 'cyrl/sha' list 0x2DF3 'cyrl/shcha' list 0x2DF4 'cyrl/fita' + list 0x2DF5 'cyrl/este' list 0x2DF6 'cyrl/a' list 0x2DF7 'cyrl/ie' list 0x2DF8 'cyrl/djerv' + list 0x2DF9 'cyrl/uk' list 0x2DFB 'cyrl/yu' list 0x2DFC 'cyrl/aIotified' list 0x2DFD 'cyrl/smallYus' diff --git a/font-src/glyphs/letter/cyrillic/big-yus.ptl b/font-src/glyphs/letter/cyrillic/big-yus.ptl index f295e2d87..0954c0931 100644 --- a/font-src/glyphs/letter/cyrillic/big-yus.ptl +++ b/font-src/glyphs/letter/cyrillic/big-yus.ptl @@ -68,7 +68,7 @@ glyph-block Letter-Cyrillic-BigYus : begin local fine : fallback _fine : AdviceStroke 3.3 df.div include : CyrBigYusShape df top yp fine eject-contour 'barM' - + local yb2 : top * yp2 include : tagged 'barM' : VBar.m df.middle 0 yb2 fine include : intersection diff --git a/font-src/glyphs/letter/cyrillic/djerv.ptl b/font-src/glyphs/letter/cyrillic/djerv.ptl index 4e770211a..45a13b748 100644 --- a/font-src/glyphs/letter/cyrillic/djerv.ptl +++ b/font-src/glyphs/letter/cyrillic/djerv.ptl @@ -38,7 +38,7 @@ glyph-block Letter-Cyrillic-Djerv : begin include : df.markSet.capital include : DjervShape df CAP 0.6 false SLAB include : DjervBar df CAP 0.6 SLAB - + create-glyph 'cyrl/djerv' 0xA649 : glyph-proc define df : DivFrame 1 set-width df.width diff --git a/font-src/glyphs/letter/cyrillic/tse.ptl b/font-src/glyphs/letter/cyrillic/tse.ptl index a75a3395d..3cce89801 100644 --- a/font-src/glyphs/letter/cyrillic/tse.ptl +++ b/font-src/glyphs/letter/cyrillic/tse.ptl @@ -29,7 +29,7 @@ glyph-block Letter-Cyrillic-Tse : begin create-glyph 'cyrl/tse.upright' : glyph-proc include : MarkSet.e include : CyrTseShape XH false - + create-glyph 'cyrl/TseRev' 0xA660 : glyph-proc include : MarkSet.capital include : CyrTseShape CAP true diff --git a/font-src/glyphs/letter/cyrillic/yeri.ptl b/font-src/glyphs/letter/cyrillic/yeri.ptl index 571059f13..4148afdfc 100644 --- a/font-src/glyphs/letter/cyrillic/yeri.ptl +++ b/font-src/glyphs/letter/cyrillic/yeri.ptl @@ -328,7 +328,7 @@ glyph-block Letter-Cyrillic-Yeri : begin include : HBar.t [mix RightSB SB 0.9] (RightSB + O) CAP if SLAB : begin include : VSerif.dl [mix RightSB SB 0.9] CAP VJut - + create-glyph 'cyrl/DeKomi' 0x500 : glyph-proc include : MarkSet.capital include : RevCyrYeriShape CAP diff --git a/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl b/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl index 14b5825ed..14a80ea2c 100644 --- a/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl +++ b/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl @@ -153,7 +153,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin set-base-anchor 'cvDecompose' 0 0 include : ueUPart df fSlab - do "open o subglyphs" + do "c subglyphs" glyph-block-import Letter-Latin-C : CLetterForm CConfig define [openOShape df sty styBot] : new-glyph : glyph-proc @@ -168,6 +168,18 @@ glyph-block Letter-Latin-Lower-AE-OE : begin include : lf.full include : FlipAround (subDf.width / 2) (XH / 2) + define SLAB-FLAT 3 + define [EsTeLeftShape df styBot] : new-glyph : glyph-proc + local subDf : df.sliceFine 3 2 (1/3) + local ada : subDf.archDepthA SmallArchDepth df.mvs + local adb : subDf.archDepthB SmallArchDepth df.mvs + + local lf : CLetterForm subDf SLAB-FLAT styBot XH 0 + ada -- [subDf.archDepthA SmallArchDepth df.mvs] + adb -- [subDf.archDepthB SmallArchDepth df.mvs] + sw -- df.mvs + include : lf.full + foreach { suffix { sty styBot } } [Object.entries CConfig] : do create-glyph "oeOpenO/left.\(suffix)" : glyph-proc local df : DivFrame para.diversityM 3 @@ -176,6 +188,43 @@ glyph-block Letter-Latin-Lower-AE-OE : begin set-base-anchor 'cvDecompose' 0 0 include : openOShape df sty styBot + create-glyph "cyrl/este/left.\(suffix)" : glyph-proc + local df : DivFrame para.diversityM 3 + include : df.markSet.e + set-width df.width + set-base-anchor 'cvDecompose' 0 0 + include : EsTeLeftShape df styBot + + do "other subglyphs" + define [EsTeRightShape df doTopSerifs doBottomSerifs] : new-glyph : glyph-proc + local subDf : df.sliceFine 3 2 (1/3) + # local shift : df.rightSB - subDf.rightSB + local l subDf.rightSB + local m : mix df.rightSB subDf.rightSB 0.5 + local r : df.rightSB - 0.75 * OX + + include : VBar.m m 0 XH df.mvs + include : HBar.t l r XH df.mvs + + if doTopSerifs : begin + local swVJut : Math.min df.mvs (0.625 * (r - m - 0.5 * df.mvs * HVContrast)) + include : VSerif.dr r XH VJut swVJut + if doBottomSerifs : begin + local midJutCenter : [Math.max Jut : mix (0.5 * df.mvs * HVContrast) LongJut 0.6] * (subDf.width / df.width) + include : tagged 'serifMB' : HSerif.rb m 0 midJutCenter df.mvs + + define TConfig : object + serifless { false false } + motionSerifed { true false } + serifed { true true } + + foreach { suffix { doST doSB } } [Object.entries TConfig] : do + create-glyph "cyrl/este/right.\(suffix)" : glyph-proc + local df : DivFrame para.diversityM 3 + set-width 0 + set-mark-anchor 'cvDecompose' 0 0 + include : EsTeRightShape df doST doSB + do "subglyph diacritics" glyph-block-import Mark-Overlay : InnerDot @@ -244,3 +293,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin derive-composites 'cyrl/OOBinocular' 0xA66C 'cyrl/OO' 'OODots' derive-composites 'cyrl/ooBinocular' 0xA66D 'cyrl/oo' 'ooDots' + + select-variant 'cyrl/este/left' (follow -- 'cBottomSerifOnly') + select-variant 'cyrl/este/right' (follow -- 'T') + derive-composites 'cyrl/este' null 'cyrl/este/left' 'cyrl/este/right' diff --git a/font-src/glyphs/letter/latin/c.ptl b/font-src/glyphs/letter/latin/c.ptl index 15c835824..33e7d0ab0 100644 --- a/font-src/glyphs/letter/latin/c.ptl +++ b/font-src/glyphs/letter/latin/c.ptl @@ -21,6 +21,7 @@ glyph-block Letter-Latin-C : begin define SLAB-NONE 0 define SLAB-CLASSICAL 1 define SLAB-INWARD 2 + define SLAB-FLAT 3 glyph-block-export CShapeT define [CShapeT sink offset df st sb top bot ada adb hook sw origBar] : sink @@ -31,6 +32,10 @@ glyph-block Letter-Latin-C : begin g4 (df.rightSB - offset) (top - DToothlessRise) g4 (df.middle - CorrectionOMidX * sw) (top - O - offset) archv + [Just SLAB-FLAT] : list + flat (df.rightSB - offset) (top - offset) + curl (df.middle - CorrectionOMidX * sw) (top - offset) + archv _ : list g4 (df.rightSB - offset) (top - [fallback hook Hook]) hookstart (top - O - offset) @@ -56,6 +61,10 @@ glyph-block Letter-Latin-C : begin g4 (df.leftSB + offset) (top - DToothlessRise) g4 (df.middle - CorrectionOMidX * sw) (top - O - offset) archv + [Just SLAB-FLAT] : list + flat (df.leftSB + offset) (top - offset) + curl (df.middle - CorrectionOMidX * sw) (top - offset) + archv _ : list g4 (df.leftSB + offset) (top - [fallback hook Hook]) hookstart (top - O - offset) diff --git a/font-src/meta/aesthetics.ptl b/font-src/meta/aesthetics.ptl index 0fb8e92b7..003577d32 100644 --- a/font-src/meta/aesthetics.ptl +++ b/font-src/meta/aesthetics.ptl @@ -439,11 +439,15 @@ export : define [GenDivFrame metrics] : begin local divisions : fallback _divisions this.hPack local keeps : fallback _keeps 2 - local oneStroke : metrics.HVContrast * this.mvs - local totalGap : this.rightSB - this.leftSB - divisions * oneStroke - 2 * o - local oneGap : totalGap / (divisions - 1) + return : this.sliceFine divisions keeps ((keeps - 1) / (divisions - 1)) o - local subDfWidth : 2 * this.leftSB + 2 * o + oneGap * (keeps - 1) + oneStroke * keeps + public [sliceFine strokes keeps pGaps _o] : begin + local o : fallback _o 0 + + local oneStroke : metrics.HVContrast * this.mvs + local totalGap : this.rightSB - this.leftSB - strokes * oneStroke - 2 * o + + local subDfWidth : 2 * this.leftSB + 2 * o + totalGap * pGaps + oneStroke * keeps local subDfDiv : subDfWidth / metrics.Width return : new CDivFrame subDfDiv keeps (this.leftSB / metrics.SB) this.mvs o diff --git a/params/variants.toml b/params/variants.toml index 6b531b277..fd96d759d 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -2013,6 +2013,7 @@ selector."c/turnDescBase" = "unilateralSerifed" selector.cCurlyTail = "serifless" selector.cHookTop = "unilateralSerifed" selector.cTopSerifOnly = "serifless" +selector.cBottomSerifOnly = "serifless" [prime.c.variants.unilateral-serifed] rank = 2 @@ -2024,6 +2025,7 @@ selector."c/turnDescBase" = "unilateralSerifed" selector.cCurlyTail = "unilateralSerifed" selector.cHookTop = "unilateralSerifed" selector.cTopSerifOnly = "unilateralSerifed" +selector.cBottomSerifOnly = "serifless" [prime.c.variants.bilateral-serifed] rank = 3 @@ -2035,6 +2037,7 @@ selector."c/turnDescBase" = "bilateralSerifed" selector.cCurlyTail = "unilateralSerifed" selector.cHookTop = "bilateralSerifed" selector.cTopSerifOnly = "unilateralSerifed" +selector.cBottomSerifOnly = "bilateralSerifed" [prime.c.variants.unilateral-inward-serifed] rank = 4 @@ -2046,6 +2049,7 @@ selector."c/turnDescBase" = "unilateralInwardSerifed" selector.cCurlyTail = "unilateralInwardSerifed" selector.cHookTop = "unilateralInwardSerifed" selector.cTopSerifOnly = "unilateralInwardSerifed" +selector.cBottomSerifOnly = "serifless" [prime.c.variants.bilateral-inward-serifed] rank = 5 @@ -2057,6 +2061,7 @@ selector."c/turnDescBase" = "bilateralInwardSerifed" selector.cCurlyTail = "unilateralInwardSerifed" selector.cHookTop = "bilateralInwardSerifed" selector.cTopSerifOnly = "unilateralInwardSerifed" +selector.cBottomSerifOnly = "bilateralInwardSerifed"