Make the top serif of Yogh (U+021C, U+021D) to follow Cyrillic Ze's variant selector (#1908).

This commit is contained in:
be5invis 2023-08-11 14:19:13 -07:00
parent e09bf21b14
commit 3dae50b429
4 changed files with 77 additions and 33 deletions

View file

@ -119,7 +119,7 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
local stemFine : stroke * (ShoulderFine / Stroke)
return : object stroke midx midy ada adb fine stemFine
define [CyrZeUpperShapeT sink] : begin
define [UpperShapeT sink] : begin
define [object stroke midx midy ada adb fine stemFine] : Dim
local middle : (left + right) / 2
return : sink
@ -143,7 +143,7 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
flat middle (midy - (fine - stroke / 2)) [widths.heading 0 fine Leftward]
curl midx (midy - (fine - stroke / 2)) [heading Leftward]
define [CyrZeLowerShapeT sink] : begin
define [LowerShapeT sink] : begin
define [object stroke midx midy ada adb fine stemFine] : Dim
local middle : (left + right) / 2
return : sink
@ -167,11 +167,11 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
[Just CLOSED-STEM] : OBarLeft.arcEnd bot left right stroke stemFine ada2 adb2 midy
__ : list [hookend (bot + O) (sw -- stroke)] [g4 (left + xo) (bot + hook)]
export : define [UpperShape] : CyrZeUpperShapeT dispiro
export : define [UpperShape] : UpperShapeT dispiro
export : define [LowerShape] : CyrZeLowerShapeT dispiro
export : define [LowerShape] : LowerShapeT dispiro
define [CyrZeLowerShapeTailed] : begin
define [LowerShapeTailed] : begin
define [object stroke midx midy ada adb fine] : Dim
local middle : (left + right) / 2
return : dispiro
@ -188,16 +188,16 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
curl midx (midy + (fine - stroke / 2)) [heading Leftward]
export : define [Shape] : union
CyrZeUpperShapeT dispiro
CyrZeLowerShapeT dispiro
UpperShapeT dispiro
LowerShapeT dispiro
export : define [ShapeMask] : union
CyrZeUpperShapeT spiro-outline
CyrZeLowerShapeT spiro-outline
UpperShapeT spiro-outline
LowerShapeT spiro-outline
export : define [KsiBaseShape] : union
CyrZeUpperShapeT dispiro
CyrZeLowerShapeTailed
UpperShapeT dispiro
LowerShapeTailed
export : define [AutoStartSerifL] : begin
define [object stroke] : Dim

View file

@ -8,29 +8,62 @@ glyph-module
glyph-block Letter-Latin-Yogh : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared-Shapes : SerifedArcStart ArcStartSerif
glyph-block-import Letter-Shared-Shapes : SerifedArcStart InwardSlabArcStart ArcStartSerif
define [YoghShape top bot] : glyph-proc
include : dispiro
if SLAB
then : SerifedArcStart.LtrRhs SB Middle top Stroke Hook
else : list [g4 SB (top - Hook) [widths.rhs]] [hookstart (top - O)]
g4 RightSB (top - ArchDepthB)
alsoThruThem {{0.5 0.75}}
g4 ([mix SB RightSB 0.1] + Stroke * 0.25) ([mix bot top 0.425] - HalfStroke)
include : dispiro
widths.rhs
g4 [mix SB RightSB 0.75] ([mix bot (top - ArchDepthB) 0.758] + HalfStroke)
g4 RightSB ([mix bot (top - ArchDepthB) 0.475])
alsoThruThem {{0.25 0.6} {0.5 0.81}}
g4 SB (bot + O)
define SLAB-NONE 0
define SLAB-CLASSICAL 1
define SLAB-INWARD 2
if SLAB : include : ArcStartSerif.L SB top Stroke Hook
define [PhantomBotYOfUpperHalf top bot] : [mix bot top OverlayPos] - 0.25 * Stroke
define [TopYOfLowerHalf top bot] : [mix bot top OverlayPos] + 0.06 * Stroke
create-glyph 'Yogh' 0x21C : glyph-proc
include : MarkSet.capital
include : YoghShape CAP 0
define [UpperHalfT sink slab offset top bot] : begin
local py : PhantomBotYOfUpperHalf top bot
local yRightHalf : YSmoothMidR top py
local yBottomTerminal : mix top py 1.2
return : sink
match slab
[Just SLAB-CLASSICAL] : SerifedArcStart.LtrRhs SB Middle (top - offset) Stroke Hook
[Just SLAB-INWARD] : InwardSlabArcStart.LtrRhs SB Middle (top - offset) Stroke Hook
__ : list [g4 SB (top - Hook) [widths.rhs]] [hookstart (top - offset - O)]
g4 (RightSB - offset) yRightHalf
alsoThruThem {{0.5 0.8} {0.75 0.92}} important
[if (sink == dispiro) g4 corner] ([mix SB RightSB 0.1] + Stroke * 0.25) yBottomTerminal
create-glyph 'yogh' 0x21D : glyph-proc
include : MarkSet.p
include : YoghShape XH Descender
define [LowerHalfT sink top bot] : begin
local pyt : mix bot [TopYOfLowerHalf top bot] 1.2
local pyb : mix bot [TopYOfLowerHalf top bot] 0.2
return : sink
g4 (Middle - CorrectionOMidS) pyt [widths.rhs]
archv
g4 RightSB [YSmoothMidR pyt pyb]
alsoThruThem {{0.25 [StrokeWidthBlend 0.63 0.66]} {0.5 [StrokeWidthBlend 0.84 0.85]}} important
g4 (SB + 0.1 * HVContrast * Stroke) (bot + O)
define [YoghShape slab top bot] : glyph-proc
include : UpperHalfT dispiro slab 0 top bot
include : difference
LowerHalfT dispiro top bot
UpperHalfT spiro-outline slab 0.1 top bot
include : match slab
[Just SLAB-CLASSICAL] : ArcStartSerif.L SB top Stroke Hook
[Just SLAB-INWARD] : ArcStartSerif.InwardL SB top Stroke Hook
__ : no-shape
define Config : object
serifless { SLAB-NONE }
unilateralSerifed { SLAB-CLASSICAL }
unilateralInwardSerifed { SLAB-INWARD }
foreach { suffix { slabTop } } [Object.entries Config] : do
create-glyph "Yogh.\(suffix)" : glyph-proc
include : MarkSet.capital
include : YoghShape slabTop CAP 0
create-glyph "yogh.\(suffix)" : glyph-proc
include : MarkSet.capital
include : YoghShape slabTop XH Descender
select-variant 'Yogh' 0x21C
select-variant 'yogh' 0x21D