Files
Iosevka/glyphs/symbol-letter.ptl
T

402 lines
12 KiB
Plaintext

###### Letter-like symbols
$$include '../meta/macros.ptl'
import [mix linreg clamp fallback] from '../support/utils'
import [designParameters] from '../meta/aesthetics'
export : define [apply] : begin
glyph-module-entry commonShapes overmarks letterBasic
### Currency
sketch # currency
local sw : adviceBlackness 3.5
local radius : (RIGHTSB - SB) / 2
include : OShape (symbolMid + radius * 0.9) (symbolMid - radius * 0.9) (MIDDLE - radius * 0.9) (MIDDLE + radius * 0.9) sw
foreach j [range 0 4] : begin
local angle : Math.PI * (j / 2 + 1 / 4)
include : dispiro
widths.center sw
flat (MIDDLE + radius * 0.87 * [Math.cos angle]) (symbolMid + radius * 0.87 * [Math.sin angle])
curl (MIDDLE + radius * [Math.sqrt 2] * [Math.cos angle]) (symbolMid + radius * [Math.sqrt 2] * [Math.sin angle])
save 'currency' 0xA4
sketch # dollar.open
include markset.capital
define top : CAP * 0.95
define bot : CAP * 0.05
define smooth : adviceSSmooth (top - bot) (-1)
include : dispiro
widths.lhs
g4 RIGHTSB (top - HOOK)
hookstart (top - O)
g4 SB (top - smooth)
alsothru 0.5 0.5 [widths (ESS / 2) (ESS / 2)]
g4 RIGHTSB (bot + smooth) [widths 0 STROKE]
hookend (bot + O)
g4 SB (bot + HOOK)
include : dispiro
widths.center
flat MIDDLE (top - HALFSTROKE)
curl MIDDLE (CAP - DESCENDER / 2) [heading UPWARD]
include : dispiro
widths.center
flat MIDDLE (DESCENDER / 2) [heading UPWARD]
curl MIDDLE (bot + HALFSTROKE)
save 'dollar.open'
sketch # dollar.opencap
include markset.capital
define top : CAP * 0.84
define bot : CAP * 0.16
define w : adviceBlackness 3.5
define smooth : adviceSSmooth (top - bot) (-1)
include : dispiro
widths.lhs w
g4 RIGHTSB (top - HOOK)
hookstart (top - O)
g4 SB (top - smooth)
alsothru 0.5 0.5 [widths (ESS / 2 * w / STROKE) (ESS / 2 * w / STROKE)]
g4 RIGHTSB (bot + smooth) [widths 0 w]
hookend (bot + O)
g4 SB (bot + HOOK)
include : dispiro
widths.center
flat MIDDLE (top - HALFSTROKE)
curl MIDDLE (CAP) [heading UPWARD]
include : dispiro
widths.center
flat MIDDLE (0) [heading UPWARD]
curl MIDDLE (bot + HALFSTROKE)
save 'dollar.opencap'
sketch # dollar.through
include markset.capital
define top : CAP * 0.95
define bot : CAP * 0.05
define smooth : adviceSSmooth (top - bot) (-1)
define w : adviceBlackness 3.5
define fine : adviceBlackness 4
include : dispiro
widths.lhs w
g4 RIGHTSB (top - HOOK)
hookstart (top - O)
g4 SB (top - smooth)
alsothru 0.5 0.5 [widths (ESS / 2 * w / STROKE) (ESS / 2 * w / STROKE)]
g4 RIGHTSB (bot + smooth) [widths 0 w]
hookend (bot + O)
g4 SB (bot + HOOK)
include : dispiro
widths.center w
flat MIDDLE (top - HALFSTROKE)
curl MIDDLE (CAP - DESCENDER / 2) [heading UPWARD]
include : dispiro
widths.center w
flat MIDDLE (DESCENDER / 2) [heading UPWARD]
curl MIDDLE (bot + HALFSTROKE)
include : dispiro
widths.center fine
flat MIDDLE (top - HALFSTROKE) [heading DOWNWARD]
curl MIDDLE (bot + HALFSTROKE) [heading DOWNWARD]
save 'dollar.through'
sketch # dollar.throughcap
include markset.capital
define top : CAP * 0.84
define bot : CAP * 0.16
define smooth : adviceSSmooth (top - bot) (-1)
define w : adviceBlackness 3.5
define fine : adviceBlackness 4
include : dispiro
widths.lhs w
g4 RIGHTSB (top - HOOK)
hookstart (top - O)
g4 SB (top - smooth)
alsothru 0.5 0.5 [widths (ESS / 2 * w / STROKE) (ESS / 2 * w / STROKE)]
g4 RIGHTSB (bot + smooth) [widths 0 w]
hookend (bot + O)
g4 SB (bot + HOOK)
include : dispiro
widths.center w
flat MIDDLE (top - HALFSTROKE)
curl MIDDLE (CAP) [heading UPWARD]
include : dispiro
widths.center w
flat MIDDLE (0) [heading UPWARD]
curl MIDDLE (bot + HALFSTROKE)
include : dispiro
widths.center fine
flat MIDDLE (top - HALFSTROKE) [heading DOWNWARD]
curl MIDDLE (bot + HALFSTROKE) [heading DOWNWARD]
save 'dollar.throughcap'
select-variant 'dollar' '$'
sketch # euro
include glyphs.C
include : HOverlayBar [mix SB 0 0.7] [mix SB RIGHTSB 0.7] (CAP * 0.4)
include : HOverlayBar [mix SB 0 0.7] [mix SB RIGHTSB 0.7] (CAP * 0.6)
save 'euro' 0x20AC
sketch # cent
include glyphs.c AS_BASE
include : dispiro
widths.center
flat MIDDLE (XH - HALFSTROKE)
curl MIDDLE (XH - DESCENDER / 2) [heading UPWARD]
include : dispiro
widths.center
flat MIDDLE (DESCENDER / 2) [heading UPWARD]
curl MIDDLE HALFSTROKE
save 'cent' 0xA2
sketch # yen
include glyphs.Y AS_BASE
include : HOverlayBar SB RIGHTSB (CAP * 0.45)
include : HOverlayBar SB RIGHTSB (CAP * 0.25)
save 'yen' 0xA5
sketch # sterlingbase
include : dispiro
widths.lhs
g4 [mix SB RIGHTSB 0.95] (CAP - HOOK * 0.85)
hookstart (CAP - O) (tight -- true)
flat [mix SB RIGHTSB 0.2] [CAP - SMOOTHA]
curl [mix SB RIGHTSB 0.2] [mix STROKE CAP 0.3]
g4 SB STROKE
include : HBarBottom SB RIGHTSB 0
save 'sterlingbase'
sketch # sterling
set-width WIDTH
include glyphs.sterlingbase
include : HOverlayBar [mix SB RIGHTSB 0.05] [mix SB RIGHTSB 0.7] (CAP * 0.53)
save 'sterling' 0xA3
sketch # liraSymbol
set-width WIDTH
include glyphs.sterlingbase
include : HOverlayBar [mix SB RIGHTSB 0.05] [mix SB RIGHTSB 0.7] (CAP * 0.4)
include : HOverlayBar [mix SB RIGHTSB 0.05] [mix SB RIGHTSB 0.7] (CAP * 0.63)
save 'liraSymbol' 0x20A4
sketch # won
local df : DivFrame para.diversityM
set-width df.width
include glyphs.W AS_BASE ALSO_METRICS
include : HOverlayBar [mix SB 0 0.7] [mix df.rightSB df.width 0.7] (CAP * 0.6)
include : HOverlayBar [mix SB 0 0.7] [mix df.rightSB df.width 0.7] (CAP * 0.35)
save 'won' 0x20A9
sketch # frenchFranc
include glyphs.F
include : HOverlayBar (SB * 0.5) (SB * 3 + STROKE * HVCONTRAST) [mix 0 XH 0.4]
save 'frenchFranc' 0x20A3
sketch # ruble
include glyphs.P AS_BASE
define bar1pos : (CAP - STROKE) * BARPOS
include : HOverlayBar [mix SB 0 0.7] (SB + HALFSTROKE * HVCONTRAST) bar1pos
include : HOverlayBar [mix SB 0 0.7] [mix SB RIGHTSB 0.8] [mix 0 (bar1pos - STROKE) (3 / 4)]
save 'ruble' 0x20BD
### 'Letterlike Symbols'
sketch # numero
local fine : adviceBlackness 4.5
include : OShape XH [Math.max (fine * 2) (CAP * 0.1)] (MIDDLE + [Math.max (fine / 2) ((RIGHTSB - SB) * 0.1)]) [mix RIGHTSB WIDTH 0.5] fine (SMOOTHA * fine / STROKE) (SMOOTHB * fine / STROKE)
include : NShape CAP (SB / 2) MIDDLE 4.5 5.5 0.7
include : HBarBottom (MIDDLE + fine / 2) [mix RIGHTSB WIDTH 0.5] 0 fine
save 'numero' 0x2116
alias 'Ohm' 0x2126 'Omega'
turned 'Mho' 0x2127 'Ohm' MIDDLE (CAP / 2)
sketch # ell
include markset.b
local fine : adviceBlackness 3.5
local radius : Math.max fine (WIDTH * 0.15)
local middle : MIDDLE - fine / 2
local left : middle - radius * 1.25
local right : middle + radius * 1.5
local sma : SMOOTHA * 0.6
local smb : SMOOTHB * 0.6
include : dispiro
widths.center fine
g2 left [mix 0 CAP 0.33]
quadcontrols 1 0.6
g2 right [mix 0 CAP 0.8]
arcvh
g2 [mix middle right 0.5] (CAPO - fine / 2)
archv
flat middle (CAP - sma)
curl middle (SMOOTHB * 0.5 + fine / 2)
hookend (O + fine / 2)
g2 (middle + radius * 2) SHOOK
save 'ell' 0x2113
sketch # estimated
include : SmallEShape CAP [adviceBlackness 4] 0.5
save 'estimated' 0x212E
turned 'turniota' 0x2129 'iota' MIDDLE (XH / 2)
sketch # mathAleph
define p 0.3
include : xStrand true SB CAP RIGHTSB 0 0.1 0.4 0.28
include : intersection
dispiro
widths.rhs
g4.down.start RIGHTSB CAP
g4 [mix SB RIGHTSB p] 0
spiro-outline
corner SB CAP
corner RIGHTSB CAP
corner RIGHTSB 0
include : intersection
dispiro
widths.rhs
g4.up.start SB 0
g4 [mix SB RIGHTSB (1 - p)] CAP
spiro-outline
corner SB 0
corner RIGHTSB 0
corner SB CAP
save 'mathAleph' 0x2135
sketch # mathBeth
define pX 0.7
define pY 0.8
define turnX : mix SB RIGHTSB pY
include : dispiro
widths.rhs
flat SB CAP
curl [Math.min (turnX - STROKE * 1.5 * HVCONTRAST) [mix SB turnX pX]] CAP
archv
flat turnX [Math.min (CAP - STROKE * 1.5) [mix 0 CAP pY]]
curl turnX 0
include : HBarBottom SB RIGHTSB 0
save 'mathBeth' 0x2136
do "Blackboard Bolds ========================================================================"
define bbs : adviceBlackness 6
define bbd : clamp (WIDTH / 5.5) (WIDTH / 4) (bbs * 2.5)
sketch # bbN
include : VBarLeft SB 0 CAP bbs
include : VBarRight RIGHTSB 0 CAP bbs
include : intersection
Rect CAP 0 SB RIGHTSB
union
dispiro
widths.center bbs
corner (SB + bbs * HVCONTRAST) CAP
corner (RIGHTSB - bbs * HVCONTRAST / 2) (CAP / 5)
dispiro
widths.center bbs
corner (SB + bbs * HVCONTRAST / 2) (CAP - (CAP / 5))
corner (RIGHTSB - bbs * HVCONTRAST) 0
save 'bbN' 0x2115
sketch # bbZ
include : HBarTop SB RIGHTSB CAP bbs
include : HBarBottom SB RIGHTSB 0 bbs
include : intersection
Rect CAP 0 SB RIGHTSB
union
dispiro
widths.center bbs
corner SB (bbs / 2)
corner (RIGHTSB - bbd) (CAP - bbs / 2)
dispiro
widths.center bbs
corner (SB + bbd) (bbs / 2)
corner RIGHTSB (CAP - (bbs / 2))
include : intersection
union
VBarRight RIGHTSB (CAP - bbs * 2) CAP bbs
VBarLeft SB 0 (bbs * 2) bbs
spiro-outline
corner SB (bbs / 2)
corner (RIGHTSB - bbd) (CAP - bbs / 2)
corner RIGHTSB (CAP - (bbs / 2))
corner (SB + bbd) (bbs / 2)
save 'bbZ' 0x2124
sketch # bbC
include : CShape CAP 0 bbs
include : intersection
CShapeOutline CAP 0
VBar (SB + bbd) 0 CAP bbs
save 'bbC' 0x2102
define [BBPShape] : params [[mul PShape.defaultMul] [overshoot PShape.defaultOvershoot]] : glyph-construction
define sb : SB * mul
include : difference
PShape CAP (sw -- bbs) (mul -- mul) (overshoot -- overshoot) (slab -- false)
Rect (CAP - bbs) 0 (sb + HVCONTRAST * bbs / 2) (sb + bbd - HVCONTRAST * bbs / 2)
include : VBarLeft sb 0 CAP bbs
include : VBar (sb + bbd) 0 CAP bbs
include : HBarBottom sb (sb + bbd) 0 bbs
include : intersection
PShapeOutline CAP (sw -- bbs) (mul -- mul) (overshoot -- overshoot) (offset -- 1)
VBar (RIGHTSB - overshoot - bbd) 0 CAP bbs
sketch # bbP
include : BBPShape
save 'bbP' 0x2119
sketch # bbR
define [SingleLeg] : RLegShape (RIGHTSB - O) 0 ((CAP - bbs) * BARPOS) CAP false true bbs (bbd / 2)
define terminalX : RLegTerminalX true (RIGHTSB - O) bbs
include : BBPShape (mul -- 1) (overshoot -- O)
include : difference
union
SingleLeg
create-glyph : glyph-construction
include : SingleLeg
apply-transform : Translate (bbs / 2 - bbd) 0
HBarBottom (terminalX + bbs / 2 - bbd) (terminalX - bbs / 2) 0 bbs
PShapeOutline CAP (sw -- bbs) (mul -- 1) (overshoot -- O) (offset -- 1)
save 'bbR' 0x211D
sketch # bbH
include : VBarLeft SB 0 CAP bbs
include : VBarRight RIGHTSB 0 CAP bbs
include : VBar (SB + bbd) 0 CAP bbs
include : VBar (RIGHTSB - bbd) 0 CAP bbs
include : HBar (SB + bbd) (RIGHTSB - bbd) (CAP * BARPOS) bbs
include : HBarTop SB (SB + bbd) CAP bbs
include : HBarTop (RIGHTSB - bbd) RIGHTSB CAP bbs
include : HBarBottom SB (SB + bbd) 0 bbs
include : HBarBottom (RIGHTSB - bbd) RIGHTSB 0 bbs
save 'bbH' 0x210D
sketch # bbQ
define [QInner] : OShapeOutline (CAP - 1) 1 (SB + 1) (RIGHTSB - 1) bbs SMOOTHA SMOOTHB
include : OShape CAP 0 SB RIGHTSB bbs SMOOTHA SMOOTHB
include : intersection
QInner
union
VBar (SB + bbd) 0 CAP bbs
VBar (RIGHTSB - bbd) 0 CAP bbs
define terminalX : MIDDLE + HOOKX
define tailDeltaX : bbd / 2 - bbs / 8 * HVCONTRAST
define qTerminalY : bbs - HOOK - bbd / 4
define [QTail x] : dispiro
widths.center bbs
flat (x) (CAP / 2)
curl (x) 0
arcvh
flat [Math.min (terminalX - 1) (x - qTerminalY)] qTerminalY
curl terminalX qTerminalY
include : difference
union
QTail (MIDDLE - tailDeltaX)
QTail (MIDDLE + tailDeltaX)
QInner
save 'bbQ' 0x211A