Iosevka/glyphs/latin-basic-lower.patel
2015-11-26 19:04:22 +08:00

609 lines
18 KiB
Plaintext

###### LOWER CASE
### o b d p q g
create-glyph 'o' : glyph-construction
set-width WIDTH
assign-unicode 'o'
include eMarks
include : smallo XH 0 SB RIGHTSB nothing nothing nothing true
define [oLeft _top _left] : glyph-construction
local top : fallback _top XH
local left : fallback _left SB
local fine SHOULDERFINE
local st : shoulderMidSlope fine nothing 1
local sb : shoulderMidSlope fine nothing (-1)
local mt : [mix left RIGHTSB 0.5] + (st - CORRECTION_OMIDX) * STROKE
local mb : [mix left RIGHTSB 0.5] + (sb + CORRECTION_OMIDX) * STROKE
include : dispiro
widths.lhs
g4 (mt) (top - O) [heading {.y (-1) .x (-st)}]
archv
flat (left + (STROKE - fine) * CORRECTION_HX) (top - SMALLSMOOTHA) [widths fine 0]
curl (left + (STROKE - fine) * CORRECTION_HX) (0 + SMALLSMOOTHB) [widths fine 0]
arcvh
g4 (mb) O [widths.heading STROKE 0 {.y (1) .x (-sb)}]
archv
flat.ai (RIGHTSB - OX) (0 + SMALLSMOOTHA)
curl.ai (RIGHTSB - OX) (top - SMALLSMOOTHB)
arcvh
close
define [oRight top right] : glyph-construction
include : create-glyph [oLeft top (WIDTH - [fallback right RIGHTSB])]
include : FlipAround MIDDLE ([fallback top XH] / 2)
create-glyph 'p' : glyph-construction
set-width WIDTH
assign-unicode 'p'
include pMarks
include : oLeft
include : VBarLeft SB DESCENDER XH
if SLAB : begin
include : LeftwardTopSerif SB XH SIDEJUT
tag-contour 'serifLT'
include : CenterBottomSerif (SB + HALFSTROKE * CORRECTION_HX) DESCENDER JUT
tag-contour 'serifLB'
create-glyph 'b' : glyph-construction
set-width WIDTH
assign-unicode 'b'
include bMarks
include : oLeft
include : VBarLeft SB 0 CAP
if SLAB : begin
include : LeftwardTopSerif SB CAP SIDEJUT
tag-contour 'serifLT'
include : LeftwardBottomSerif SB 0 SIDEJUT
tag-contour 'serifLB'
create-glyph 'q' : glyph-construction
set-width WIDTH
assign-unicode 'q'
include pMarks
include : oRight
include : VBarRight RIGHTSB DESCENDER XH
if SLAB : begin
include : RightwardTopSerif RIGHTSB XH SIDEJUT
tag-contour 'serifRT'
include : CenterBottomSerif (RIGHTSB - HALFSTROKE * CORRECTION_HX) DESCENDER JUT
create-glyph 'd' : glyph-construction
set-width WIDTH
assign-unicode 'd'
include bMarks
include : oRight
include : VBarRight RIGHTSB 0 CAP
if SLAB : begin
include : RightwardBottomSerif RIGHTSB 0 SIDEJUT
tag-contour 'serifRB'
include : LeftwardTopSerif (RIGHTSB - STROKE * CORRECTION_HX) CAP SIDEJUT
create-glyph 'g.doublestorey' : glyph-construction
set-width WIDTH
#assign-unicode 'g'
include pMarks
local obot : XH * GBARPOS - O - HALFSTROKE
include : smallo XH obot SB (RIGHTSB - 0.3 * SB)
local gleftx (SB * 0.8 + OX)
local grightx (RIGHTSB + SB * 0.1 - OX)
local groundy : Math.round : [mix DESCENDER (XH * GBARPOS) 0.625] + HALFSTROKE
include : dispiro
g4 [mix SB RIGHTSB 0.3] [mix XH obot 0.95] [widths 0 (STROKE * 0.7)]
alsothru (-1.2) 0.5 [widths HALFSTROKE HALFSTROKE]
flat [mix SB RIGHTSB 0.435] groundy [widths 0 STROKE]
curl [mix RIGHTSB SB 0.435] groundy
archv 4
g4 grightx [mix (DESCENDER + O) groundy 0.53]
arcvh
g4 [mix gleftx grightx 0.5] (DESCENDER + O)
archv
g4 gleftx [mix (DESCENDER + O) groundy 0.53]
arcvh
g4 [mix SB RIGHTSB 0.435] groundy [heading RIGHTWARD]
local gm : mix SB (RIGHTSB - 0.3 * SB) 0.5
start-from (RIGHTSB + 0.25 * SB - OX) XH
line-to (RIGHTSB + 0.25 * SB - OX) (XH - STROKE)
line-to gm (XH - STROKE - O)
line-to gm XH
set-anchor 'overlay' BASE MIDDLE [mix (DESCENDER + O) groundy 0.5]
create-glyph 'g.singlestorey' : glyph-construction
include pMarks
include : oRight
include : dispiro
widths.rhs
flat RIGHTSB XH [heading DOWNWARD]
curl RIGHTSB (DESCENDER + SMALLSMOOTHA)
hookend (DESCENDER + O)
g4 SB (DESCENDER + SHOOK)
if SLAB : begin
include : RightwardTopSerif RIGHTSB XH SIDEJUT
tag-contour 'serifRT'
select-variant 'g' 'g' 'doublestorey'
### c e t
create-glyph 'c' : glyph-construction
set-width WIDTH
assign-unicode 'c'
include eMarks
include : dispiro
widths.lhs
g4 RIGHTSB (XH - HOOK)
hookstart XO
flat.ai (SB + OX) (XH - SMALLSMOOTHA)
curl.ai (SB + OX) (0 + SMALLSMOOTHB)
hookend O
g4 RIGHTSB HOOK
define [SmallEShape top stroke barpos curly] : glyph-construction
local barbottom (top * [fallback barpos EBARPOS])
local hookx (RIGHTSB - OXHOOK + TAILADJX * globalTransform.yx)
local hookmiddle : [mix (SB + O) hookx 0.55] + CORRECTION_OMIDS
include : dispiro
widths.lhs stroke
flat (RIGHTSB - OX) barbottom [heading UPWARD]
curl (RIGHTSB - OX) (top - SMALLSMOOTHB)
arcvh
g4 (MIDDLE - CORRECTION_OMIDS) (top - O)
archv
flat.ai (SB + OX) (top - SMALLSMOOTHA)
curl.ai (SB + OX) (0 + SMALLSMOOTHB)
hookend O nothing stroke
g4 (RIGHTSB - OX * 0.5) AHOOK
include : HBarBottom (SB + (stroke / 2)) (RIGHTSB - (stroke / 2)) barbottom stroke
create-glyph 'e' : glyph-construction
set-width WIDTH
assign-unicode 'e'
include eMarks
include : SmallEShape XH STROKE
define [SmallTShape top bot] : glyph-construction
local center : MIDDLE - TBALANCE - HALFSTROKE * CORRECTION_HX
local hookx (center + (WIDTH - SB * 2) * 0.8 - OXHOOK + TAILADJX * globalTransform.yx)
local turn : [mix center hookx 0.5] + CORRECTION_OMIDS
local smb : (turn - center) * 1.2
include : dispiro
widths.lhs
flat center top [heading DOWNWARD]
curl center (bot + smb)
hookend (bot + O)
g4 hookx (bot + HOOK)
set-anchor 'bottomright' BASE hookx (bot + HOOK)
include : HBarTop (center + HALFSTROKE - LONGJUT + TBALANCE2) (center + HALFSTROKE + LONGJUT + TBALANCE2) XH
create-glyph 't' : glyph-construction
set-width WIDTH
assign-unicode 't'
include bMarks
include : SmallTShape CAP 0
### a u
create-glyph 'a.upright' : glyph-construction
set-width WIDTH
include eMarks
set-anchor 'trailing' BASE (RIGHTSB - markHalfStroke) 0
local bartop (XH * BARPOS * 1.02 + HALFSTROKE)
local lowslope : shoulderMidSlope SHOULDERFINE nothing (-1)
local lowmiddle : mix SB (RIGHTSB - HALFSTROKE * CORRECTION_HX) [linreg 72 0.51 120 0.56 STROKE]
local barsmooth : mix SB RIGHTSB 0.55
include : dispiro
widths.lhs
flat RIGHTSB 0 [heading UPWARD]
curl RIGHTSB (XH - SMOOTHA)
hookend XO
g4 SB (XH - AHOOK)
include : dispiro
widths.lhs
flat (RIGHTSB + O) bartop [heading LEFTWARD]
curl barsmooth bartop
archv
g4 (SB + OX) (bartop * 0.475)
arcvh
g4 (lowmiddle + (-lowslope) * STROKE) O [heading {.y 1 .x lowslope}]
archv
flat (RIGHTSB - STROKE * CORRECTION_HX) (SMALLSMOOTHB * 0.9) [widths 0 SHOULDERFINE]
curl (RIGHTSB - STROKE * CORRECTION_HX) (SMALLSMOOTHB * 0.9 + 1)
if SLAB : begin
include : RightwardBottomSerif RIGHTSB 0 SIDEJUT
create-glyph 'a.italic' : glyph-construction
set-width WIDTH
include eMarks
set-anchor 'trailing' BASE (RIGHTSB - markHalfStroke) 0
include : oRight
include : VBarRight RIGHTSB 0 XH
if SLAB : begin
include : RightwardBottomSerif RIGHTSB 0 SIDEJUT
tag-contour 'serifRB'
create-glyph 'a' : glyph-construction
set-width WIDTH
assign-unicode 'a'
if (para.italicangle > 0)
then : include glyphs.'a.italic' AS_BASE
else : include glyphs.'a.upright' AS_BASE
### n u h m
create-glyph 'n' : glyph-construction
set-width WIDTH
assign-unicode 'n'
include eMarks
include : nShoulder (SB + STROKE * CORRECTION_HX) RIGHTSB SHOULDERFINE
include : VBarLeft SB 0 XH
if SLAB : begin
include : LeftwardTopSerif SB XH SIDEJUT
tag-contour 'serifLT'
if (para.italicangle > 0)
: then : include : tagged 'serifRB' : RightwardBottomSerif RIGHTSB 0 SIDEJUT
: else : include : tagged 'serifRB' : CenterBottomSerif (RIGHTSB - HALFSTROKE * CORRECTION_HX) 0 JUT
if (para.italicangle === 0) : begin
include : CenterBottomSerif (SB + HALFSTROKE * CORRECTION_HX) 0 JUT
tag-contour 'serifLB'
create-glyph 'u' : glyph-construction
set-width WIDTH
assign-unicode 'u'
include eMarks
set-anchor 'trailing' BASE (RIGHTSB - markHalfStroke) 0
include glyphs.n
eject-contour 'serifRB'
eject-contour 'serifLB'
include : FlipAround MIDDLE (XH / 2)
if SLAB : begin
include : LeftwardTopSerif (RIGHTSB - STROKE * CORRECTION_HX) XH SIDEJUT
include : LeftwardTopSerif SB XH SIDEJUT
create-glyph 'h' : glyph-construction
set-width WIDTH
assign-unicode 'h'
include bMarks
include : nShoulder (SB + STROKE * CORRECTION_HX) RIGHTSB SHOULDERFINE
include : VBarLeft SB 0 CAP
if SLAB : begin
include : LeftwardTopSerif SB CAP SIDEJUT
if (para.italicangle > 0)
: then : include : RightwardBottomSerif RIGHTSB 0 SIDEJUT
: else : include : CenterBottomSerif (RIGHTSB - HALFSTROKE * CORRECTION_HX) 0 JUT
tag-contour 'serifRB'
if (para.italicangle === 0) : begin
include : CenterBottomSerif (SB + HALFSTROKE * CORRECTION_HX) 0 JUT
tag-contour 'serifLB'
define [SmallMShape top bot] : glyph-construction
local m1 : mix (SB + O) (MIDDLE + MVERTSTROKE / 2 * CORRECTION_HX) 0.5
local m2 : mix (RIGHTSB - O) (MIDDLE - MVERTSTROKE / 2 * CORRECTION_HX) 0.5
include : mShoulderSpiro (SB + O + MVERTSTROKE * CORRECTION_HX) (MIDDLE + MVERTSTROKE / 2 * CORRECTION_HX) top bot MVERTSTROKE (MVERTSTROKE * 0.4)
include : mShoulderSpiro (MIDDLE + MVERTSTROKE * 0.5 * CORRECTION_HX) (RIGHTSB - O) top bot MVERTSTROKE (MVERTSTROKE * 0.5)
include : VBarLeft (SB + O) bot top MVERTSTROKE
if SLAB : begin
include : LeftwardTopSerif SB top SIDEJUT
tag-contour 'serifLT'
if (para.italicangle === 0) : include : LeftwardBottomSerif SB bot SIDEJUT
include : RightwardBottomSerif RIGHTSB bot SIDEJUT
tag-contour 'serifRB'
create-glyph 'm' : glyph-construction
set-width WIDTH
assign-unicode 'm'
include eMarks
include : SmallMShape XH 0
### i j l
create-glyph 'dotlessi.straight' : glyph-construction
include eMarks
include : VBar (MIDDLE) 0 XH
create-glyph 'dotlessi.hooky' : glyph-construction
include glyphs.'dotlessi.straight' AS_BASE
include : LeftwardTopSerif MIDDLE XH LONGJUT
create-glyph 'dotlessi.zshaped' : glyph-construction
include glyphs.'dotlessi.hooky' AS_BASE
include : RightwardBottomSerif MIDDLE 0 LONGJUT
create-glyph 'dotlessi.serifed' : glyph-construction
include eMarks
local balance IBALANCE
include : VBar (MIDDLE + balance) 0 XH
include : LeftwardTopSerif (MIDDLE + balance) XH (LONGJUT - balance)
include : RightwardBottomSerif MIDDLE 0 LONGJUT
include : LeftwardBottomSerif MIDDLE 0 LONGJUT
create-glyph 'dotlessi.italic' : glyph-construction
local left : [mix SB RIGHTSB 0.48] - HALFSTROKE * CORRECTION_HX
local right : mix SB RIGHTSB 1.05
local middle : mix left right 0.55
include : dispiro
widths.lhs
flat left XH [heading DOWNWARD]
curl left (SMALLSMOOTHB * 0.7)
hookend O
g4 right (SHOOK * 0.8)
include : dispiro
flat (left - LONGJUT + HALFSTROKE * CORRECTION_HX) XH [widths 0 STROKE]
curl left XH
include eMarks
set-anchor 'above' BASE (left + HALFSTROKE * CORRECTION_HX) XH
set-anchor 'below' BASE middle 0
select-variant 'dotlessi' 0x131 [if para.italicangle 'italic' 'serifed']
create-glyph 'i' : glyph-construction
set-width WIDTH
assign-unicode 'i'
include glyphs.dotlessi AS_BASE
include glyphs.dotAbove
create-glyph 'dotlessj.straight' : glyph-construction
include pMarks
set-anchor 'above' BASE (MIDDLE + JBALANCE - STROKE * 0.166 * CORRECTION_HX) XH
set-anchor 'overlay' BASE (MIDDLE + JBALANCE - STROKE * 0.166 * CORRECTION_HX) (XH / 2)
local center : MIDDLE + JBALANCE + HALFSTROKE * CORRECTION_HX
local hookx : center - (WIDTH * 0.5) - STROKE * CORRECTION_HX + OXHOOK
local turn : [mix center hookx 0.5] + CORRECTION_OMIDS
local smb : (center - turn) * 1.2
include : dispiro
widths.rhs
flat center XH [heading DOWNWARD]
curl center (DESCENDER + smb)
hookend (DESCENDER + O)
g4 hookx (DESCENDER + JHOOK)
create-glyph 'dotlessj.serifed' : glyph-construction
include pMarks
include glyphs.'dotlessj.straight' AS_BASE
include : LeftwardTopSerif (MIDDLE + JBALANCE) XH LONGJUT
select-variant 'dotlessj' 0x237 'serifed'
create-glyph 'j' : glyph-construction
set-width WIDTH
assign-unicode 'j'
include glyphs.dotlessj AS_BASE
include glyphs.dotAbove
create-glyph 'l.straight' : glyph-construction
include bMarks
include : VBar MIDDLE 0 CAP
create-glyph 'l.hooky' : glyph-construction
include bMarks
include : VBar MIDDLE 0 (CAP - STROKE)
include : LeftwardTopSerif MIDDLE CAP LONGJUT
create-glyph 'l.zshaped' : glyph-construction
include bMarks
include glyphs.'l.hooky'
include : RightwardBottomSerif MIDDLE 0 LONGJUT
create-glyph 'l.serifed' : glyph-construction
include bMarks
local balance LBALANCE
include : VBar (MIDDLE + balance) 0 CAP
include : LeftwardTopSerif (MIDDLE + balance) CAP (LONGJUT - balance)
include : CenterBottomSerif MIDDLE 0 LONGJUT
set this.barx (MIDDLE + balance)
create-glyph 'l.italic' : glyph-construction
local left : mix SB RIGHTSB 0.3
local right : mix SB RIGHTSB 1.1
local middle : mix left right 0.54
include : dispiro
widths.lhs
flat left CAP [heading DOWNWARD]
curl left (SMALLSMOOTHB * 0.75)
hookend O
g4 right SHOOK
include : dispiro
flat SB CAP [widths 0 STROKE]
curl left CAP
include bMarks
set-anchor 'above' BASE (left + HALFSTROKE) CAP
set-anchor 'below' BASE middle 0
set this.barx (left + HALFSTROKE)
select-variant 'l' 'l' [if para.italicangle 'italic' 'serifed']
### x v w y z k
create-glyph 'x' : glyph-construction
set-width WIDTH
assign-unicode 'x'
include eMarks
local TURN (XH * 0.1)
include : xStrand SB 0 RIGHTSB XH 0.02 0.4 0.14
include : xStrand SB XH RIGHTSB 0 0.02 0.4 0.14
include : AIHSerifs XH
create-glyph 'v' : glyph-construction
set-width WIDTH
assign-unicode 'v'
include eMarks
include : VShape XH
create-glyph 'w' : glyph-construction
set-width WIDTH
assign-unicode 'w'
include eMarks
include : WShape XH
create-glyph 'y' : glyph-construction
set-width WIDTH
assign-unicode 'y'
include pMarks
local xbottom : mix SB RIGHTSB 0.28
local turnp : XH / (XH - DESCENDER)
local xb : mix SB RIGHTSB 0.51
local yb : mix 0 XH (0.05 * turnp)
include : tagged 'strokeR' : xStrand xbottom DESCENDER RIGHTSB XH 0.1 0.6 0.14
include : halfXStrand SB XH xb yb (0.1 * turnp) 0.4 (0.14 * turnp)
tag-contour 'strokeL'
if SLAB : begin
include : AIVSerifs XH
include : LeftwardBottomSerif xbottom DESCENDER (SIDEJUT + JUT / 4)
create-glyph 'z' : glyph-construction
set-width WIDTH
assign-unicode 'z'
include eMarks
local cor : 1.2 * CORRECTION_HX
include : HBarTop SB RIGHTSB XH
start-from SB STROKE
line-to (SB + STROKE * cor) STROKE
line-to RIGHTSB (XH - STROKE)
line-to (RIGHTSB - STROKE * cor) (XH - STROKE)
reverse-last
include : HBarBottom SB RIGHTSB 0
tag-contour 'strokeBottom'
if SLAB : begin
include : DownwardLeftSerif SB XH VJUT
include : UpwardRightSerif RIGHTSB 0 VJUT
tag-contour 'serifRB'
create-glyph 'k' : glyph-construction
set-width WIDTH
assign-unicode 'k'
include bMarks
include : VBarLeft SB 0 CAP
include : KShape XH
if SLAB : begin
include : LeftwardTopSerif SB CAP SIDEJUT
if (para.italicangle === 0) : begin
include : CenterBottomSerif (SB + HALFSTROKE * CORRECTION_HX) 0 JUT
tag-contour 'serifLB'
### s
create-glyph 's' : glyph-construction
set-width WIDTH
assign-unicode 's'
include eMarks
define smooth : adviceSSmooth XH (-1)
include : dispiro
widths.lhs
g4 RIGHTSB (XH - SHOOK)
hookstart XO
g4.down.mid SB (XH - smooth)
alsothru 0.5 0.5 [widths (ESS / 2) (ESS / 2)]
g4.down.mid RIGHTSB (smooth) [widths 0 STROKE]
hookend O
g4 SB SHOOK
### r
create-glyph 'r' : glyph-construction
set-width WIDTH
assign-unicode 'r'
include eMarks
local rhookx (RIGHTSB + RBALANCE2 - OXE)
local fine (STROKE * 0.25)
local rbar : SB + RBALANCE + STROKE * CORRECTION_HX
local rmiddle : [mix (rbar - fine) rhookx (0.5 + globalTransform.yx * STROKE / WIDTH)] - CORRECTION_OMIDS
include : dispiro
widths.lhs
g4 rhookx (XH - RHOOK)
g4 rmiddle XO [heading {.y (-1) .x (-0.2 - globalTransform.yx)}]
archv 8 'notiny'
flat (rbar - fine * CORRECTION_HX) (XH - SMALLSMOOTHA) [widths fine 0]
curl (rbar - fine * CORRECTION_HX) (XH - SMALLSMOOTHA - 1)
include : VBarLeft (SB + RBALANCE) 0 XH
set-anchor 'overlay' BASE rbar (XH * 0.5)
if SLAB : begin
include : CenterBottomSerif (SB + RBALANCE + STROKE * 0.75 * CORRECTION_HX) 0 (JUT + HALFSTROKE / 2)
tag-contour 'serifLB'
include : LeftwardTopSerif (SB + RBALANCE) XH SIDEJUT
tag-contour 'serifLT'
### f
define fovershoot : fallback para.fovershoot (O * 6)
create-glyph 'longs.upright' : glyph-construction
set-width WIDTH
include bMarks
include : dispiro
widths.center
flat (MIDDLE - FBALANCE) 0 [heading UPWARD]
curl (MIDDLE - FBALANCE) (CAP - FHOOK)
straight.right.end (MIDDLE - FBALANCE + HOOKX) (CAP - HALFSTROKE - fovershoot) [heading RIGHTWARD]
if SLAB : begin
include : CenterBottomSerif (MIDDLE - FBALANCE) 0 JUT
tag-contour 'serifMB'
define [LongSShape top bottom hookx hooky fine] : glyph-construction
local w [fallback fine STROKE]
include : dispiro
widths.center w
straight.right.start (MIDDLE - hookx) (bottom + w / 2 + fovershoot) [heading RIGHTWARD]
flat MIDDLE (bottom + hooky)
curl MIDDLE (top - hooky)
straight.right.end (MIDDLE + hookx) (top - w / 2 - fovershoot) [heading RIGHTWARD]
create-glyph 'longs.italic' : glyph-construction
set-width WIDTH
include ifMarks
include : LongSShape CAP (-HOOK) HOOKX HOOK
create-glyph 'longs' : glyph-construction
set-width WIDTH
assign-unicode 0x17f
if (para.italicangle > 0)
then : include glyphs.'longs.italic' AS_BASE
else : include glyphs.'longs.upright' AS_BASE
create-glyph 'f.slab' : glyph-construction
include bMarks
local barleft [mix SB RIGHTSB 0.24]
include : dispiro
widths.lhs
g4 RIGHTSB (CAP - HOOK * 0.7)
hookstart (CAP - O) true
flat barleft [CAP - SMOOTHA * 0.85]
curl barleft 0
include : HBarTop [mix SB RIGHTSB 0] [mix SB RIGHTSB 0.9] (XH * 0.95)
include : HBarBottom [mix SB RIGHTSB 0.02] [mix SB RIGHTSB 0.8] 0
create-glyph 'f' : glyph-construction
set-width WIDTH
assign-unicode 'f'
if (SLAB && para.italicangle === 0)
: then : include glyphs.'f.slab' AS_BASE
: else : begin
include glyphs.longs AS_BASE
include : HBarTop (MIDDLE - LONGJUT) (MIDDLE + LONGJUT) XH