Skip to content

Commit

Permalink
Cleanup/optimization of a few loosely-related Cyrillic letters. (#2600)
Browse files Browse the repository at this point in the history
* Cleanup and optimization of Bulgarian Cyrillic Ef.

* Stabilize arch depth of Abkhasian Che.

* Code cleanup of `lower-epsilon.ptl`.

* Optimize archdepth of stretchedC, width of eswide.
  • Loading branch information
jmcwilliams403 authored Nov 26, 2024
1 parent 803a720 commit 632be92
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 92 deletions.
1 change: 1 addition & 0 deletions changes/32.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
- MODIFIER LETTER SMALL CAPITAL OE (`U+107A3`).
- MODIFIER LETTER CYRILLIC SMALL EM (`U+1E03B`).
* Make LATIN SMALL LIGATURE FF (`U+FB00`) ... LATIN SMALL LIGATURE FFL (`U+FB04`) slightly narrower under Quasi-Proportional.
* Optimize glyphs for Bulgarian Cyrillic Capital/Small Letter Ef (`U+0424`, `U+0444`).
60 changes: 31 additions & 29 deletions packages/font-glyphs/src/letter/greek/lower-epsilon.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,20 @@ glyph-block Letter-Greek-Lower-Epsilon : begin

create-glyph "cyrl/Dhe.\(suffix)" : glyph-proc
include [refer-glyph "cyrl/Ze.\(suffix)"] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-LongJut + 0.5 * Stroke)
local desc : (-LongJut) + HalfStroke
include : ExtendBelowBaseAnchors desc
include : let [zeNoO : CyrZe slabTop slabBot CAP 0 (hook -- Hook) (xo -- 0) (yo -- 0)]
difference
VBar.m [arch.adjust-x.bot Middle] (-LongJut + 0.5 * Stroke) (Stroke + O) [AdviceStroke 3.5]
VBar.m [arch.adjust-x.bot Middle] desc (Stroke + O) [AdviceStroke 3.5]
zeNoO.ShapeMask

create-glyph "cyrl/dhe.\(suffix)" : glyph-proc
include [refer-glyph "cyrl/ze.\(suffix)"] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-LongJut + 0.5 * Stroke)
local desc : (-LongJut) + HalfStroke
include : ExtendBelowBaseAnchors desc
include : let [zeNoO : CyrZe slabTop slabBot XH 0 (hook -- SHook) (xo -- 0) (yo -- 0)]
difference
VBar.m [arch.adjust-x.bot Middle] (-LongJut + 0.5 * Stroke) (Stroke + O) [AdviceStroke 3.5]
VBar.m [arch.adjust-x.bot Middle] desc (Stroke + O) [AdviceStroke 3.5]
zeNoO.ShapeMask

create-glyph "cyrl/DzjeKomi.\(suffix)" : glyph-proc
Expand Down Expand Up @@ -376,38 +378,38 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
do "Volapuk AE"
glyph-block-import Letter-Latin-Lower-A : SingleStorey

define [FullBarBody df height bar hook ada adb] : glyph-proc
local eps : SmallEpsilon CLOSED-STEM CLOSED-STEM height 0
define [FullBarBody df top bar hook ada adb] : glyph-proc
local eps : SmallEpsilon CLOSED-STEM CLOSED-STEM top 0
blend -- VolBlend
hook -- hook
overflow -- 0
ada2 -- ada
adb2 -- adb
define [object stroke] : eps.Dim
include : eps.Shape
include : bar df height stroke
include : bar df top stroke

define [EarlessCornerBody df height bar hook ada adb] : glyph-proc
local eps : SmallEpsilon SLAB-INWARD CLOSED-STEM height 0
define [EarlessCornerBody df top bar hook ada adb] : glyph-proc
local eps : SmallEpsilon SLAB-INWARD CLOSED-STEM top 0
blend -- VolBlend
hook -- hook
overflow -- 0
ada2 -- ada
adb2 -- adb
define [object stroke] : eps.Dim
include : eps.Shape
include : bar df (height - DToothlessRise) stroke
include : bar df (top - DToothlessRise) stroke

define [EarlessRoundedBody df height bar hook ada adb] : glyph-proc
local eps : SmallEpsilon CLOSED-ROUND CLOSED-STEM height 0
define [EarlessRoundedBody df top bar hook ada adb] : glyph-proc
local eps : SmallEpsilon CLOSED-ROUND CLOSED-STEM top 0
blend -- VolBlend
hook -- hook
overflow -- 0
ada2 -- ada
adb2 -- adb
define [object stroke] : eps.Dim
include : eps.Shape
include : bar df (height - adb) stroke
include : bar df (top - adb) stroke

define SingleStoreyConfig : object
singleStoreySerifless { FullBarBody SingleStorey.SeriflessBar }
Expand Down Expand Up @@ -440,55 +442,55 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
glyph-block-import Letter-Latin-U : USerifs
glyph-block-import Letter-Shared-Shapes : RightwardTailedBar

define [UToothed df height slab hook ada adb] : glyph-proc
define [UToothed df top slab hook ada adb] : glyph-proc
set-base-anchor 'trailing' df.rightSB 0
local eps : SmallEpsilon OPEN-VERTICAL CLOSED-STEM height 0
local eps : SmallEpsilon OPEN-VERTICAL CLOSED-STEM top 0
blend -- VolBlend
hook -- hook
overflow -- 0
ada2 -- ada
adb2 -- adb
define [object stroke] : eps.Dim
include : eps.Shape
include : VBar.r df.rightSB 0 height stroke
include : slab df height
include : VBar.r df.rightSB 0 top stroke
include : slab df top

define [UTailed df height slab hook ada adb] : glyph-proc
define [UTailed df top slab hook ada adb] : glyph-proc
set-base-anchor 'trailing' (df.rightSB + SideJut) 0
local eps : SmallEpsilon OPEN-VERTICAL CLOSED-STEM height 0
local eps : SmallEpsilon OPEN-VERTICAL CLOSED-STEM top 0
blend -- VolBlend
hook -- hook
overflow -- 0
ada2 -- ada
adb2 -- adb
define [object stroke] : eps.Dim
include : eps.Shape
include : RightwardTailedBar df.rightSB 0 height stroke
include : slab df height
include : RightwardTailedBar df.rightSB 0 top stroke
include : slab df top

define [UToothlessRounded df height slab hook ada adb] : glyph-proc
local eps : SmallEpsilon OPEN-VERTICAL CLOSED-ROUND height 0
define [UToothlessRounded df top slab hook ada adb] : glyph-proc
local eps : SmallEpsilon OPEN-VERTICAL CLOSED-ROUND top 0
blend -- VolBlend
hook -- hook
overflow -- 0
ada2 -- ada
adb2 -- adb
define [object stroke] : eps.Dim
include : eps.Shape
include : VBar.r df.rightSB ada height stroke
include : slab df height
include : VBar.r df.rightSB ada top stroke
include : slab df top

define [UToothlessCorner df height slab hook ada adb] : glyph-proc
local eps : SmallEpsilon OPEN-VERTICAL SLAB-INWARD height 0
define [UToothlessCorner df top slab hook ada adb] : glyph-proc
local eps : SmallEpsilon OPEN-VERTICAL SLAB-INWARD top 0
blend -- VolBlend
hook -- hook
overflow -- 0
ada2 -- ada
adb2 -- adb
define [object stroke] : eps.Dim
include : eps.Shape
include : VBar.r df.rightSB DToothlessRise height stroke
include : slab df height stroke
include : VBar.r df.rightSB DToothlessRise top stroke
include : slab df top stroke

define SmallUConfig : SuffixCfg.weave
object # body
Expand Down
43 changes: 17 additions & 26 deletions packages/font-glyphs/src/letter/greek/phi.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ glyph-block Letter-Greek-Phi : begin
adb -- adb

define [GrekLowerPhiCursiveRing fFlatTB df y2 y3] : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.e

local l : df.leftSB + OX * 2
local r : df.width - l
include : dispiro
Expand Down Expand Up @@ -121,26 +118,26 @@ glyph-block Letter-Greek-Phi : begin
create-glyph 'grek/Phi' 0x3A6 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.capital
include : GrekCapitalPhiImpl 0 df
include : GrekCapitalPhiImpl false df

create-glyph 'cyrl/Ef' 0x424 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.capital
include : GrekCapitalPhiImpl 1 df
include : GrekCapitalPhiImpl true df

create-glyph 'cyrl/Ef.BGR' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.capital

local vJut : Math.max (LongJut - 0.5 * Stroke) : if SLAB (1.5 * Stroke) 0
local vJut : Math.max (LongJut - HalfStroke) : if SLAB (1.5 * Stroke) 0

local top : CAP + vJut
local bot : 0 - vJut
local bot : 0 - vJut

include : ExtendAboveBaseAnchors top
include : ExtendBelowBaseAnchors bot

include : VarPhiRing 0 df 0 CAP
include : VarPhiRing true df 0 CAP
include : StraightBar df bot 0 CAP top

if SLAB : begin
Expand All @@ -150,24 +147,24 @@ glyph-block Letter-Greek-Phi : begin
create-glyph 'taillessphi' 0x2C77 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.e
include : GrekLowerPhiCursiveRing 0 df 0 XH
include : GrekLowerPhiCursiveRing false df 0 XH

create-glyph 'grek/phi.cursive' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.p
include : GrekLowerPhiCursiveRing 0 df 0 XH
include : GrekLowerPhiCursiveRing false df 0 XH
include : VBar.m df.middle Descender (0.2 * df.mvs)

create-glyph 'grek/phi.straight' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
include : VarPhiRing 0 df 0 XH
include : VarPhiRing false df 0 XH
include : StraightBar df Descender 0 XH Ascender

create-glyph 'grek/phi.neohellenic' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.p
include : VarPhiRing 0 df 0 XH
include : VarPhiRing false df 0 XH
include : VBar.m df.middle Descender (0.2 * df.mvs)

select-variant 'grek/phi' 0x3C6
Expand All @@ -183,8 +180,8 @@ glyph-block Letter-Greek-Phi : begin

define CyrlLowerEfConfig : SuffixCfg.weave
object # bowl
"" { VarPhiRing Stroke }
splitBowl { CyrlEfSplitRing [DivFrame para.diversityM 3].mvs }
"" { VarPhiRing Stroke }
splitBowl { CyrlEfSplitRing nothing }
object # bar
serifless { StraightBar nothing nothing }
topSerifed { StraightBar MtSerif nothing }
Expand All @@ -196,17 +193,11 @@ glyph-block Letter-Greek-Phi : begin
create-glyph "cyrl/ef.\(suffix)" : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
include : Bowl 1 df 0 XH
include : Bar df Descender 0 XH Ascender barSw
if sMT : include : sMT df Ascender barSw
if sMB : include : sMB df Descender barSw
create-glyph "cyrl/ef.BGR.\(suffix)" : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
include : VarPhiRing 0 df 0 XH
include : Bar df Descender 0 XH Ascender barSw
if sMT : include : sMT df Ascender barSw
if sMB : include : sMB df Descender barSw
include : Bowl true df 0 XH
local mvs : fallback barSw df.mvs
include : Bar df Descender 0 XH Ascender mvs
if sMT : include : sMT df Ascender mvs
if sMB : include : sMB df Descender mvs

select-variant 'cyrl/ef' 0x444
select-variant 'cyrl/ef.BGR'
select-variant 'cyrl/ef.BGR' (shapeFrom -- 'cyrl/ef')
43 changes: 22 additions & 21 deletions packages/font-glyphs/src/letter/latin/c.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ glyph-block Letter-Latin-C : begin
g4 (df.rightSB - offset) (top - [fallback hook Hook])
hookstart (top - offset) (sw -- sw)

flat (df.leftSB + OX + offset) (top - ada)
curl (df.leftSB + OX + offset) (bot + adb)
flatside.ld (df.leftSB + offset) bot top ada adb

match sb
[Just SLAB-CLASSICAL] : SerifedArcEnd.LtrLhs (df.rightSB - offset) bot sw [fallback hook Hook] origBar
Expand All @@ -64,8 +63,7 @@ glyph-block Letter-Latin-C : begin
g4 (df.leftSB + offset) (top - [fallback hook Hook])
hookstart (top - offset) (sw -- sw)

flat (df.rightSB - OX + offset) (top - ada)
curl (df.rightSB - OX + offset) (bot + adb)
flatside.rd (df.rightSB + offset) bot top ada adb

match sb
[Just SLAB-CLASSICAL] : SerifedArcEnd.RtlRhs (df.leftSB + offset) bot sw [fallback hook Hook]
Expand Down Expand Up @@ -107,8 +105,7 @@ glyph-block Letter-Latin-C : begin
[Just SLAB-CLASSICAL] : SerifedArcStart.RtlLhs RightSB XH sw Hook
[Just SLAB-INWARD] : InwardSlabArcStart.RtlLhs RightSB XH sw Hook
__ : list [g4 RightSB (XH - Hook) [widths.lhs sw]] [hookstart XH (sw -- sw)]
flat (SB + OX) (XH - SmallArchDepthA)
curl (SB + OX) SmallArchDepthB
flatside.ld SB 0 XH SmallArchDepthA SmallArchDepthB
CurlyTail.n fine 0 RightSB 0 0 (yLoopTop -- XH * 0.45)

glyph-block-export CLetterForm
Expand Down Expand Up @@ -214,13 +211,13 @@ glyph-block Letter-Latin-C : begin
include : Translate 0 (SB / 2)

create-glyph "cyrl/esWide.\(suffix)" : glyph-proc
local df : include : DivFrame para.diversityM 3
local df : include : DivFrame para.diversityT 3
include : df.markSet.e
local desc : -LongJut + 0.5 * Stroke
local desc : (-LongJut) + HalfStroke
include : ExtendBelowBaseAnchors desc
local lf : CLetterForm df sty styBot XH desc
ada -- [df.archDepthA SmallArchDepth df.mvs]
adb -- [df.archDepthB SmallArchDepth df.mvs]
ada -- [df.archDepthA SmallArchDepth Stroke]
adb -- [df.archDepthB SmallArchDepth Stroke]
include : lf.full

create-glyph "cHookTop.\(suffix)" : glyph-proc
Expand All @@ -240,10 +237,12 @@ glyph-block Letter-Latin-C : begin
create-glyph "stretchedC.\(suffix)" : glyph-proc
include : MarkSet.p
local lf : CLetterForm [DivFrame 1] sty styBot XH Descender
ada -- SmallArchDepthA
adb -- SmallArchDepthB
include : lf.full

define [KoppaShapeT styTop styBot top base] : union
VBar.r (Middle + [HSwToV Stroke]) Descender (Stroke / 2)
VBar.r (Middle + [HSwToV Stroke]) Descender HalfStroke
difference base
Rect (top / 2) Descender (Middle + [HSwToV Stroke]) (Width * 4)
Rect (XH / 2) [mix Stroke Hook 0.5] Middle (Width * 4)
Expand Down Expand Up @@ -357,9 +356,10 @@ glyph-block Letter-Latin-C : begin

derive-glyphs 'cyrl/The' 0x4AA "cyrl/Es" : function [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-LongJut + 0.5 * Stroke)
local desc : (-LongJut) + HalfStroke
include : ExtendBelowBaseAnchors desc
include : difference
VBar.m [arch.adjust-x.bot Middle] (-LongJut + 0.5 * Stroke) (Stroke + O) [AdviceStroke 3.5]
VBar.m [arch.adjust-x.bot Middle] desc (Stroke + O) [AdviceStroke 3.5]
OShapeOutline.NoOvershoot CAP 0 SB RightSB Stroke ArchDepthA ArchDepthB

derive-multi-part-glyphs 'cyrl/The.BSH' null { 'cyrl/Es' 'invCommaBelow' } : lambda [srcs gr] : glyph-proc
Expand All @@ -373,9 +373,10 @@ glyph-block Letter-Latin-C : begin

derive-glyphs 'cyrl/the' 0x4AB "cyrl/es" : function [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-LongJut + 0.5 * Stroke)
local desc : (-LongJut) + HalfStroke
include : ExtendBelowBaseAnchors desc
include : difference
VBar.m [arch.adjust-x.bot Middle] (-LongJut + 0.5 * Stroke) (Stroke + O) [AdviceStroke 3.5]
VBar.m [arch.adjust-x.bot Middle] desc (Stroke + O) [AdviceStroke 3.5]
OShapeOutline.NoOvershoot XH 0 SB RightSB Stroke SmallArchDepthA SmallArchDepthB

derive-multi-part-glyphs 'cyrl/the.BSH' null { 'cyrl/es' 'invCommaBelow' } : lambda [srcs gr] : glyph-proc
Expand Down Expand Up @@ -441,12 +442,12 @@ glyph-block Letter-Latin-C : begin
curl df.middle [mix bot top 0.5] [widths.center.heading swBarFine Upward]

define [OutlineMask df] : spiro-outline
curl (df.leftSB + 0.5 * Stroke) (post@ <-> SmallArchDepthA)
arch.rhs (sw -- Stroke) (tMask - 0.5 * Stroke)
flat (df.rightSB - 0.5 * Stroke) (pre@ <-> SmallArchDepthB)
curl pre@ (post@ <+> SmallArchDepthA)
arch.rhs (sw -- Stroke) (bMask + 0.5 * Stroke)
flat post@ (pre@ <+> SmallArchDepthB)
curl (df.leftSB + HalfStroke) (post@ <-> SmallArchDepthA)
arch.rhs (sw -- Stroke) (tMask - HalfStroke)
flat (df.rightSB - HalfStroke) (pre@ <-> SmallArchDepthB)
curl pre@ (post@ <+> SmallArchDepthA)
arch.rhs (sw -- Stroke) (bMask + HalfStroke)
flat post@ (pre@ <+> SmallArchDepthB)

define [InterruptMask df] : begin
define gap : Math.max (XH / 8) [AdviceStroke2 6 6 XH]
Expand Down
Loading

0 comments on commit 632be92

Please sign in to comment.