Optimize bar position metrics of Yeri ligatures. (#2698)

This commit is contained in:
John McWilliams 2025-02-28 10:54:23 -05:00 committed by GitHub
parent d1db7b0a17
commit 0de86238be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 35 additions and 40 deletions

View file

@ -74,7 +74,7 @@ glyph-block Letter-Cyrillic-Che : begin
define [CyrCcheShape] : with-params [df top pyBar bodyType slabType [sw df.mvs] [yBarOffset 0]] : glyph-proc define [CyrCcheShape] : with-params [df top pyBar bodyType slabType [sw df.mvs] [yBarOffset 0]] : glyph-proc
local bar : top * [fallback pyBar 0.5] + yBarOffset local bar : top * [fallback pyBar 0.5] + yBarOffset
include : EarlessCornerDoubleArchSmallMShape df (top - bar + HalfStroke) 0 0 0 include : EarlessCornerDoubleArchSmallMShape df (top - (bar - 0.5 * sw)) 0 0 0
eject-contour 'barL' eject-contour 'barL'
include : FlipAround df.middle (top / 2) include : FlipAround df.middle (top / 2)

View file

@ -31,7 +31,7 @@ glyph-block Letter-Cyrillic-Dje : begin
ada -- ArchDepthA ada -- ArchDepthA
adb -- ArchDepthB adb -- ArchDepthB
sw -- sw sw -- sw
xDepth -- [Math.max ((left - right) / 2 + sw / 2) (-HookX * 1.2)] xDepth -- [Math.max ((left - right) / 2 + sw / 2) (HookX * (-1.2))]
if SLAB : begin if SLAB : begin
local swVJut : Math.min (0.625 * (left - xTopBarLeft)) : AdviceStroke 4.5 local swVJut : Math.min (0.625 * (left - xTopBarLeft)) : AdviceStroke 4.5

View file

@ -24,10 +24,10 @@ glyph-block Letter-Cyrillic-Lje : begin
xb -- xTopLeft xb -- xTopLeft
fine -- df.mvs fine -- df.mvs
include : Yeri top include : Yeri top
left -- (middle - [HSwToV : 0.5 * df.mvs]) left -- (middle - [HSwToV : 0.5 * df.mvs])
right -- (r - O) right -- (r - O)
stroke -- df.mvs stroke -- df.mvs
jut -- jut jut -- jut
include : HBar.t xTopLeft middle top df.mvs include : HBar.t xTopLeft middle top df.mvs
if SLAB : begin if SLAB : begin
include : HSerif.lt xTopLeft top (jut - [HSwToV : 0.5 * df.mvs]) df.mvs include : HSerif.lt xTopLeft top (jut - [HSwToV : 0.5 * df.mvs]) df.mvs

View file

@ -21,7 +21,7 @@ glyph-block Letter-Cyrillic-Nje : begin
define [LeftHalf slabType df top] : glyph-proc define [LeftHalf slabType df top] : glyph-proc
local dfSub : df.slice 3 2 local dfSub : df.slice 3 2
include : VBar.l dfSub.leftSB 0 top dfSub.mvs include : VBar.l dfSub.leftSB 0 top dfSub.mvs
include : HBar.m dfSub.leftSB dfSub.rightSB (top * HBarPos) include : HBar.m dfSub.leftSB dfSub.rightSB (top * HBarPos) dfSub.mvs
local sf : SerifFrame.fromDf dfSub top 0 local sf : SerifFrame.fromDf dfSub top 0
include : match slabType include : match slabType
@ -37,8 +37,8 @@ glyph-block Letter-Cyrillic-Nje : begin
define [RightHalf Yeri df top] : glyph-proc define [RightHalf Yeri df top] : glyph-proc
include : Yeri top include : Yeri top
left -- (df.middle - [HSwToV : 0.5 * df.mvs]) left -- (df.middle - [HSwToV : 0.5 * df.mvs])
right -- (df.rightSB - O) right -- (df.rightSB - O)
stroke -- df.mvs stroke -- df.mvs
eject-contour 'serifYeriLT' eject-contour 'serifYeriLT'
eject-contour 'serifYeriLB' eject-contour 'serifYeriLB'

View file

@ -32,12 +32,10 @@ glyph-block Letter-Cyrillic-Tje : begin
include : HSerif.lb left 0 SideJut include : HSerif.lb left 0 SideJut
define [RightHalf Yeri df top] : glyph-proc define [RightHalf Yeri df top] : glyph-proc
local { jutTop jutBot jutMid } : EFVJutLength top YeriBarPos df.mvs
include : Yeri top include : Yeri top
left -- ([mix df.leftSB df.rightSB 0.3] + OX) left -- ([mix df.leftSB df.rightSB 0.3] + OX)
right -- df.rightSB right -- df.rightSB
stroke -- df.mvs stroke -- df.mvs
bowl -- (YeriBarPos * top + [Math.min HalfStroke jutMid])
eject-contour 'serifYeriLT' eject-contour 'serifYeriLT'
eject-contour 'serifYeriLB' eject-contour 'serifYeriLB'

View file

@ -23,8 +23,8 @@ glyph-block Letter-Cyrillic-Yeri : begin
local-parameter : jut -- Jut local-parameter : jut -- Jut
local-parameter : pBar -- YeriBarPos local-parameter : pBar -- YeriBarPos
local-parameter : yStart -- top local-parameter : yStart -- top
local-parameter : bowl -- (top * pBar + HalfStroke)
local bowl : top * pBar + stroke / 2
local turnRadius : BowlXDepth bowl 0 left right stroke local turnRadius : BowlXDepth bowl 0 left right stroke
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2) local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2) local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
@ -53,7 +53,6 @@ glyph-block Letter-Cyrillic-Yeri : begin
local-parameter : jut -- Jut local-parameter : jut -- Jut
local-parameter : pBar -- YeriBarPos local-parameter : pBar -- YeriBarPos
local-parameter : yStart -- top local-parameter : yStart -- top
local-parameter : bowl -- (top * pBar + HalfStroke)
include : CornerCommon.apply null $-flex-arguments include : CornerCommon.apply null $-flex-arguments
if SLAB : begin if SLAB : begin
@ -68,7 +67,6 @@ glyph-block Letter-Cyrillic-Yeri : begin
local-parameter : jut -- Jut local-parameter : jut -- Jut
local-parameter : pBar -- YeriBarPos local-parameter : pBar -- YeriBarPos
local-parameter : yStart -- top local-parameter : yStart -- top
local-parameter : bowl -- (top * pBar + HalfStroke)
include : CornerCommon.apply null $-flex-arguments include : CornerCommon.apply null $-flex-arguments
if SLAB : begin if SLAB : begin
@ -87,8 +85,8 @@ glyph-block Letter-Cyrillic-Yeri : begin
local-parameter : jut -- Jut local-parameter : jut -- Jut
local-parameter : pBar -- YeriBarPos local-parameter : pBar -- YeriBarPos
local-parameter : yStart -- top local-parameter : yStart -- top
local-parameter : bowl -- (top * pBar + HalfStroke)
local bowl : top * pBar + stroke / 2
local turnRadius : BowlXDepth bowl 0 left right stroke local turnRadius : BowlXDepth bowl 0 left right stroke
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2) local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2) local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
@ -117,8 +115,8 @@ glyph-block Letter-Cyrillic-Yeri : begin
local-parameter : jut -- Jut local-parameter : jut -- Jut
local-parameter : pBar -- YeriBarPos local-parameter : pBar -- YeriBarPos
local-parameter : yStart -- top local-parameter : yStart -- top
local-parameter : bowl -- (top * pBar + HalfStroke)
local bowl : top * pBar + stroke / 2
local turnRadius : BowlXDepth bowl 0 left right stroke local turnRadius : BowlXDepth bowl 0 left right stroke
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2) local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2) local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
@ -140,7 +138,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
define RevYeri : namespace define RevYeri : namespace
export : define flex-params [Shape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar YeriBarPos]] : glyph-proc export : define flex-params [Shape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar YeriBarPos]] : glyph-proc
local bowl : top * pBar + HalfStroke local bowl : top * pBar + stroke / 2
local turnRadius : bowl * 0.45 local turnRadius : bowl * 0.45
local turnbottom : mix 0 bowl (ArchDepthB / (ArchDepthA + ArchDepthB)) local turnbottom : mix 0 bowl (ArchDepthB / (ArchDepthA + ArchDepthB))
local trShrink : Math.sqrt : (right - left) / (RightSB - SB) local trShrink : Math.sqrt : (right - left) / (RightSB - SB)
@ -161,7 +159,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
HSerif.mt (right - [HSwToV : 0.5 * stroke]) top jut stroke HSerif.mt (right - [HSwToV : 0.5 * stroke]) top jut stroke
export : define flex-params [RoundShape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar YeriBarPos] [yStart top]] : glyph-proc export : define flex-params [RoundShape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar YeriBarPos] [yStart top]] : glyph-proc
local bowl : top * pBar + HalfStroke local bowl : top * pBar + stroke / 2
local turnRadius : BowlXDepth bowl 0 left right stroke local turnRadius : BowlXDepth bowl 0 left right stroke
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2) local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2) local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)

View file

@ -90,7 +90,6 @@ glyph-block Letter-Latin-Lower-M : begin
define [dfM] : DivFrame para.advanceScaleMM 3 define [dfM] : DivFrame para.advanceScaleMM 3
glyph-block-export MEnoughSpaceForFullSerifs
define [MEnoughSpaceForFullSerifs _df _mid] : begin define [MEnoughSpaceForFullSerifs _df _mid] : begin
local df : fallback _df : dfM local df : fallback _df : dfM
local mid : fallback _mid df.middle local mid : fallback _mid df.middle
@ -264,16 +263,16 @@ glyph-block Letter-Latin-Lower-M : begin
local df : include : DivFrame para.advanceScaleMM 3.25 local df : include : DivFrame para.advanceScaleMM 3.25
include : df.markSet.e include : df.markSet.e
local fine : AdviceStroke 4.5 df.adws local fine : [AdviceStroke 4] * (df.mvs / Stroke)
local rinner : XH * 0.15 - fine * 0.75 local rinner : XH * 0.15 - fine * 0.75
local gap : (df.rightSB - df.leftSB - 3 * [HSwToV df.mvs] - [HSwToV fine]) / 3 local gap : (df.rightSB - df.leftSB - [HSwToV fine]) / 3
local m1 : df.rightSB - [HSwToV df.mvs] local m1 : df.rightSB - [HSwToV df.mvs]
local m2 : df.leftSB + 2 * ([HSwToV df.mvs] + gap) - [HSwToV : 0.25 * fine] local m2 : df.leftSB + gap * 2 - [HSwToV : 0.25 * fine]
local x2 : df.rightSB + SideJut local x2 : df.rightSB + SideJut
local y2 : rinner * 2 + fine - O local y2 : rinner * 2 + fine - O
include : Body df XH 0 [if shortLeg [SmallMShortLegHeight XH df] 0] (y2 + O) include : Body df XH 0 [if shortLeg [SmallMShortLegHeight XH df] 0] (y2 + O)
include : dispiro include : dispiro
straight.down.start df.rightSB (y2 + O) [widths.rhs.heading df.mvs Downward] straight.down.start df.rightSB y2 [widths.rhs.heading df.mvs Downward]
CurlyTail.f fine 0 m2 x2 (swBefore -- df.mvs) CurlyTail.f fine 0 m2 x2 (swBefore -- df.mvs)
include : Serifs df XH 0 [if shortLeg [SmallMShortLegHeight XH df] 0] 0 true earless include : Serifs df XH 0 [if shortLeg [SmallMShortLegHeight XH df] 0] 0 true earless

View file

@ -77,21 +77,21 @@ glyph-block Letter-Latin-Upper-H : begin
include : tagged 'strokeR' : VBar.r r 0 top sw include : tagged 'strokeR' : VBar.r r 0 top sw
include : HBar.m (l - O) (r + O) (top * HBarPos) sw include : HBar.m (l - O) (r + O) (top * HBarPos) sw
define [HTurned l r top _sw] : glyph-proc define [TurnedHShape l r top _sw] : glyph-proc
local sw : fallback _sw Stroke local sw : fallback _sw Stroke
include : LeaningAnchor.Below.VBar.r r include : LeaningAnchor.Below.VBar.r r
include : tagged 'strokeL' : VBar.l l (top * HBarPos - sw / 2) top sw include : tagged 'strokeL' : VBar.l l (top * HBarPos - sw / 2) top sw
include : tagged 'strokeR' : VBar.r r 0 top sw include : tagged 'strokeR' : VBar.r r 0 top sw
include : HBar.m (l - O) (r + O) (top * HBarPos) sw include : HBar.m (l - O) (r + O) (top * HBarPos) sw
define [HLeftHalf l r top _sw] : glyph-proc define [LeftHalfHShape l r top _sw] : glyph-proc
local sw : fallback _sw Stroke local sw : fallback _sw Stroke
include : LeaningAnchor.Above.VBar.l l include : LeaningAnchor.Above.VBar.l l
include : LeaningAnchor.Below.VBar.l l include : LeaningAnchor.Below.VBar.l l
include : tagged 'strokeL' : VBar.l l 0 top sw include : tagged 'strokeL' : VBar.l l 0 top sw
include : HBar.m (l - O) (r + O) (top * HBarPos) sw include : HBar.m (l - O) (r + O) (top * HBarPos) sw
define [HRightHalf l r top _sw] : glyph-proc define [RightHalfHShape l r top _sw] : glyph-proc
local sw : fallback _sw Stroke local sw : fallback _sw Stroke
include : LeaningAnchor.Above.VBar.r r include : LeaningAnchor.Above.VBar.r r
include : LeaningAnchor.Below.VBar.r r include : LeaningAnchor.Below.VBar.r r
@ -143,16 +143,16 @@ glyph-block Letter-Latin-Upper-H : begin
Math.min OverlayStroke : 0.625 * (yt - yb) Math.min OverlayStroke : 0.625 * (yt - yb)
define HConfig : object define HConfig : object
serifless { HShape HTurned HLeftHalf HRightHalf SLAB-NONE } serifless { HShape TurnedHShape LeftHalfHShape RightHalfHShape SLAB-NONE }
tailedSerifless { TailedHShape HTurned HLeftHalf HRightHalf SLAB-NONE } tailedSerifless { TailedHShape TurnedHShape LeftHalfHShape RightHalfHShape SLAB-NONE }
topLeftSerifed { HShape HTurned HLeftHalf HRightHalf SLAB-TOP-LEFT } topLeftSerifed { HShape TurnedHShape LeftHalfHShape RightHalfHShape SLAB-TOP-LEFT }
tailedTopLeftSerifed { TailedHShape HTurned HLeftHalf HRightHalf SLAB-TOP-LEFT } tailedTopLeftSerifed { TailedHShape TurnedHShape LeftHalfHShape RightHalfHShape SLAB-TOP-LEFT }
topLeftBottomRightSerifed { HShape HTurned HLeftHalf HRightHalf SLAB-TOP-LEFT-BOTTOM-RIGHT } topLeftBottomRightSerifed { HShape TurnedHShape LeftHalfHShape RightHalfHShape SLAB-TOP-LEFT-BOTTOM-RIGHT }
serifed { HShape HTurned HLeftHalf HRightHalf SLAB-ALL } serifed { HShape TurnedHShape LeftHalfHShape RightHalfHShape SLAB-ALL }
tailedSerifed { TailedHShape HTurned HLeftHalf HRightHalf SLAB-TAILED-CYRILLIC } tailedSerifed { TailedHShape TurnedHShape LeftHalfHShape RightHalfHShape SLAB-TAILED-CYRILLIC }
serifedExceptBottomRight { HShape HTurned HLeftHalf HRightHalf SLAB-TAILED-CYRILLIC } serifedExceptBottomRight { HShape TurnedHShape LeftHalfHShape RightHalfHShape SLAB-TAILED-CYRILLIC }
serifedBGR { HShape HTurned HLeftHalf HRightHalf SLAB-ALL-BGR } serifedBGR { HShape TurnedHShape LeftHalfHShape RightHalfHShape SLAB-ALL-BGR }
tailedSerifedBGR { TailedHShape HTurned HLeftHalf HRightHalf SLAB-TAILED-CYRILLIC-BGR } tailedSerifedBGR { TailedHShape TurnedHShape LeftHalfHShape RightHalfHShape SLAB-TAILED-CYRILLIC-BGR }
define EnGheGheConfig : object define EnGheGheConfig : object
serifless false serifless false

View file

@ -338,15 +338,15 @@ glyph-block Mark-Overlay : begin
set-width 0 set-width 0
set-mark-anchor 'overlay' 0 0 0 0 set-mark-anchor 'overlay' 0 0 0 0
include : VBar.m (+markExtend) (-XH / 4) (XH / 4) MarkStroke include : VBar.m (+markExtend) (XH * (-0.25)) (XH * (+0.25)) MarkStroke
include : HBar.m (-markExtend) (markExtend) 0 MarkStroke include : HBar.m (-markExtend) (+markExtend) 0 MarkStroke
create-glyph 'rightTackOver' : glyph-proc create-glyph 'rightTackOver' : glyph-proc
set-width 0 set-width 0
set-mark-anchor 'overlay' 0 0 0 0 set-mark-anchor 'overlay' 0 0 0 0
include : VBar.m (-markExtend) (-XH / 4) (XH / 4) MarkStroke include : VBar.m (-markExtend) (XH * (-0.25)) (XH * (+0.25)) MarkStroke
include : HBar.m (-markExtend) (markExtend) 0 MarkStroke include : HBar.m (-markExtend) (+markExtend) 0 MarkStroke
create-glyph 'upTackOver' : glyph-proc create-glyph 'upTackOver' : glyph-proc
set-width 0 set-width 0
@ -458,7 +458,7 @@ glyph-block Mark-Overlay : begin
local kHeight2 : adws / 4 * kHeight local kHeight2 : adws / 4 * kHeight
local offset : (0.5 * space - 2 * halfDotWidth) / 3 + halfDotWidth local offset : (0.5 * space - 2 * halfDotWidth) / 3 + halfDotWidth
include : InnerDot (-offset) 0 kHeight2 fRound kdr space adws include : InnerDot (-offset) 0 kHeight2 fRound kdr space adws
include : InnerDot offset 0 kHeight2 fRound kdr space adws include : InnerDot (+offset) 0 kHeight2 fRound kdr space adws
foreach { suffix { DrawAt kdr } } [Object.entries DotVariants] : do foreach { suffix { DrawAt kdr } } [Object.entries DotVariants] : do
create-glyph "innerDot.\(suffix)" : glyph-proc create-glyph "innerDot.\(suffix)" : glyph-proc