Iosevka/glyphs/numbers.patel
2015-07-27 00:49:00 +08:00

209 lines
No EOL
5.6 KiB
Text

###### NUMBERS
create-glyph 'zero.unslashed' : glyph-construction {
set-width WIDTH
dont-export
include : smallo CAP 0 SB RIGHTSB
}
create-glyph 'zero.slashed' : glyph-construction {
set-width WIDTH
dont-export
include glyphs.'zero.unslashed'
local fine : adviceBlackness 9
include : create-stroke
:.start-from [SB + STROKE / 2] [CAP * [1 - 0.77]]
:.set-width fine fine
:.line-to [RIGHTSB - STROKE / 2] [CAP * 0.77]
}
create-glyph 'zero.dotted' : glyph-construction {
set-width WIDTH
dont-export
include glyphs.'zero.unslashed'
local radius : Math.min DOTRADIUS [[RIGHTSB - SB - STROKE * 2] / 4]
include : list {
Ring [CAPMIDDLE + radius] [CAPMIDDLE - radius] [MIDDLE + radius] [MIDDLE - radius]
}
}
select-variant 'zero' '0' 'slashed'
create-glyph 'one' : glyph-construction {
set-width WIDTH
assign-unicode '1'
include : create-stroke
:.start-from [MIDDLE + JBALANCE * 0.5] 0
:.set-width HALFSTROKE HALFSTROKE
:.heads-to UPWARD
:.line-to [MIDDLE + JBALANCE * 0.5] CAP
:.heads-to UPWARD
include : create-stroke
:.start-from [MIDDLE - HALFSTROKE + JBALANCE * 0.5] CAP
:.set-width STROKE 0
:.line-to [MIDDLE - HOOK * 1.5 + JBALANCE * 0.5] [CAP - HOOK * 0.75]
}
create-glyph 'two' : glyph-construction {
set-width WIDTH
assign-unicode '2'
include : twoHookUpper CAP SMOOTHB HOOK
include : sStrand STROKE [CAP - SMOOTHB]
include : create-stroke
:.start-from SB 0
:.set-width STROKE 0
:.heads-to RIGHTWARD
:.line-to RIGHTSB 0
:.heads-to RIGHTWARD
}
create-glyph 'three' : glyph-construction {
set-width WIDTH
assign-unicode '3'
local threeRadius [CAPMIDDLE + HALFSTROKE - SMOOTH]
include : twoHookUpper CAP SMOOTHB HOOK
include : sHookLower 0 SMOOTHA HOOK
include : create-stroke
:.start-from RIGHTSB [CAP - SMOOTHB]
:.set-width 0 STROKE
:.arc-vh-to [RIGHTSB - threeRadius] [CAPMIDDLE - HALFSTROKE]
:.heads-to LEFTWARD
include : create-stroke
:.start-from RIGHTSB SMOOTHA
:.set-width STROKE 0
:.arc-vh-to [RIGHTSB - threeRadius] [CAPMIDDLE + HALFSTROKE]
:.heads-to LEFTWARD
}
create-glyph 'four' : glyph-construction {
set-width WIDTH
assign-unicode '4'
local bar [CAP * 0.4]
local vert [WIDTH * 0.55]
include : create-stroke
:.start-from SB bar
:.set-width 0 STROKE
:.heads-to RIGHTWARD
:.line-to RIGHTSB bar
:.heads-to RIGHTWARD
include : create-stroke
:.start-from vert 0
:.set-width 0 STROKE
:.heads-to UPWARD
:.line-to vert CAP
:.heads-to UPWARD
include : create-stroke
:.start-from SB bar
:.set-width 0 STROKE
:.line-to vert CAP
}
create-glyph 'five' : glyph-construction {
set-width WIDTH
assign-unicode '5'
include : sHookLower 0 [[CAP * FIVEBARPOS + STROKE] / 2] HOOK
include : create-stroke
:.start-from RIGHTSB [[CAP * FIVEBARPOS + STROKE] / 2]
:.set-width STROKE 0
:.arc-vh-to MIDDLE [CAP * FIVEBARPOS + STROKE]
:.line-to [SB + TBALANCE * [0.6 - globalTransform.yx * 2]] [CAP * FIVEBARPOS + STROKE]
:.heads-to LEFTWARD
include : create-stroke
:.start-from [SB + TBALANCE * [0.6 - globalTransform.yx * 2]] CAP
:.set-width 0 STROKE
:.heads-to RIGHTWARD
:.line-to [RIGHTSB - TBALANCE / 2] CAP
:.heads-to RIGHTWARD
include : create-stroke
:.start-from [SB + TBALANCE * [0.6 - globalTransform.yx * 2]] [CAP * FIVEBARPOS + STROKE]
:.set-width 0 STROKE
:.heads-to UPWARD
:.line-to [SB + TBALANCE * [0.6 - globalTransform.yx * 2]] CAP
:.heads-to UPWARD
}
create-glyph 'six' : glyph-construction {
set-width WIDTH
assign-unicode '6'
include : smallo [CAP * 0.6] 0 SB RIGHTSB
local ymiddlea : [CAP * 0.6 - SMALLSMOOTHA + SMALLSMOOTHB] / 2
include : create-stroke
:.start-from [SB + O] ymiddlea
:.set-width 0 STROKE
:.curve-to [SB + O] [mix ymiddlea CAP 0.8] [RIGHTSB - STROKE * 1.1] CAP
}
create-glyph 'seven' : glyph-construction {
set-width WIDTH
assign-unicode '7'
include : create-stroke
:.start-from SB CAP :.heads-to RIGHTWARD :.set-width 0 STROKE
:.line-to RIGHTSB CAP :.heads-to RIGHTWARD
local cor 1.15
local x : mix SB RIGHTSB 0.15
start-from x 0
line-to [x + STROKE * cor] 0
line-to RIGHTSB [CAP - STROKE]
line-to [RIGHTSB - STROKE * cor] [CAP - STROKE]
reverse-last
}
create-glyph 'eight' : glyph-construction {
set-width WIDTH
assign-unicode '8'
local sma : SMOOTHA * 0.975
local smb : SMOOTHB * 0.975
local p 0.96
include : xsStrand [mix RIGHTSB SB p] [CAP - sma * p] RIGHTSB sma
include : xsStrand SB smb [mix SB RIGHTSB p] [CAP - smb * p]
include : create-stroke
:.start-from [mix SB RIGHTSB p] [CAP - smb * p]
:.set-width STROKE 0
:.arc-vh-to [MIDDLE - STROKE * globalTransform.yx] [CAP - O]
:.arc-hv-to [mix RIGHTSB SB p] [CAP - sma * p]
include : create-stroke
:.start-from SB smb
:.set-width STROKE 0
:.arc-vh-to [MIDDLE + STROKE * globalTransform.yx] O
:.arc-hv-to RIGHTSB sma
}
create-glyph 'nine' : glyph-construction {
set-width WIDTH
assign-unicode '9'
include : smallo CAP [CAP * 0.4] SB [RIGHTSB + O]
local ymiddlea : [CAP - SMALLSMOOTHB + CAP * 0.4 + SMALLSMOOTHA] / 2
include : create-stroke
:.start-from RIGHTSB ymiddlea
:.set-width 0 STROKE
:.line-to RIGHTSB [CAP * 0.4]
include : sHookLower 0 [CAP * 0.4] HOOK [mix SB RIGHTSB 0.48]
}
create-glyph 'ten' : glyph-construction {
set-width : WIDTH * 2
include glyphs.one
apply-transform : Translate [-WIDTH] 0
include glyphs.zero
apply-transform : Translate WIDTH 0
}