forked from be5invis/Iosevka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshared.ptl
102 lines (91 loc) · 3.68 KB
/
shared.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
$$include '../../meta/macros.ptl'
import [mix linreg clamp fallback] from "@iosevka/util"
import [DependentSelector] from "@iosevka/glyph/relation"
glyph-module
glyph-block Letter-Armenian-Shared-Shapes : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared-Shapes : SerifFrame
define barPos : XH / 2
define highBarPos XH
define jut Jut
define JUT-NORMAL 0
define JUT-SHORT 1
define JUT-RIGHT 2
define JUT-LEFT 3
glyph-block-export ArmHBar
define [ArmHBar hPos df fCapital fOverslab] : namespace
define left : match hPos
[Just JUT-RIGHT] df.rightSB
[Just JUT-LEFT] (df.leftSB - (jut * [if fOverslab 1.5 1]) + [HSwToV : 0.5 * df.mvs])
-- df.leftSB
define right : match hPos
[Just JUT-RIGHT] (df.rightSB + (jut * [if fOverslab 1.5 1]) - [HSwToV : 0.5 * df.mvs])
[Just JUT-SHORT] (df.rightSB - (jut - [HSwToV : 0.5 * df.mvs]) * df.div)
[Just JUT-LEFT] df.leftSB
-- df.rightSB
export : define [top] : glyph-proc
include : HBar.t left right [if fCapital CAP Ascender] df.mvs
export : define [high] : glyph-proc
include : HBar.t left right highBarPos df.mvs
export : define [mid] : glyph-proc
include : HBar.m left right barPos df.mvs
export : define [base] : glyph-proc
include : HBar.b left right 0 df.mvs
export : define [desc] : glyph-proc
include : HBar.b left right Descender df.mvs
export : define [at y] : glyph-proc
include : HBar.m left right y df.mvs
set [ArmHBar.normal df fCapital fOverslab] : ArmHBar JUT-NORMAL df fCapital fOverslab
set [ArmHBar.short df fCapital fOverslab] : ArmHBar JUT-SHORT df fCapital fOverslab
set [ArmHBar.right df fCapital fOverslab] : ArmHBar JUT-RIGHT df fCapital fOverslab
set [ArmHBar.left df fCapital fOverslab] : ArmHBar JUT-LEFT df fCapital fOverslab
glyph-block-export RightHook
define [RightHook df top sw baseSerif hookSerif _base _hookY _ada _adb] : glyph-proc
local base : fallback _base 0
local hookY : fallback _hookY (top - Hook)
local ada : fallback _ada ArchDepthA
local adb : fallback _adb ArchDepthB
local yMidDepth : if (top - base > ada + adb) ada ((top - base) * (ada / (ada + adb)))
include : dispiro
widths.lhs df.mvs
g4 df.rightSB hookY
hookstart top (sw -- sw)
flat df.leftSB (top - yMidDepth)
curl df.leftSB base [heading Downward]
if baseSerif : begin
local sf : SerifFrame.fromDf df top base
include sf.lb.full
if hookSerif : begin
local sf : SerifFrame.fromDf df top hookY
include sf.rb.full
glyph-block-export LeftHook
define [LeftHook df top sw baseSerif hookSerif _base _hookY _ada _adb] : glyph-proc
local base : fallback _base 0
local hookY : fallback _hookY (top - Hook)
local ada : fallback _ada ArchDepthA
local adb : fallback _adb ArchDepthB
local yMidDepth : if (top - base > ada + adb) adb ((top - base) * (adb / (ada + adb)))
include : dispiro
widths.rhs df.mvs
g4 df.leftSB hookY
hookstart top (sw -- sw)
flat df.rightSB (top - yMidDepth)
curl df.rightSB base [heading Downward]
if baseSerif : begin
local sf : SerifFrame.fromDf df top base
include sf.rb.full
if hookSerif : begin
local sf : SerifFrame.fromDf df top hookY
include sf.lb.full
glyph-block-export TwoNeck
define [TwoNeck df top bot _left _right _adb _flatp] : begin
local adb : fallback _adb SmallArchDepthB
local flatp : fallback _flatp 0.75
local left : fallback _left df.leftSB
local right : fallback _right df.rightSB
local refY : top - adb * 1.5 - df.mvs / 2 * (1 - TanSlope)
return : list
g4.down.mid right (top - adb)
flat [mix left right flatp] [mix (bot + df.mvs) refY flatp]
curl left (bot + df.mvs) [widths.lhs df.mvs]