Add variant selectors for Capital Eszet and Thorn. (#2385)

This commit is contained in:
John McWilliams 2024-06-20 19:26:03 -04:00 committed by GitHub
parent 3f813bb01d
commit a9c0037a2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 191 additions and 55 deletions

View file

@ -181,12 +181,44 @@ glyph-block Letter-Latin-Upper-Eszet : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
create-glyph 'Eszet' 0x1E9E : glyph-proc
define [EszetRoundedShape slab] : glyph-proc
include : MarkSet.capital
define ymiddle : [mix 0 CAP 0.5] - HalfStroke
define ymiddleCap : [mix 0 CAP 0.54] - HalfStroke
define ymiddleCap : [mix 0 CAP 0.5] + HalfStroke
define xFinal : Math.max
mix (SB + [HSwToV Stroke]) RightSB 0.1
mix SB RightSB 0.3
define xMiddle : RightSB - ymiddle / 2 - Stroke * 0.75
define xMiddleBot : RightSB - ymiddle / 2 - HalfStroke
define rightTopX : RightSB + O * 2
include : dispiro
widths.lhs
g4 rightTopX (CAP - ArchDepthB)
hookstart (CAP - O)
flat SB XH
curl SB 0 [heading Downward]
include : dispiro
widths.rhs
g4 xMiddle ymiddleCap
archv
g4 (RightSB - O) [mix 0 ymiddleCap 0.5]
arcvh
flat xMiddleBot 0
curl xFinal 0 [heading Leftward]
include : dispiro
widths.rhs
g4 rightTopX (CAP - ArchDepthB)
g4 xMiddle ymiddleCap [widths Stroke 0]
if slab : include : HSerif.lb SB 0 SideJut
define [EszetFlatTopShape slab] : glyph-proc
include : MarkSet.capital
define ymiddle : [mix 0 CAP 0.5] - HalfStroke
define ymiddleCap : [mix 0 CAP 0.54] + HalfStroke
define xFinal : Math.max
mix (SB + [HSwToV Stroke]) RightSB 0.1
mix SB RightSB 0.3
@ -203,15 +235,28 @@ glyph-block Letter-Latin-Upper-Eszet : begin
curl SB 0 [heading Downward]
include : dispiro
widths.rhs
g4 xMiddle (ymiddleCap + Stroke) [heading Rightward]
g4 xMiddle ymiddleCap [heading Rightward]
archv
g4 (RightSB - O * 2) [YSmoothMidR (ymiddleCap + Stroke) 0]
g4 (RightSB - O * 2) [YSmoothMidR ymiddleCap 0]
arcvh
flat xMiddleBot 0
curl xFinal 0 [heading Leftward]
include : dispiro
widths.rhs
g4 rightTopX (CAP - Stroke)
g4 xMiddle (ymiddleCap + Stroke) [widths.lhs Stroke]
g4 xMiddle ymiddleCap [widths.lhs Stroke]
if SLAB : include : HSerif.lb SB 0 SideJut
if slab : include : HSerif.lb SB 0 SideJut
define CapitalEszetConfig : SuffixCfg.weave
object # body
rounded EszetRoundedShape
flatTop EszetFlatTopShape
object # serifs
serifless false
serifed true
foreach { suffix { Base serif } } [pairs-of CapitalEszetConfig] : do
create-glyph "Eszet.\(suffix)" : Base serif
select-variant 'Eszet' 0x1E9E

View file

@ -13,15 +13,15 @@ glyph-block Letter-Latin-Thorn : begin
define xThornLeftStroke : SB * 1.25
define [yThornBowlBot top] : top * 0.25 + [if SLAB (Stroke * 0.125) 0]
define [yThornBowlTop top] : top - 0.7 * [yThornBowlBot top] + [if SLAB (-0.125) 0.25] * Stroke
define [yThornBowlBot top slab] : top * 0.25 + [if slab (Stroke * 0.125) 0]
define [yThornBowlTop top slab] : top - 0.7 * [yThornBowlBot top slab] + [if slab (-0.125) 0.25] * Stroke
define [yShoBowlBot top] : mix [yThornBowlBot top] (top - [yThornBowlTop top]) 0.5
define [yShoBowlTop top] : top - [yShoBowlBot top]
define [yShoBowlBot top slab] : mix [yThornBowlBot top slab] (top - [yThornBowlTop top slab]) 0.5
define [yShoBowlTop top slab] : top - [yShoBowlBot top slab]
define [ThornShape top _yBowlBot _yBowlTop] : glyph-proc
local yBowlBot : fallback _yBowlBot [yThornBowlBot top]
local yBowlTop : fallback _yBowlTop [yThornBowlTop top]
define [ThornShape top slabTop slabBot _yBowlBot _yBowlTop] : glyph-proc
local yBowlBot : fallback _yBowlBot [yThornBowlBot top slabBot]
local yBowlTop : fallback _yBowlTop [yThornBowlTop top slabBot]
local turn : mix yBowlTop yBowlBot (ArchDepthB / (ArchDepthA + ArchDepthB))
local turnRadius : (yBowlTop - yBowlBot) / 2
@ -37,44 +37,51 @@ glyph-block Letter-Latin-Thorn : begin
curl xThornLeftStroke yBowlBot [heading Leftward]
include : VBar.l xThornLeftStroke 0 top
if SLAB : begin
if slabTop : begin
local sf : SerifFrame top 0 xThornLeftStroke RightSB
include : composite-proc sf.lt.fullSide sf.lb.fullSide
if slabBot
then : include : composite-proc sf.lt.fullSide sf.lb.fullSide
else : include sf.lt.outer
define [GrekShoShapeImpl top] : ThornShape top [yShoBowlBot top] [yShoBowlTop top]
define [GrekShoShapeImpl top slabTop slabBot] : ThornShape top slabTop slabBot
yShoBowlBot top slabBot
yShoBowlTop top slabBot
create-glyph 'Thorn' 0xDE : glyph-proc
include : MarkSet.capital
include : ThornShape CAP
include : LeaningAnchor.Above.VBar.l xThornLeftStroke
include : LeaningAnchor.Below.VBar.l xThornLeftStroke
define ThornConfig : object
serifless { false false }
motionSerifed { true false }
serifed { true true }
foreach { suffix { st sb } } [Object.entries ThornConfig] : do
create-glyph "Thorn.\(suffix)" : glyph-proc
include : MarkSet.capital
include : ThornShape CAP st sb
include : LeaningAnchor.Above.VBar.l xThornLeftStroke
include : LeaningAnchor.Below.VBar.l xThornLeftStroke
create-glyph "ThornStroke.\(suffix)" : glyph-proc
include : MarkSet.capital
include : ThornShape CAP st sb (CAP - [yThornBowlTop CAP sb]) (CAP - [yThornBowlBot CAP st])
include : LeaningAnchor.Above.VBar.l xThornLeftStroke
include : LeaningAnchor.Below.VBar.l xThornLeftStroke
include : LetterBarOverlay.l.in
x -- xThornLeftStroke
top -- (CAP - [if st Stroke 0])
bot -- (CAP - [yThornBowlBot CAP st])
create-glyph "ThornStrokeBot.\(suffix)" : glyph-proc
include [refer-glyph "Thorn.\(suffix)"] AS_BASE ALSO_METRICS
include : LetterBarOverlay.l.in
x -- xThornLeftStroke
bot -- (0 + [if sb Stroke 0])
top -- (0 + [yThornBowlBot CAP sb])
select-variant 'Thorn' 0xDE
select-variant 'ThornStroke' 0xA764 (follow -- 'Thorn')
select-variant 'ThornStrokeBot' 0xA766 (follow -- 'Thorn')
create-glyph 'grek/Sho' 0x3F7 : glyph-proc
include : MarkSet.capital
include : GrekShoShapeImpl CAP
include : GrekShoShapeImpl CAP SLAB SLAB
include : LeaningAnchor.Above.VBar.l xThornLeftStroke
include : LeaningAnchor.Below.VBar.l xThornLeftStroke
# create-glyph 'smcpThorn' 0xEF15 : glyph-proc
# include : MarkSet.e
# include : GrekShoShapeImpl XH
# include : LeaningAnchor.Above.VBar.l xThornLeftStroke
# include : LeaningAnchor.Below.VBar.l xThornLeftStroke
create-glyph 'ThornStroke/base' : glyph-proc
include : MarkSet.capital
include : ThornShape CAP (CAP - [yThornBowlTop CAP]) (CAP - [yThornBowlBot CAP])
include : LeaningAnchor.Above.VBar.l xThornLeftStroke
include : LeaningAnchor.Below.VBar.l xThornLeftStroke
create-glyph 'ThornStroke/Overlay' : LetterBarOverlay.l.in
x -- xThornLeftStroke
top -- (CAP - [if SLAB Stroke 0])
bot -- (CAP - [yThornBowlBot CAP])
derive-composites 'ThornStroke' 0xA764 'ThornStroke/base' 'ThornStroke/Overlay'
create-glyph 'ThornStrokeBot/Overlay' : LetterBarOverlay.l.in
x -- xThornLeftStroke
bot -- (0 + [if SLAB Stroke 0])
top -- (0 + [yThornBowlBot CAP])
derive-composites 'ThornStrokeBot' 0xA766 'Thorn' 'ThornStrokeBot/Overlay'

View file

@ -35,16 +35,16 @@ glyph-block Letter-Latin-Wynn : begin
serifed { FullSerifs true }
foreach { suffix { Serifs doBS } } [Object.entries WynnConfig] : do
create-glyph "Wynn.\(suffix)" : glyph-proc
include : MarkSet.capital
include : LeaningAnchor.Below.VBar.l SB
include : WynnShape 0 CAP
include : Serifs CAP 0
create-glyph "wynn.\(suffix)" : glyph-proc
include : MarkSet.p
include : LeaningAnchor.Below.VBar.l SB
include : WynnShape Descender XH
include : Serifs XH Descender
select-variant 'Wynn' 0x1F7
select-variant 'wynn' 0x1BF
create-glyph 'Wynn' 0x1F7 : glyph-proc
include : MarkSet.capital
include : LeaningAnchor.Below.VBar.l SB
include : WynnShape 0 CAP
if SLAB : include : FullSerifs CAP 0