Iosevka/glyphs/cyrillic-basic.patel
2015-11-27 04:51:04 +08:00

605 lines
19 KiB
Plaintext

###### Cyrillic glyphs
# Style parameters
define [CyrDescender x shift] : glyph-construction
local descenderOverflow : if SLAB SIDEJUT ((RIGHTSB - SB) * [fallback shift 0.1])
include : VBarRight (x + descenderOverflow) (HALFSTROKE - LONGJUT) STROKE
# Copy and turned characters
alias 'cyrA' 0x410 'A'
alias 'cyra' 0x430 'a'
alias 'cyrVe' 0x412 'B'
alias 'cyrGhe' 0x413 'Gamma'
alias 'cyrIe' 0x415 'E'
alias 'cyrie' 0x435 'e'
alias 'cyrKa' 0x41A 'K'
alias 'cyrEm' 0x41C 'M'
alias 'cyrEn' 0x41D 'H'
alias 'cyrO' 0x41E 'O'
alias 'cyro' 0x43e 'o'
alias 'cyrPe' 0x41F 'Pi'
alias 'cyrpe.italic' null 'n'
alias 'cyrEr' 0x420 'P'
alias 'cyrer' 0x440 'p'
alias 'cyrEs' 0x421 'C'
alias 'cyres' 0x441 'c'
alias 'cyrTe' 0x422 'T'
alias 'cyrte.upright' null 'tau'
alias 'cyrte.italic' null 'm'
alias 'Ef' 0x424 'Phi'
alias 'cyrHa' 0x425 'X'
alias 'cyrha' 0x445 'x'
alias 'cyru' 0x443 'y'
alias 'cyrUkrainianI' 0x406 'I'
alias 'cyrUkrainiani' 0x456 'i'
alias 'cyrJe' 0x408 'J'
alias 'cyrje' 0x458 'j'
alias 'cyrDze' 0x405 'S'
alias 'cyrdze' 0x455 's'
### Russian letters
define [CyrYeriShape top _left _right _fine _jut] : glyph-construction
local fine : fallback _fine STROKE
local left : fallback _left SB
local right : fallback _right RIGHTSB
local jut : fallback _jut JUT
local bowl : top * 0.55 + HALFSTROKE
local turnbottom : bowl / 2
include : dispiro
widths.lhs fine
flat (left + STROKE * 0.2) 0 [heading RIGHTWARD]
curl (right - turnbottom * (right - left) / (RIGHTSB - SB)) 0 [heading RIGHTWARD]
archv 8
g4 (right - OX) turnbottom
arcvh 8
flat (right - turnbottom * (right - left) / (RIGHTSB - SB)) bowl [heading LEFTWARD]
curl (left + STROKE * 0.2) bowl [heading LEFTWARD]
include : VBarLeft left 0 top fine
if SLAB : begin
include : LeftwardBottomSerif left 0 (jut - fine / 2 * CORRECTION_HX)
tag-contour 'serifYeriLB'
include : CenterTopSerif (left + fine / 2 * CORRECTION_HX) top jut
tag-contour 'serifYeriLT'
define [RevCyrYeriShape top _left _right _fine _jut] : glyph-construction
local fine : fallback _fine STROKE
local left : fallback _left SB
local right : fallback _right RIGHTSB
local jut : fallback _jut JUT
local bowl : top * 0.55 + HALFSTROKE
local turnbottom : bowl / 2
include : dispiro
widths.rhs fine
flat (right - STROKE * 0.2) 0 [heading LEFTWARD]
curl (left + turnbottom * (right - left) / (RIGHTSB - SB)) 0
archv
g4 (left + O) turnbottom
arcvh
flat (left + turnbottom * (right - left) / (RIGHTSB - SB)) bowl
curl (right - STROKE * 0.2) bowl [heading RIGHTWARD]
include : VBarRight right 0 top fine
if SLAB : begin
include : RightwardBottomSerif right 0 (jut - fine / 2 * CORRECTION_HX)
tag-contour 'serifYeriRB'
include : CenterTopSerif (right - fine / 2 * CORRECTION_HX) top jut
tag-contour 'serifYeriRT'
create-glyph 'cyrYeri' : glyph-construction
assign-unicode 0x42C
include capitalMarks
include : CyrYeriShape CAP SB RIGHTSB
create-glyph 'cyryeri' : glyph-construction
assign-unicode 0x44C
include eMarks
include : CyrYeriShape XH SB RIGHTSB
create-glyph 'cyrBe' : glyph-construction
assign-unicode 0x411
include glyphs.cyrYeri AS_BASE
include : HBar SB [mix SB RIGHTSB 0.9] (CAP - HALFSTROKE)
if SLAB : begin
include : DownwardRightSerif [mix SB RIGHTSB 0.9] CAP VJUT
define [CyrIShape top] : glyph-construction
local topstroke : adviceBlackness 4
local halftopstroke : topstroke / 2
include : dispiro
widths.lhs
flat RIGHTSB 0 [heading UPWARD]
curl RIGHTSB (top * 0.4) [heading UPWARD]
straight.up.end RIGHTSB top [widths.heading topstroke 0 UPWARD]
include : dispiro
widths.lhs
flat SB top [heading DOWNWARD]
curl SB (top * 0.6) [heading DOWNWARD]
straight.down.end SB 0 [widths.heading topstroke 0 DOWNWARD]
include : dispiro
flat (RIGHTSB - halftopstroke) top [widths.heading 0 topstroke DOWNWARD]
curl (SB + halftopstroke) 0 [widths.heading topstroke 0 DOWNWARD]
include : AICyrISerifs top
create-glyph 'cyrI' : glyph-construction
assign-unicode 0x418
include capitalMarks
include : CyrIShape CAP
create-glyph 'cyri.upright' : glyph-construction
include eMarks
include : CyrIShape XH
create-glyph 'cyri.italic' : glyph-construction
include glyphs.u AS_BASE
italic-variant 'cyri' 0x438
create-glyph 'cyrU' : glyph-construction
set-width WIDTH
assign-unicode 0x423
include capitalMarks
local xbottom : mix SB RIGHTSB 0.28
local turnp : XH / CAP
local xb : mix SB RIGHTSB 0.51
local yb : mix (CAP - XH) CAP (0.05 * turnp)
include : xStrand xbottom 0 RIGHTSB CAP 0.1 0.6 0.14
include : halfXStrand SB CAP xb yb (0.1 * turnp) 0.4 (0.14 * turnp)
if SLAB : begin
include : AIVSerifs CAP
include : LeftwardBottomSerif xbottom 0 (SIDEJUT + JUT / 4)
create-glyph 'cyrbe' : glyph-construction
assign-unicode 0x431
include bMarks
include : dispiro
widths.rhs
flat (SB + OX) SMALLSMOOTHB
curl (SB + OX) (XH - SMALLSMOOTHA)
arcvh
g4 (MIDDLE - CORRECTION_OMIDS) (CAP * 0.7 - O)
archv
flat.ai (RIGHTSB - OX) (XH - SMALLSMOOTHB)
curl.ai (RIGHTSB - OX) SMALLSMOOTHA
arcvh
g4 (MIDDLE + CORRECTION_OMIDX) O
archv
flat (SB + OX) SMALLSMOOTHB
curl (SB + OX) (XH - SMALLSMOOTHA)
alsothruthem [list {0.25 0.79} {0.5 0.87}] important
g4 (RIGHTSB - HALFSTROKE * CORRECTION_HX) CAP
alias 'cyrbe.serbian' null 'delta'
create-glyph 'cyrka' : glyph-construction
set-width WIDTH
assign-unicode 0x43A
include eMarks
include : VBarLeft SB 0 XH
include : KShape XH
if SLAB : begin
include : CenterBottomSerif (SB + HALFSTROKE * CORRECTION_HX) 0 JUT
include : CenterTopSerif (SB + HALFSTROKE * CORRECTION_HX) XH JUT
create-glyph 'cyref' : glyph-construction
assign-unicode 0x444
include ifMarks
local y1 0
local y2 XH
include : VBar MIDDLE DESCENDER (y1 + HALFSTROKE)
include : smallo y2 y1 SB RIGHTSB MVERTSTROKE nothing nothing nothing true
include : VBar MIDDLE y1 y2 MVERTSTROKE
include : VBar MIDDLE (y2 - HALFSTROKE) CAP
if SLAB : begin
include : tagged 'serifMT' : CenterTopSerif MIDDLE CAP JUT
include : tagged 'serifMB' : CenterBottomSerif MIDDLE DESCENDER JUT
create-glyph 'cyrve.italic' : glyph-construction
include eMarks
local mid : mix RIGHTSB SB 0.65
include : dispiro
widths.lhs
flat mid (XH / 2 - HALFSTROKE) [heading RIGHTWARD]
curl MIDDLE (XH / 2 - HALFSTROKE)
archv
g4 (RIGHTSB + O) (XH - SMOOTHB * 0.87)
arcvh
g4 (MIDDLE - CORRECTION_OMIDS) XO
archv
flat.ai (SB + O) (XH - SMALLSMOOTHA)
curl.ai (SB + O) SMALLSMOOTHB
arcvh
g4 (MIDDLE + CORRECTION_OMIDS) O
archv
g4 (RIGHTSB - O) (SMOOTHA * 0.87)
arcvh
flat MIDDLE (XH / 2 + HALFSTROKE)
curl mid (XH / 2 + HALFSTROKE) [heading LEFTWARD]
create-glyph 'cyrve.upright' : glyph-construction
include eMarks
include : BShape XH
italic-variant 'cyrve' 0x432
create-glyph 'cyrghe.upright' : glyph-construction
include eMarks
include : GammaShape XH
create-glyph 'cyrghe.italic' : glyph-construction
include eMarks
local smooth : adviceSSmooth XH 1
include : dispiro
widths.rhs
g4 SB (XH - SHOOK)
hookstart XO
g4 RIGHTSB (XH - smooth)
alsothru 0.5 0.5 [widths (ESS / 2) (ESS / 2)]
g4 SB (smooth) [widths STROKE 0]
hookend O
g4 RIGHTSB SHOOK
create-glyph 'cyrghe.serbian' : glyph-construction
include glyphs.dotlessi AS_BASE
include glyphs.macronAbove
italic-variant 'cyrghe' 0x433
define [CyrDeShape top] : glyph-construction
local descenderOverflow : if SLAB SIDEJUT ((RIGHTSB - SB) * 0.05)
local cutleft : if SLAB SB (SB + descenderOverflow)
local cutright : if SLAB RIGHTSB (RIGHTSB - descenderOverflow)
local topleft : mix cutleft cutright 0.15
include : HBarBottom (cutleft - descenderOverflow) (cutright + descenderOverflow) 0
include : VBarRight cutright 0 top
include : halfXStrand (topleft + STROKE * CORRECTION_HX) top (cutleft + HALFSTROKE * CORRECTION_HX) HALFSTROKE 0.1 0.75 0.5
include : VBarLeft (cutleft - descenderOverflow) (-LONGJUT + HALFSTROKE) 0
include : VBarRight (cutright + descenderOverflow) (-LONGJUT + HALFSTROKE) 0
if SLAB : then
include : dispiro
widths.rhs
flat (topleft - descenderOverflow) top
curl (cutright + descenderOverflow) top
: else
include : HBarTop topleft cutright top
create-glyph 'cyrDe' : glyph-construction
assign-unicode 0x414
include ifMarks
include : CyrDeShape CAP
create-glyph 'cyrde.upright' : glyph-construction
include eMarks
include : CyrDeShape XH
create-glyph 'cyrde.italic' : glyph-construction
include bMarks
include : dispiro
widths.lhs
flat (RIGHTSB - OX) SMALLSMOOTHA
curl (RIGHTSB - OX) (XH - SMALLSMOOTHB)
arcvh
g4 (MIDDLE - CORRECTION_OMIDS) (CAP * 0.7 - O)
archv
flat.ai (SB + OX) (XH - SMALLSMOOTHA)
curl.ai (SB + OX) SMALLSMOOTHB
arcvh
g4 (MIDDLE + CORRECTION_OMIDS) O
archv
flat (RIGHTSB - OX) SMALLSMOOTHA
curl (RIGHTSB - OX) (XH - SMALLSMOOTHB)
quadcontrols 0 0.8
g4 (SB + STROKE * 1.1) CAP
alias 'cyrde.serbian' null 'g.singlestorey'
italic-variant 'cyrde' 0x434
define [CyrZheShape top] : glyph-construction
local fine : adviceBlackness 3.3
local midx : mix SB MIDDLE 0.3
define [CyrAngleShape] : glyph-construction
local cor CORRECTION_HX
start-from (SB + O * 4) 0
line-to (SB + fine * cor + O * 4) 0
line-to (midx + fine * cor) (top / 2)
line-to (SB + fine * cor + O * 4) top
line-to (SB + O * 4) top
line-to midx (top / 2)
reverse-last
include : CyrAngleShape
include : FlipAround MIDDLE (top / 2)
include : CyrAngleShape
include : VBar MIDDLE 0 top fine
include : HBar midx (WIDTH - midx) (top / 2) fine
create-glyph 'cyrZhe' : glyph-construction
assign-unicode 0x416
include capitalMarks
include : CyrZheShape CAP
create-glyph 'cyrzhe' : glyph-construction
assign-unicode 0x436
include eMarks
include : CyrZheShape XH
define [CyrZeShape top hook] : glyph-construction
local midx : mix RIGHTSB SB 0.65
local midy : top * BARPOS
local smb : top - [mix (midy + HALFSTROKE) (top - O - STROKE) (SMOOTHA / (SMOOTHA + SMOOTHB))]
local sma : mix (STROKE + O) (midy - HALFSTROKE) (SMOOTHA / (SMOOTHA + SMOOTHB))
include : dispiro
widths.rhs
g4 SB (top - [fallback hook SHOOK])
hookstart top
g4 (RIGHTSB - OXE) (top - smb)
arcvh
flat MIDDLE (midy - HALFSTROKE)
curl midx (midy - HALFSTROKE) [heading LEFTWARD]
include : dispiro
widths.lhs
g4 SB [fallback hook SHOOK]
hookstart 0
g4 (RIGHTSB - OXE) sma
arcvh
flat MIDDLE (midy + HALFSTROKE)
curl midx (midy + HALFSTROKE) [heading LEFTWARD]
create-glyph 'cyrZe' : glyph-construction
assign-unicode 0x417
include capitalMarks
include : CyrZeShape CAP HOOK
create-glyph 'cyrze' : glyph-construction
assign-unicode 0x437
include eMarks
include : CyrZeShape XH
define [CyrElShape top] : glyph-construction
local cutleft : mix SB RIGHTSB 0.125
local cutleft2 : mix SB RIGHTSB 0.075
local cutright : mix SB RIGHTSB 0.95
include : VBarRight cutright 0 top
include : HBar cutleft cutright (top - HALFSTROKE)
include : LegShape cutleft cutleft2 [mix SB 0 [if SLAB 0.5 0.25]] top 0
if SLAB : begin
include : RightwardTopSerif cutright top SIDEJUT
include : LeftwardTopSerif cutleft top SIDEJUT
include : CenterBottomSerif (cutright - HALFSTROKE * CORRECTION_HX) 0 JUT
create-glyph 'cyrEl' : glyph-construction
assign-unicode 0x41B
include capitalMarks
include : CyrElShape CAP
create-glyph 'cyrel' : glyph-construction
assign-unicode 0x43B
include eMarks
include : CyrElShape XH
create-glyph 'cyrem' : glyph-construction
assign-unicode 0x43C
include eMarks
include : MShape XH
create-glyph 'cyren' : glyph-construction
assign-unicode 0x43D
include eMarks
include : HShape XH
define [CyrTseShape top] : glyph-construction
include : VBarLeft SB 0 top
include : HBarBottom SB RIGHTSB 0
include : VBarRight RIGHTSB 0 top
include : CyrDescender RIGHTSB 0.05
if SLAB : begin
include : AIVSerifs top
include : LeftwardBottomSerif SB 0 SIDEJUT
create-glyph 'cyrTse' : glyph-construction
assign-unicode 0x426
include capitalMarks
include : CyrTseShape CAP
create-glyph 'cyrtse.upright' : glyph-construction
include eMarks
include : CyrTseShape XH
create-glyph 'cyrtse.italic' : glyph-construction
include eMarks
include glyphs.u
eject-contour 'serifLT'
include : CyrDescender RIGHTSB 0.05
italic-variant 'cyrtse' 0x446
define [CyrCheShape top _barp] : glyph-construction
local bar : top * [fallback _barp [if SLAB 0.45 0.4]]
include : VBarRight RIGHTSB 0 top
include : dispiro
widths.lhs
flat SB top [heading DOWNWARD]
curl SB (bar + SMOOTHB - HALFSTROKE)
arcvh
flat MIDDLE (bar - HALFSTROKE)
curl (RIGHTSB - 1) (bar - HALFSTROKE) [heading RIGHTWARD]
if SLAB : begin
include : CenterTopSerif (RIGHTSB - HALFSTROKE * CORRECTION_HX) top JUT
include : CenterTopSerif (SB + HALFSTROKE * CORRECTION_HX) top JUT
include : CenterBottomSerif (RIGHTSB - HALFSTROKE * CORRECTION_HX) 0 JUT
create-glyph 'cyrChe' : glyph-construction
assign-unicode 0x427
include capitalMarks
include : CyrCheShape CAP [if SLAB nothing 0.35]
create-glyph 'cyrche' : glyph-construction
assign-unicode 0x447
include eMarks
include : CyrCheShape XH
define [CyrShaShape top] : glyph-construction
include : HBarBottom SB RIGHTSB 0
include : VBarLeft SB 0 top MVERTSTROKE
include : VBarRight RIGHTSB 0 top MVERTSTROKE
include : VBar MIDDLE 0 top MVERTSTROKE
if SLAB : begin
include : tagged 'serifLT' : LeftwardTopSerif SB top SIDEJUT
include : tagged 'serifLB' : LeftwardBottomSerif SB 0 SIDEJUT
include : tagged 'serifRT' : RightwardTopSerif RIGHTSB top SIDEJUT
include : tagged 'serifRB' : RightwardBottomSerif RIGHTSB 0 SIDEJUT
create-glyph 'cyrSha' : glyph-construction
assign-unicode 0x428
include capitalMarks
include : CyrShaShape CAP
create-glyph 'cyrsha.upright' : glyph-construction
include eMarks
include : CyrShaShape XH
turned 'cyrsha.italic' null 'm' MIDDLE (XH / 2)
italic-variant 'cyrsha' 0x448
define [CyrShchaShape top] : glyph-construction
include : CyrShaShape top
eject-contour 'serifRB'
include : CyrDescender RIGHTSB 0.05
create-glyph 'cyrShcha' : glyph-construction
assign-unicode 0x429
include capitalMarks
include : CyrShchaShape CAP
create-glyph 'cyrshcha.upright' : glyph-construction
include eMarks
include : CyrShchaShape XH
create-glyph 'cyrshcha.italic' : glyph-construction
include eMarks
include glyphs.'cyrsha.italic'
eject-contour 'serifLT'
include : CyrDescender RIGHTSB 0.05
italic-variant 'cyrshcha' 0x449
define [CyrYerShape top] : glyph-construction
local left : if SLAB ([mix SB RIGHTSB 0.35] - MVERTSTROKE / 2 * CORRECTION_HX) [mix SB RIGHTSB 0.1]
local barleft : mix 0 SB [if SLAB 0.25 0.6]
include : CyrYeriShape top left RIGHTSB [if SLAB MVERTSTROKE STROKE]
include : HBarTop barleft (STROKE * 0.1 + left) top
if SLAB : begin
include : DownwardLeftSerif barleft top VJUT MVERTSTROKE
create-glyph 'cyrYer' : glyph-construction
assign-unicode 0x42A
include capitalMarks
include : CyrYerShape CAP
create-glyph 'cyryer' : glyph-construction
assign-unicode 0x44A
include eMarks
include : CyrYerShape XH
define [CyrYeryShape top] : glyph-construction
include : CyrYeriShape top (SB + O) [mix (RIGHTSB - MVERTSTROKE * CORRECTION_HX) (MIDDLE + MVERTSTROKE / 2 * CORRECTION_HX) 0.5] MVERTSTROKE (JUT * 0.75)
include : VBarRight (RIGHTSB - O) 0 top MVERTSTROKE
if SLAB : begin
include : CenterTopSerif (RIGHTSB - O - MVERTSTROKE / 2 * CORRECTION_HX) top (JUT * 0.75)
include : CenterBottomSerif (RIGHTSB - O - MVERTSTROKE / 2 * CORRECTION_HX) 0 (JUT * 0.75)
create-glyph 'cyrYery' : glyph-construction
assign-unicode 0x42B
include capitalMarks
include : CyrYeryShape CAP
create-glyph 'cyryery' : glyph-construction
assign-unicode 0x44B
include eMarks
include : CyrYeryShape XH
create-glyph 'cyrE' : glyph-construction
assign-unicode 0x42D
include capitalMarks
include glyphs.C
include : FlipAround MIDDLE (CAP / 2)
include : HBar [mix SB RIGHTSB 0.25] RIGHTSB (CAP / 2)
create-glyph 'cyre' : glyph-construction
assign-unicode 0x44D
include eMarks
include glyphs.c
include : FlipAround MIDDLE (XH / 2)
include : HBar [mix SB RIGHTSB 0.25] RIGHTSB (XH / 2)
define [CyrYuShape top sma smb] : glyph-construction
local xm : mix (SB + O + MVERTSTROKE * CORRECTION_HX) (RIGHTSB - OX) 0.15
include : VBarLeft (SB + O) 0 top MVERTSTROKE
include : smallo top 0 xm (RIGHTSB - OX) MVERTSTROKE (sma * 0.8) (smb * 0.8)
include : HBar (SB + O + 1) xm (top / 2)
if SLAB : begin
include : CenterTopSerif (SB + O + MVERTSTROKE / 2 * CORRECTION_HX) top (JUT * 0.75)
include : CenterBottomSerif (SB + O + MVERTSTROKE / 2 * CORRECTION_HX) 0 (JUT * 0.75)
create-glyph 'cyrYu' : glyph-construction
assign-unicode 0x42E
include capitalMarks
include : CyrYuShape CAP SMOOTHA SMOOTHB
create-glyph 'cyryu' : glyph-construction
assign-unicode 0x44E
include eMarks
include : CyrYuShape XH SMALLSMOOTHA SMALLSMOOTHB
define [CyrYaShape top] : glyph-construction
local bowlTop (top * 1)
local m : if SLAB (0.5 + HALFSTROKE / CAP) PBARPOS
local bowlBottom ((top - STROKE) * m - HALFSTROKE)
local turn : mix bowlTop bowlBottom (SMOOTHA / (SMOOTHA + SMOOTHB))
local turnRadius : (bowlTop - bowlBottom) * 0.45
local barright : WIDTH - SB * 1.25
include : dispiro
widths.lhs
flat (barright - HALFSTROKE * 0.1) bowlTop [heading LEFTWARD]
curl (SB + turnRadius) bowlTop
archv
g4 (SB + O) turn
arcvh
flat (SB + turnRadius) bowlBottom
curl (barright - HALFSTROKE * 0.1) bowlBottom [heading RIGHTWARD]
include : VBarRight RIGHTSB 0 top
local left (SB + O + [if SLAB (JUT / 4) 0])
include : dispiro
widths.center
g4.up.start (left + HALFSTROKE) 0 [heading UPWARD]
quadcontrols 0 [if SLAB 0.2 0.4] 8
g4 MIDDLE ((top - STROKE) * m)
if SLAB : begin
include : RightwardTopSerif barright top SIDEJUT
include : CenterBottomSerif (barright - HALFSTROKE * CORRECTION_HX) 0 JUT
include : LeftwardBottomSerif (SB + JUT / 4) 0 (SIDEJUT + JUT / 4)
create-glyph 'cyrYa' : glyph-construction
assign-unicode 0x42F
include capitalMarks
include : CyrYaShape CAP
create-glyph 'cyrya' : glyph-construction
assign-unicode 0x44F
include eMarks
include : CyrYaShape XH
# Serbian pe and te
create-glyph 'cyrpe.upright' : glyph-construction
include eMarks
include : PiShape XH 0
create-glyph 'cyrpe.serbian' : glyph-construction
include glyphs.u AS_BASE
include glyphs.macronAbove
italic-variant 'cyrpe' 0x43f
create-glyph 'cyrte.upright' : glyph-construction
include eMarks
include : TShape XH
create-glyph 'cyrte.serbian' : glyph-construction
include glyphs.'cyrsha.italic' AS_BASE
include glyphs.macronAbove
italic-variant 'cyrte' 0x442