forked from be5invis/Iosevka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphi.ptl
212 lines (173 loc) · 7.34 KB
/
phi.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
$$include '../../meta/macros.ptl'
import [mix linreg clamp fallback SuffixCfg] from "@iosevka/util"
import [DesignParameters] from "../../meta/aesthetics.mjs"
glyph-module
glyph-block Letter-Greek-Phi : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors ExtendBelowBaseAnchors
glyph-block-import Letter-Shared-Shapes : FlatHookDepth DiagTail OBarLeft OBarRight
glyph-block-import Letter-Latin-Lower-AE-OE : SubDfAndShift
define [VarPhiRing fFlatTB df y2 y3] : glyph-proc
include : VBar.m df.middle y2 y3 df.mvs
include : if fFlatTB
OShapeFlatTB y3 y2 df.leftSB df.rightSB df.mvs (ArchDepthA * df.div) (ArchDepthB * df.div)
Math.max (0.25 * (df.rightSB - df.leftSB)) : HSwToV df.mvs
OShape y3 y2 df.leftSB df.rightSB df.mvs (ArchDepthA * df.div) (ArchDepthB * df.div)
define [CyrlEfSplitRing fFlatTB df y2 y3] : glyph-proc
local { subDf } : SubDfAndShift 0 df OX
local ada : subDf.archDepthA SmallArchDepth df.mvs
local adb : subDf.archDepthB SmallArchDepth df.mvs
include : VBar.m df.middle y2 y3 df.mvs
include : union
OBarRight.shape
top -- y3
bot -- y2
left -- df.leftSB
right -- (df.middle + [HSwToV : 0.5 * df.mvs])
sw -- df.mvs
ada -- ada
adb -- adb
OBarLeft.shape
top -- y3
bot -- y2
left -- (df.middle - [HSwToV : 0.5 * df.mvs])
right -- df.rightSB
sw -- df.mvs
ada -- ada
adb -- adb
define [GrekLowerPhiCursiveRing fFlatTB df y2 y3] : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.e
local l : df.leftSB + OX * 2
local r : df.width - l
include : dispiro
widths.lhs df.mvs
g4 [mix df.leftSB df.rightSB 0.1] y3
g4 l [mix y2 y3 0.55]
arch.lhs y2 (sw -- df.mvs)
g4 r [mix y2 y3 0.55]
arcvh 8
g4.left.mid [mix r (df.middle - [HSwToV : 0.5 * df.mvs]) 0.525] y3 [heading Leftward]
archv
flat (df.middle - [HSwToV : 0.5 * df.mvs]) [mix y2 y3 0.66]
curl (df.middle - [HSwToV : 0.5 * df.mvs]) (y2 + 0.2 * df.mvs) [heading Downward]
define [StraightBar df y1 y2 y3 y4 sw] : glyph-proc
include : VBar.m df.middle y1 (y2 + HalfStroke) sw
include : VBar.m df.middle (y3 - HalfStroke) y4 sw
define [CursiveBar df y1 y2 y3 y4 sw] : glyph-proc
local hd : FlatHookDepth df
local xCrossLeft : mix 0 df.leftSB [mix 1 df.div 2]
local xCrossRight : mix df.width df.rightSB [mix 1 df.div 2]
local xBarLeft : df.middle - [HSwToV : 0.5 * sw]
local xBarRight : df.middle + [HSwToV : 0.5 * sw]
include : dispiro
flat xCrossRight y4 [widths.lhs sw]
curl [Math.min (xBarLeft + hd.x) (xCrossRight - TINY)] y4
archv
flat xBarLeft [Math.max y3 (y4 - hd.y)]
curl xBarLeft (y3 + O)
include : dispiro
flat xCrossLeft y1 [widths.lhs sw]
curl [Math.max (xBarRight - hd.x) (xCrossLeft + TINY)] y1
archv
flat xBarRight [Math.min y2 (y1 + hd.y)]
curl xBarRight (y2 - O)
define [DiagonalTailCursiveBar df y1 y2 y3 y4 sw] : glyph-proc
local hd : FlatHookDepth df
local xCrossRight : mix df.width df.rightSB [mix 1 df.div 2]
local xBarLeft : df.middle - [HSwToV : 0.5 * sw]
include : dispiro
flat xCrossRight y4 [widths.lhs sw]
curl [Math.min (xBarLeft + hd.x) (xCrossRight - TINY)] y4
archv
flat xBarLeft [Math.max y3 (y4 - hd.y)]
curl xBarLeft (y3 + O)
include : dispiro
flat df.middle (y2 - O) [widths.center.heading sw Downward]
DiagTail.L df.middle y1 [DiagTail.StdDepth df sw] sw
define [MtSerif df y sw] : tagged 'serifMT' : HSerif.lt df.middle y Jut sw
define [MbSerif df y sw] : tagged 'serifMB' : HSerif.mb df.middle y Jut sw
define [GrekCapitalPhiImpl fFlatTB df] : glyph-proc
local y2 : mix [if SLAB Stroke 0] [if SLAB (CAP - Stroke) CAP] 0.125
local y3 : mix [if SLAB Stroke 0] [if SLAB (CAP - Stroke) CAP] 0.875
include : VarPhiRing fFlatTB df y2 y3
include : StraightBar df 0 y2 y3 CAP
if SLAB : begin
include : tagged 'serifMT' : HSerif.mt df.middle CAP MidJutSide
include : tagged 'serifMB' : HSerif.mb df.middle 0 MidJutSide
create-glyph 'grek/Phi' 0x3A6 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.capital
include : GrekCapitalPhiImpl 0 df
create-glyph 'cyrl/Ef' 0x424 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.capital
include : GrekCapitalPhiImpl 1 df
create-glyph 'cyrl/Ef.BGR' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.capital
local vJut : Math.max (LongJut - 0.5 * Stroke) : if SLAB (1.5 * Stroke) 0
local top : CAP + vJut
local bot : 0 - vJut
include : ExtendAboveBaseAnchors top
include : ExtendBelowBaseAnchors bot
include : VarPhiRing 0 df 0 CAP
include : StraightBar df bot 0 CAP top
if SLAB : begin
include : tagged 'serifMT' : HSerif.mt df.middle top MidJutSide
include : tagged 'serifMB' : HSerif.mb df.middle bot MidJutSide
create-glyph 'taillessphi' 0x2C77 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.e
include : GrekLowerPhiCursiveRing 0 df 0 XH
create-glyph 'grek/phi.cursive' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.p
include : GrekLowerPhiCursiveRing 0 df 0 XH
include : VBar.m df.middle Descender (0.2 * df.mvs)
create-glyph 'grek/phi.straight' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
include : VarPhiRing 0 df 0 XH
include : StraightBar df Descender 0 XH Ascender
create-glyph 'grek/phi.neohellenic' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.p
include : VarPhiRing 0 df 0 XH
include : VBar.m df.middle Descender (0.2 * df.mvs)
select-variant 'grek/phi' 0x3C6
alias 'grek/varphi' 0x3D5 'grek/phi.straight'
create-glyph 'latn/phi' 0x278 : glyph-proc
local df : include : DivFrame para.diversityM 3
include [refer-glyph 'grek/varphi'] AS_BASE ALSO_METRICS
if SLAB : begin
include : tagged 'serifMT' : HSerif.mt df.middle Ascender Jut
include : tagged 'serifMB' : HSerif.mb df.middle Descender Jut
define CyrlLowerEfConfig : SuffixCfg.weave
object # bowl
"" { VarPhiRing Stroke }
splitBowl { CyrlEfSplitRing [DivFrame para.diversityM 3].mvs }
object # bar
serifless { StraightBar nothing nothing }
topSerifed { StraightBar MtSerif nothing }
serifed { StraightBar MtSerif MbSerif }
cursive { CursiveBar nothing nothing }
diagonalTailedCursive { DiagonalTailCursiveBar nothing nothing }
foreach { suffix { { Bowl barSw } { Bar sMT sMB } } } [Object.entries CyrlLowerEfConfig] : do
create-glyph "cyrl/ef.\(suffix)" : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
include : Bowl 1 df 0 XH
include : Bar df Descender 0 XH Ascender barSw
if sMT : include : sMT df Ascender barSw
if sMB : include : sMB df Descender barSw
create-glyph "cyrl/ef.BGR.\(suffix)" : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
include : VarPhiRing 0 df 0 XH
include : Bar df Descender 0 XH Ascender barSw
if sMT : include : sMT df Ascender barSw
if sMB : include : sMB df Descender barSw
select-variant 'cyrl/ef' 0x444
select-variant 'cyrl/ef.BGR'