forked from be5invis/Iosevka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlower-q.ptl
123 lines (107 loc) · 4.82 KB
/
lower-q.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
$$include '../../meta/macros.ptl'
import [mix fallback SuffixCfg] from "@iosevka/util"
import [MathSansSerif] from "@iosevka/glyph/relation"
glyph-module
glyph-block Letter-Latin-Lower-Q : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Shared-Metrics : markHalfStroke
glyph-block-import Mark-Adjustment : LeaningAnchor
glyph-block-import Letter-Shared-Shapes : OBarLeft OBarRight RightwardTailedBar DToothlessRise
glyph-block-import Letter-Shared-Shapes : DMBlend DiagTail
glyph-block-import Letter-Shared-Shapes : TopHook RetroflexHook
define TERMINAL-NORMAL 0
define TERMINAL-TAILED 1
define TERMINAL-DIAG 2
glyph-block-export RDiagTailedBar
define [RDiagTailedBar x0 yb yt _sw] : begin
local sw : fallback _sw Stroke
local xMid : x0 - [HSwToV : 0.5 * sw]
return : dispiro
flat xMid yt [widths.center.heading sw Downward]
DiagTail.R xMid yb (0.875 * Hook - sw * 0.375) sw
define [EaredBody terminal top bottom] : glyph-proc
set-base-anchor 'trailing' (RightSB - markHalfStroke) Descender
include : OBarRight.shape (top -- top)
include : match terminal
[Just TERMINAL-NORMAL] : VBar.r RightSB bottom top
[Just TERMINAL-TAILED] : RightwardTailedBar RightSB bottom top
[Just TERMINAL-DIAG] : RDiagTailedBar RightSB bottom top
define [EarlessCornerBody terminal top bottom] : glyph-proc
set-base-anchor 'trailing' (RightSB - markHalfStroke) Descender
include : OBarLeft.toothless (top -- top) (rise -- DToothlessRise) (mBlend -- DMBlend)
include : FlipAround Middle (top / 2)
include : match terminal
[Just TERMINAL-NORMAL] : VBar.r RightSB bottom (top - DToothlessRise)
[Just TERMINAL-TAILED] : RightwardTailedBar RightSB bottom (top - DToothlessRise)
[Just TERMINAL-DIAG] : RDiagTailedBar RightSB bottom (top - DToothlessRise)
define [EarlessRoundedBody terminal top bottom] : glyph-proc
set-base-anchor 'trailing' (RightSB - markHalfStroke) Descender
include : OBarLeft.rounded (top -- top) (yTerminal -- (SmallArchDepthB - O))
include : FlipAround Middle (top / 2)
include : match terminal
[Just TERMINAL-NORMAL] : VBar.r RightSB bottom (top - SmallArchDepthB)
[Just TERMINAL-TAILED] : RightwardTailedBar RightSB bottom (top - SmallArchDepthB)
[Just TERMINAL-DIAG] : RDiagTailedBar RightSB bottom (top - SmallArchDepthB)
define [RtSerif y] : tagged 'serifRT' : HSerif.rt RightSB y SideJut
define [RtSerifAuto y] : NeedSlab SLAB : RtSerif y
define [RbSerif y] : tagged 'serifRB' : union
HSerif.lb (RightSB - [HSwToV HalfStroke]) y MidJutSide
HSerif.rb (RightSB - [HSwToV HalfStroke]) y Jut
define [RbSerifAuto y] : NeedSlab SLAB : RbSerif y
define QConfig : SuffixCfg.weave
object # body
"" EaredBody
earlessCorner EarlessCornerBody
earlessRounded EarlessRoundedBody
object # tail
straight { TERMINAL-NORMAL false }
tailed { TERMINAL-TAILED true }
diagonalTailed { TERMINAL-DIAG true }
object # serifs
serifless { nothing nothing }
motionSerifed { RtSerif nothing }
bottomSerifed { nothing RbSerif }
serifed { RtSerif RbSerif }
foreach { suffix { Body {terminal fTail} {sRT sRB} } } [Object.entries QConfig] : do
create-glyph "q.\(suffix)" : glyph-proc
include : MarkSet.p
include : Body terminal XH Descender
if sRT : include : sRT XH
if sRB : include : sRB Descender
include : LeaningAnchor.Below.VBar.r RightSB
if (!fTail && !sRB) : begin
create-glyph "QRTail.\(suffix)" : glyph-proc
include : MarkSet.capDesc
include : Body terminal CAP 0
include : RetroflexHook.rExt RightSB 0
if sRT : include : sRT CAP
include : LeaningAnchor.Below.VBar.r RightSB
create-glyph "qRTail.\(suffix)" : glyph-proc
include : MarkSet.p
include : Body terminal XH 0
include : RetroflexHook.rExt RightSB 0
if sRT : include : sRT XH
include : LeaningAnchor.Below.VBar.r RightSB
select-variant 'q' 'q'
link-reduced-variant 'q/sansSerif' 'q' MathSansSerif
alias 'cyrl/qa' 0x51B 'q'
select-variant 'QRTail' 0x24A (follow -- 'qRTail')
select-variant 'qRTail' 0x24B
select-variant "q/hookTopBase" (shapeFrom -- 'q')
derive-glyphs 'qHookTop' 0x2A0 "q/hookTopBase" : function [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : VBar.r RightSB 0 XH
include : TopHook.rBarOuter RightSB 0 XH
include : LeaningAnchor.Above.VBar.r RightSB
glyph-block-import Letter-Blackboard : BBS BBD BBBarRight
create-glyph 'mathbb/q' 0x1D562 : glyph-proc
include : MarkSet.p
include : BBBarRight RightSB Descender XH
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