Break down large glyph source files into smaller pieces

This commit is contained in:
be5invis 2021-01-04 18:23:01 -08:00
parent c4871864de
commit 7192dd65d1
105 changed files with 10915 additions and 10159 deletions

View file

@ -0,0 +1,353 @@
$$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from '../../../support/utils'
import [DesignParameters] from '../../../meta/aesthetics'
import [Dotless CvDecompose] from "../../../support/gr"
glyph-module
glyph-block Letter-Latin-Lower-F : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared-Shapes : CurlyTail FlatHookDepth
define fovershoot : fallback para.fovershoot (O * 6)
create-glyph 'longs.straight' : glyph-proc
include : MarkSet.b
include : dispiro
widths.center
flat (Middle - FBalance) 0 [heading Upward]
curl (Middle - FBalance) (CAP - FHook)
arcvh
straight.right.end (Middle - FBalance + HookX) (CAP - HalfStroke - fovershoot)
set-base-anchor 'overlay' (Middle - FBalance + Stroke * 0.5 * HVContrast) (CAP * OverlayPos)
if SLAB : begin
include : tagged 'serifMB' : CenterBottomSerif (Middle - FBalance) 0 Jut
create-glyph 'longs.upright' : glyph-proc
include : MarkSet.b
local m : Middle - JBalance - HalfStroke * HVContrast
local r : m + (Width * 0.5) + Stroke * HVContrast - OXHook
include : dispiro
widths.lhs
g4 r (CAP - Hook)
hookstart (CAP - O)
flat m (CAP - SmoothA)
curl m 0 [heading Downward]
set-base-anchor 'overlay' (m + Stroke * 0.65 * HVContrast) (CAP * OverlayPos)
if SLAB : begin
include : tagged 'serifLB' : CenterBottomSerif (m + HalfStroke * HVContrast + RBalance * 0.35) 0 (Jut + RBalance * 0.65)
create-derived 'longsbar.upright' : glyph-proc
include : HOverlayBar
m + HalfStroke * HVContrast - LongJut * 0.75
m + HalfStroke * HVContrast + LongJut * 0.75
[mix (XH - Stroke) CAP 0.5] - HalfStroke
glyph-block-export LongSShape
define [LongSShape top bottom hookx hooky fine] : glyph-proc
local w [fallback fine Stroke]
include : dispiro
widths.center w
flat (Middle - hookx) (bottom + w / 2 + fovershoot)
curl (Middle - [Math.min hooky (hookx - 0.1)]) (bottom + w / 2 + fovershoot)
flat Middle (bottom + hooky)
curl Middle (top - hooky)
flat (Middle + [Math.min hooky (hookx - 0.1)]) (top - w / 2 - fovershoot)
curl (Middle + hookx) (top - w / 2 - fovershoot)
create-glyph 'longs.italic' : glyph-proc
include : MarkSet.if
include : LongSShape CAP (-Hook) HookX Hook
create-derived 'longsbar.italic' : glyph-proc
include : HOverlayBar
Middle - LongJut * 0.75
Middle + LongJut * 0.75
[mix (XH - Stroke) CAP 0.5] - HalfStroke
create-derived 'eshbar' 0x284 : glyph-proc
include : HOverlayBar
Middle - LongJut * 0.75
Middle + LongJut * 0.75
[mix Stroke Descender 0.5] + HalfStroke
alias 'esh' 0x283 'longs.italic'
orthographic-italic 'longs' 0x17F
orthographic-italic 'longsbar' 0x1E9D
create-glyph 'eshcurlytail' 0x286 : glyph-proc
include : MarkSet.if
local fine : AdviceStroke 3.5
local rinner : LongJut / 2 - fine / 2
local m1 : Middle - HalfStroke * HVContrast - FBalance
local x2 : mix RightSB m1 0.25
local y2 : Descender + O
include [refer-glyph 'longs.straight'] false
eject-contour 'serifMB'
include : dispiro
widths.lhs
flat m1 XH [heading Downward]
curl m1 (Descender + fine + rinner * 2)
CurlyTail
fine -- fine
rinner -- rinner
xleft -- m1
bottom -- Descender
right -- (m1 - LongJut)
x2 -- x2
y2 -- y2
create-glyph 'ifishhook' 0x27F : glyph-proc
include : MarkSet.p
include : VBar Middle Descender (XH - Hook)
include : VerticalHook Middle (XH - Hook) (-LongJut + LBalance) (-Hook + HalfStroke)
include : Translate LBalance 0
if SLAB : begin
include : CenterBottomSerif Middle Descender Jut
create-glyph 'iviby' 0x285 : glyph-proc
include : MarkSet.p
include : VBar Middle 0 (XH - Hook - HalfStroke)
include : VerticalHook Middle (XH - Hook - HalfStroke) (-LongJut) (-Hook)
include : VerticalHook Middle 0 LongJut Hook
define fbar : XH * DesignParameters.fBarPosToXH + Stroke * DesignParameters.fbarStrokeAdj
define [SmallFBottomSerif df shift] : dispiro
widths.lhs
flat ([mix df.leftSB df.rightSB 0.02] + HalfStroke * TanSlope + (df.rightSB - df.leftSB) * shift) 0
curl ([mix df.leftSB df.rightSB 0.875] + HalfStroke * TanSlope + (df.rightSB - df.leftSB) * shift) 0
define SmallFOvershoot2 (O * 2)
define [StdFShapeT sink offset barleft sw] : sink
widths.lhs sw
g4 (RightSB + RBalance2 - (OX - O) - offset) (CAP - Hook * 0.75 - SmallFOvershoot2)
hookstart (CAP - O - SmallFOvershoot2 - offset) (tight -- true)
flat (barleft + offset) (CAP - SmoothA * 0.8 - SmallFOvershoot2)
[if offset corner curl] (barleft + offset) 0 [heading Downward]
if offset {[corner (RightSB + RBalance2 - (OX - O) - offset) 0]} {}
define [SmallFDownExtension barLeft] : VBarLeft barLeft 0.1 (Descender * 0.9)
define [SmallFDownHook df barRight counterHookLeft] : begin
local hd : FlatHookDepth df
return : dispiro
widths.lhs
flat counterHookLeft Descender
curl [Math.max (barRight - hd.x) (counterHookLeft + 0.1)] Descender
archv.superness DesignParameters.tightHookSuperness
flat barRight [Math.min 0 (Descender + hd.y)]
curl barRight 0.1 [heading Upward]
define [StandardSmallFShape df m bh counterHook] : glyph-proc
local barLeft0 : [mix SB RightSB 0.35] - Stroke * 0.25 * HVContrast
local barLeft : [mix SB RightSB : if (counterHook > 1) 0.45 0.35] - Stroke * [if (counterHook > 1) 0.45 0.25] * HVContrast
include : StdFShapeT dispiro 0 barLeft0 Stroke
include : Translate (barLeft - barLeft0) 0
include : HCrossBar.top SB [mix SB RightSB m] bh
if (counterHook === 1) : include : SmallFDownExtension barLeft
if (counterHook === 2) : begin
local barRight : barLeft + Stroke * HVContrast
local crossRight : mix df.width df.rightSB m
local counterHookLeft : Math.max SB : barRight - (crossRight - barLeft)
include : SmallFDownHook df barRight counterHookLeft
if (counterHook === 3) : begin
include : VerticalHook (barLeft + HalfStroke * HVContrast) 0 (-HookX) Hook
define [NarrowFShape df m bh counterHook] : glyph-proc
local crossLeft : mix 0 SB m
local crossRight : mix df.width df.rightSB m
local barLeft : if (counterHook > 1)
df.middle - HalfStroke * HVContrast
[mix crossLeft crossRight 0.42] - Stroke * 0.375 * HVContrast + df.width / 32
local hd : FlatHookDepth df
include : dispiro
widths.lhs
flat crossRight CAP
curl [Math.min (barLeft + hd.x) (crossRight - 0.1)] CAP
archv.superness DesignParameters.tightHookSuperness
flat barLeft [Math.max XH (CAP - hd.y)]
curl barLeft 0 [heading Downward]
include : HCrossBar.top crossLeft crossRight bh
if (counterHook === 1) : include : SmallFDownExtension barLeft
if (counterHook === 2) : begin
local barRight : barLeft + Stroke * HVContrast
local crossRight : mix df.width df.rightSB m
local counterHookLeft : barRight - (crossRight - barLeft)
include : SmallFDownHook df barRight counterHookLeft
create-glyph 'f.serifless' : glyph-proc
include : MarkSet.b
include : StandardSmallFShape [DivFrame 1] 0.95 fbar
create-glyph 'f.phoneticLeft' : glyph-proc
include : MarkSet.b
include : StandardSmallFShape [DivFrame 1] 1 fbar
if SLAB : include : SmallFBottomSerif [DivFrame 1] 0
create-glyph 'f.serifed' : glyph-proc
include : MarkSet.b
include : StandardSmallFShape [DivFrame 1] 0.95 fbar
include : SmallFBottomSerif [DivFrame 1] 0
create-glyph 'fltail' 0x192 : glyph-proc
include : MarkSet.if
include : StandardSmallFShape [DivFrame 1] 1 fbar 2
create-glyph 'f.tailed' : glyph-proc
include : MarkSet.if
include : StandardSmallFShape [DivFrame 1] 1 fbar 2
create-glyph 'f.extended' : glyph-proc
include : MarkSet.if
include : StandardSmallFShape [DivFrame 1] 0.95 fbar 1
create-glyph 'f.seriflessCrossbarAtXHeight' : glyph-proc
include : MarkSet.b
include : StandardSmallFShape [DivFrame 1] 0.95 XH
create-glyph 'f.serifedCrossbarAtXHeight' : glyph-proc
include : MarkSet.b
include : StandardSmallFShape [DivFrame 1] 0.95 XH
include : SmallFBottomSerif [DivFrame 1] 0
create-glyph 'f.tailedCrossbarAtXHeight' : glyph-proc
include : MarkSet.if
include : StandardSmallFShape [DivFrame 1] 1 XH 2
create-glyph 'f.extendedCrossbarAtXHeight' : glyph-proc
include : MarkSet.if
include : StandardSmallFShape [DivFrame 1] 0.95 XH 1
create-glyph 'f.narrow' : glyph-proc
define df : DivFrame para.diversityF
set-width df.width
include : df.markSet.b
include : NarrowFShape df 0.5 fbar
define dfNarrowF : DivFrame para.diversityF
create-glyph 'f.flatHook' : glyph-proc
set-width dfNarrowF.width
include : dfNarrowF.markSet.b
include : NarrowFShape dfNarrowF [mix 1 dfNarrowF.div 2] fbar
create-glyph 'f.flatHookCrossbarAtXHeight' : glyph-proc
set-width dfNarrowF.width
include : dfNarrowF.markSet.b
include : NarrowFShape dfNarrowF [mix 1 dfNarrowF.div 2] XH
create-glyph 'f.flatHookSerifed' : glyph-proc
set-width dfNarrowF.width
include : dfNarrowF.markSet.b
include : NarrowFShape dfNarrowF [mix 1 dfNarrowF.div 2] fbar
include : SmallFBottomSerif dfNarrowF 0.035
create-glyph 'f.flatHookSerifedCrossbarAtXHeight' : glyph-proc
set-width dfNarrowF.width
include : dfNarrowF.markSet.b
include : NarrowFShape dfNarrowF [mix 1 dfNarrowF.div 2] XH
include : SmallFBottomSerif dfNarrowF 0.035
create-glyph 'f.flatHookTailed' : glyph-proc
set-width dfNarrowF.width
include : dfNarrowF.markSet.if
include : NarrowFShape dfNarrowF [mix 1 dfNarrowF.div 2] fbar 2
create-glyph 'f.flatHookTailedCrossbarAtXHeight' : glyph-proc
set-width dfNarrowF.width
include : dfNarrowF.markSet.if
include : NarrowFShape dfNarrowF [mix 1 dfNarrowF.div 2] XH 2
create-glyph 'f.flatHookExtended' : glyph-proc
set-width dfNarrowF.width
include : dfNarrowF.markSet.if
include : NarrowFShape dfNarrowF [mix 1 dfNarrowF.div 2] fbar 1
create-glyph 'f.flatHookExtendedCrossbarAtXHeight' : glyph-proc
set-width dfNarrowF.width
include : dfNarrowF.markSet.if
include : NarrowFShape dfNarrowF [mix 1 dfNarrowF.div 2] XH 1
select-variant 'f' 'f'
alias 'lenisf' 0xAB35 'f.serifless'
turned 'turnf.serifless' nothing 'f.serifless' Middle (XH / 2) [MarkSet.p]
turned 'turnf.serifed' nothing 'f.serifed' Middle (XH / 2) [MarkSet.p]
turned 'turnf.tailed' nothing 'f.tailed' Middle (XH / 2) [MarkSet.if]
turned 'turnf.extended' nothing 'f.extended' Middle (XH / 2) [MarkSet.if]
turned 'turnf.seriflessCrossbarAtXHeight' nothing 'f.seriflessCrossbarAtXHeight' Middle (XH / 2) [MarkSet.p]
turned 'turnf.serifedCrossbarAtXHeight' nothing 'f.serifedCrossbarAtXHeight' Middle (XH / 2) [MarkSet.p]
turned 'turnf.tailedCrossbarAtXHeight' nothing 'f.tailedCrossbarAtXHeight' Middle (XH / 2) [MarkSet.if]
turned 'turnf.extendedCrossbarAtXHeight' nothing 'f.extendedCrossbarAtXHeight' Middle (XH / 2) [MarkSet.if]
turned 'turnf.flatHook' nothing 'f.flatHook' dfNarrowF.middle (XH / 2) [dfNarrowF.markSet.p]
turned 'turnf.flatHookSerifed' nothing 'f.flatHookSerifed' dfNarrowF.middle (XH / 2) [dfNarrowF.markSet.p]
turned 'turnf.flatHookTailed' nothing 'f.flatHookTailed' dfNarrowF.middle [mix Descender CAP 0.5] [dfNarrowF.markSet.if]
turned 'turnf.flatHookExtended' nothing 'f.flatHookExtended' dfNarrowF.middle [mix Descender CAP 0.5] [dfNarrowF.markSet.if]
turned 'turnf.flatHookCrossbarAtXHeight' nothing 'f.flatHookCrossbarAtXHeight' dfNarrowF.middle (XH / 2) [dfNarrowF.markSet.p]
turned 'turnf.flatHookSerifedCrossbarAtXHeight' nothing 'f.flatHookSerifedCrossbarAtXHeight' dfNarrowF.middle (XH / 2) [dfNarrowF.markSet.p]
turned 'turnf.flatHookTailedCrossbarAtXHeight' nothing 'f.flatHookTailedCrossbarAtXHeight' dfNarrowF.middle [mix Descender CAP 0.5] [dfNarrowF.markSet.if]
turned 'turnf.flatHookExtendedCrossbarAtXHeight' nothing 'f.flatHookExtendedCrossbarAtXHeight' dfNarrowF.middle [mix Descender CAP 0.5] [dfNarrowF.markSet.if]
select-variant 'turnf' 0x25F (follow -- 'f')
glyph-block-import Letter-Blackboard : BBS BBD
create-glyph 'mathbb/f' 0x1D557 : glyph-proc
include : MarkSet.b
local barLeft : [mix SB RightSB 0.35] - BBD * 0.25 * HVContrast
include : StdFShapeT dispiro 0 barLeft BBS
include : intersection
VBarLeft (barLeft + BBD) 0 CAP BBS
StdFShapeT spiro-outline 1 barLeft BBS
include : difference
HCrossBar.top SB [mix SB RightSB 0.95] fbar BBS
Rect CAP 0 barLeft (barLeft + BBD)
include : HBarBottom barLeft (barLeft + BBD) 0 BBS
do "f ligatures"
local shift (-(Width * 0.055 + SB * 0.5))
local barr RightSB
local hbarleft (SB + shift + Stroke * [if para.slopeAngle 0.5 0.25])
create-glyph 'f_i' 0xFB01 : glyph-proc
include : MarkSet.b
include : new-glyph : glyph-proc
include : refer-glyph "longs"
include : Translate shift 0
include : VBarRight barr 0 fbar
include : HBarTop hbarleft barr fbar
if SLAB : begin
if para.isItalic
: then : include : tagged 'serifRB' : RightwardBottomSerif barr 0 SideJut
: else : include : tagged 'serifRB' : CenterBottomSerif (barr - HalfStroke * HVContrast) 0 Jut
create-glyph 'f_l.upright' : glyph-proc
local m : Middle - JBalance - HalfStroke * HVContrast + shift
include : dispiro
widths.rhs
flat m 0 [heading Upward]
curl m (CAP - SmoothA)
hookend (CAP - O)
g4 (barr + OXHook) (CAP - Hook)
include : VBarRight barr 0 (CAP - Hook)
include : dispiro
widths.rhs
flat ([Math.min (m - Stroke * 0.3) hbarleft] - TanSlope * HalfStroke) fbar
curl ([mix SB barr 0.6] - TanSlope * HalfStroke) fbar
if SLAB : begin
include : tagged 'serifLB' : CenterBottomSerif (m + HalfStroke * HVContrast + RBalance * 0.35) 0 (Jut + RBalance * 0.65)
include : tagged 'serifRB' : CenterBottomSerif (barr - HalfStroke * HVContrast) 0 Jut
create-glyph 'f_l.italic' : glyph-proc
include : new-glyph : glyph-proc
include [refer-glyph 'longs.italic'] AS_BASE
include : Translate shift 0
include : VBarRight barr 0 CAP
include : HBarTop hbarleft [mix SB barr 0.65] fbar
if SLAB : include : tagged 'serifRB' : RightwardBottomSerif barr 0 SideJut
orthographic-italic 'f_l' 0xFB02