forked from be5invis/Iosevka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlower-g.ptl
233 lines (202 loc) · 9.52 KB
/
lower-g.ptl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
$$include '../../meta/macros.ptl'
import [mix fallback SuffixCfg] from "@iosevka/util"
import [MathSansSerif] from "@iosevka/glyph/relation"
glyph-module
glyph-block Letter-Latin-Lower-G : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors LeaningAnchor
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : OBarLeft OBarRight DToothlessRise DMBlend
glyph-block-import Letter-Shared-Shapes : FlatHookDepth CurlyTail PalatalHook TopHook
define [OverlayW bw] : glyph-proc
define l : mix 0 SB 0.3
define r : mix Width RightSB 0.3
include : HBar.m l r currentGlyph.baseAnchors.overlay.y bw
# overlay bar width for double-storey g
define obwDoubleStorey : Math.min [AdviceStroke 5] (0.5 / 3 * (CAP - Stroke * 4))
create-glyph 'g.doubleStorey' : glyph-proc
include : MarkSet.p
local obot : XH * DesignParameters.gBarPos - O - Stroke * 0.4
include : OShape XH obot SB (RightSB - 0.3 * SB)
local gleftx ([mix 0 SB 0.85] + OX)
local grightx ([mix Width RightSB 0.825] - OX)
local groundy : Math.round : [mix Descender (XH * DesignParameters.gBarPos) 0.64] + HalfStroke
local gtipy : [mix groundy (obot + Stroke + O) 1.005] - Stroke * CThin
include : dispiro
g4.left.start [mix SB RightSB 0.4] gtipy [widths 0 (Stroke * CThin)]
g4 ([mix SB RightSB 0.0575] + Stroke * 0.85) [mix groundy gtipy 0.5] [widths.rhs (Stroke * [mix CThin 1 0.5])]
flat [mix SB RightSB 0.435] groundy [widths.rhs Stroke]
curl [mix RightSB SB 0.435] groundy
archv 4
g4 grightx [mix (Descender + O) groundy (1.06 * SmallArchDepthA / (SmallArchDepthA + SmallArchDepthB))]
arch.rhs Descender
g4 gleftx [mix (Descender + O) groundy (1.06 * SmallArchDepthB / (SmallArchDepthA + SmallArchDepthB))]
arcvh
g4 [mix SB RightSB 0.435] groundy [heading Rightward]
local gm : mix SB (RightSB - 0.3 * SB) 0.5
include : spiro-outline
corner (RightSB + 0.25 * SB - OX) XH
corner (RightSB + 0.25 * SB - OX) (XH - Stroke)
corner gm (XH - Stroke - O)
corner gm XH
set-base-anchor 'overlay' Middle [mix (Descender + O) groundy 0.5]
set-base-anchor 'strike' Middle (XH / 2)
derive-composites "gBar.doubleStorey" null "g.doubleStorey" [OverlayW obwDoubleStorey]
create-glyph 'g.doubleStoreyOpen' : glyph-proc
include : MarkSet.p
local obot : XH * DesignParameters.gBarPos - O - Stroke * 0.4
include : OShape XH obot SB (RightSB - 0.3 * SB)
local gleftx ([mix 0 SB 0.85] + OX)
local grightx ([mix Width RightSB 0.825] - OX)
local groundy : Math.round : [mix Descender (XH * DesignParameters.gBarPos) 0.64] + HalfStroke
local gtipy : [mix groundy (obot + Stroke + O) 1.005] - Stroke * CThin
include : dispiro
g4.left.start [mix SB RightSB 0.4] gtipy [widths 0 (Stroke * CThin)]
g4 ([mix SB RightSB 0.0575] + Stroke * 0.85) [mix groundy gtipy 0.5] [widths.rhs (Stroke * [mix CThin 1 0.5])]
flat [mix SB RightSB 0.435] groundy [widths.rhs Stroke]
curl [mix RightSB SB 0.435] groundy
archv 4
g4 grightx [mix (Descender + O) groundy (1.06 * SmallArchDepthA / (SmallArchDepthA + SmallArchDepthB))]
hookend Descender
g4 gleftx [mix (Descender + O) groundy (1.06 * SmallArchDepthB / (SmallArchDepthA + SmallArchDepthB))]
local gm : mix SB (RightSB - 0.3 * SB) 0.5
include : spiro-outline
corner (RightSB + 0.25 * SB - OX) XH
corner (RightSB + 0.25 * SB - OX) (XH - Stroke)
corner gm (XH - Stroke - O)
corner gm XH
set-base-anchor 'overlay' Middle [mix (Descender + O) groundy 0.5]
set-base-anchor 'strike' Middle (XH / 2)
derive-composites "gBar.doubleStoreyOpen" null "g.doubleStoreyOpen" [OverlayW obwDoubleStorey]
define SingleStorey : namespace
export : define [BentHookT sink df yTop offset sw] : sink
widths.rhs sw
[if (sink == spiro-outline) corner flat] (df.rightSB - offset) yTop [heading Downward]
curl (df.rightSB - offset) (Descender + SmallArchDepthA)
hookend (Descender + offset) (sw -- sw)
g4 (df.leftSB + offset) (Descender + SHook)
if (sink == spiro-outline) {[corner df.leftSB XH]} {}
export : define [BentHook df y0] : BentHookT dispiro df y0 0 df.mvs
export : define [FlatHook df y0] : begin
local hd : FlatHookDepth df (9 / 8)
local xTerminal : Math.min (df.rightSB - hd.x - TINY) : mix df.leftSB df.rightSB (1 / 5)
return : dispiro
widths.rhs df.mvs
flat df.rightSB y0 [heading Downward]
curl df.rightSB (Descender + hd.y)
arcvh.superness DesignParameters.tightHookSuperness
flat (df.rightSB - hd.x) Descender
curl xTerminal Descender
export : define [CrossedHook df y0] : begin
local fine : AdviceStroke 3.5 df.div
return : dispiro
widths.rhs df.mvs
flat df.rightSB y0 [heading Downward]
curl df.rightSB (Descender + SmallArchDepthA)
CurlyTail.n fine Descender df.leftSB df.width (Descender + 0.5 * fine)
yLoopTop -- (0.15 * Descender + 0.25 * fine)
export : define [ScriptCutBody df top] : glyph-proc
include : SeriflessBody df top
include : spiro-outline
corner df.rightSB top
corner df.rightSB (top - HalfStroke)
corner (df.rightSB - [HSwToV Stroke]) (top - HalfStroke)
export : define [SeriflessBody df top] : glyph-proc
include : OBarRight.shape (top -- top) (left -- df.leftSB) (right -- df.rightSB) (sw -- df.mvs)
export : define [SerifedBody df top] : glyph-proc
include : SeriflessBody df top
include : tagged 'serifRT' : HSerif.rt df.rightSB top SideJut
export : define [EarlessCornerBody df top] : glyph-proc
include : OBarLeft.toothless
top -- top
left -- df.leftSB
right -- df.rightSB
rise -- DToothlessRise
mBlend -- DMBlend
sw -- df.mvs
include : FlipAround df.middle (top / 2)
export : define [EarlessRoundedBody df top] : glyph-proc
include : OBarLeft.rounded
top -- top
left -- df.leftSB
right -- df.rightSB
yTerminal -- (XH - SmallArchDepthA)
sw -- df.mvs
include : FlipAround df.middle (top / 2)
define SingleStoreyConfig : SuffixCfg.weave
object # hook
singleStorey SingleStorey.BentHook
singleStoreyFlatHook SingleStorey.FlatHook
object # ear/serif
serifless { SingleStorey.SeriflessBody 0 }
serifed { SingleStorey.SerifedBody 0 }
earlessCorner { SingleStorey.EarlessCornerBody DToothlessRise }
earlessCornerHTB { SingleStorey.EarlessCornerBody 0 }
earlessRounded { SingleStorey.EarlessRoundedBody (XH - SmallArchDepthA) }
scriptCut { SingleStorey.ScriptCutBody HalfStroke }
foreach { suffix { hookShape {bodyShape hookStart} } } [Object.entries SingleStoreyConfig] : do
create-glyph "g.\(suffix)" : glyph-proc
local df : include : DivFrame 1
include : df.markSet.p
set-base-anchor 'overlay' Middle (XH / 2)
set-base-anchor 'strike' Middle (XH / 2)
include : bodyShape df XH
include : hookShape df (XH - hookStart)
create-glyph "GScript.\(suffix)" : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capDesc
set-base-anchor 'overlay' Middle (CAP / 2)
include : bodyShape df CAP
include : hookShape df (CAP - hookStart)
create-glyph "gPalatalHook.\(suffix)" : glyph-proc
local df : include : DivFrame para.diversityM 1
include : df.markSet.p
set-base-anchor 'overlay' Middle (XH / 2)
local dfSub : DivFrame (0.75 * para.diversityM) 2
include : bodyShape dfSub XH
include : hookShape dfSub (XH - hookStart)
include : PalatalHook.r
x -- df.rightSB
y -- 0
xLink -- dfSub.rightSB
refSw -- dfSub.mvs
maskOut -- [intersection [MaskBelow 0] [MaskLeft dfSub.rightSB]]
create-glyph "gBar.\(suffix)" : glyph-proc
include [refer-glyph "g.\(suffix)"] AS_BASE ALSO_METRICS
include : OverlayW [AdviceStroke2 2 4 XH]
select-variant 'g' 'g'
link-reduced-variant 'g/sansSerif' 'g' MathSansSerif
CreateTurnedLetter 'turng' 0x1D77 'g' HalfAdvance [mix Descender XH 0.5]
select-variant "gBar" 0x1E5 (follow -- 'g')
select-variant 'gScript' 0x261 (shapeFrom -- 'g') (follow -- 'gScript')
select-variant 'GScript' 0xA7AC (follow -- 'gScript')
select-variant 'gScriptPalatalHook' 0x1D83 (shapeFrom -- 'gPalatalHook') (follow -- 'gScript')
select-variant 'cyrl/de.BGR' (shapeFrom -- 'g') (follow -- [conditional-follow SLAB 'g/singleStorey/autoSerifed/slab' 'g/singleStorey/autoSerifed/sans'])
alias 'cyrl/de.SRB' null 'cyrl/de.BGR'
select-variant 'g/hookTopBase' (shapeFrom -- 'g')
derive-glyphs 'gHookTop' 0x260 "g/hookTopBase" : function [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : TopHook.toRight.rBarOuter RightSB 0 XH
include : LeaningAnchor.Above.VBar.r RightSB
create-glyph 'gScriptCrossedTail' 0xAB36 : glyph-proc
include : MarkSet.p
set-base-anchor 'overlay' Middle (XH / 2)
define df : DivFrame 1
include : SingleStorey.ScriptCutBody df XH
include : SingleStorey.CrossedHook df (XH - HalfStroke)
glyph-block-import Letter-Blackboard : BBS BBD BBBarRight
create-glyph 'mathbb/g' 0x1D558 : glyph-proc
include : MarkSet.p
include : intersection
OShapeOutline.NoOvershoot XH 0 SB (RightSB - BBD - [HSwToV BBS])
VBar.l (SB + BBD + OX) 0 XH BBS
include : OBarRight.shape
left -- SB
right -- RightSB - BBD
sw -- BBS
include : SingleStorey.BentHookT dispiro [DivFrame 1] XH 0 BBS
include : HBar.t (RightSB - BBD) RightSB XH BBS
include : intersection
VBar.r (RightSB - BBD) Descender XH BBS
SingleStorey.BentHookT spiro-outline [DivFrame 1] XH 1 BBS