Added support for greek letters (and yes, polytonic.)
This commit is contained in:
parent
f42a571158
commit
bdd386ee0a
|
@ -119,18 +119,21 @@ define [tm anchor] : return (
|
|||
.type anchor.type
|
||||
)
|
||||
|
||||
define markAboveLower (.anchors (.above [tm (.x MIDDLE .y XH .type BASE)]))
|
||||
define markAboveCap (.anchors (.above [tm (.x MIDDLE .y CAP .type BASE)]))
|
||||
define markBelowLower (.anchors (.below [tm (.x MIDDLE .y DESCENDER .type BASE)]))
|
||||
define markBelowZero (.anchors (.below [tm (.x MIDDLE .y 0 .type BASE)]))
|
||||
define markOgonekLower (.anchors (.ogonek [tm (.x MIDDLE .y DESCENDER .type BASE)]))
|
||||
define markOgonekZero (.anchors (.ogonek [tm (.x MIDDLE .y 0 .type BASE)]))
|
||||
define markAboveLower (.anchors (.above [tm (.x MIDDLE .y XH .type BASE)]))
|
||||
define markAboveCap (.anchors (.above [tm (.x MIDDLE .y CAP .type BASE)]))
|
||||
define markBelowLower (.anchors (.below [tm (.x MIDDLE .y DESCENDER .type BASE)]))
|
||||
define markBelowZero (.anchors (.below [tm (.x MIDDLE .y 0 .type BASE)]))
|
||||
define markTrailingLower (.anchors (.trailing [tm (.x MIDDLE .y DESCENDER .type BASE)]))
|
||||
define markTrailingZero (.anchors (.trailing [tm (.x MIDDLE .y 0 .type BASE)]))
|
||||
define markLFLower (.anchors (.lf [tm (.x MIDDLE .y DESCENDER .type BASE)]))
|
||||
define markLFZero (.anchors (.lf [tm (.x MIDDLE .y 0 .type BASE)]))
|
||||
|
||||
define capitalMarks (.anchors (.above markAboveCap.anchors.above .below markBelowZero.anchors.below .ogonek markOgonekZero.anchors.ogonek))
|
||||
define bMarks (.anchors (.above markAboveCap.anchors.above .below markBelowZero.anchors.below .ogonek markOgonekZero.anchors.ogonek))
|
||||
define eMarks (.anchors (.above markAboveLower.anchors.above .below markBelowZero.anchors.below .ogonek markOgonekZero.anchors.ogonek))
|
||||
define pMarks (.anchors (.above markAboveLower.anchors.above .below markBelowLower.anchors.below .ogonek markOgonekLower.anchors.ogonek))
|
||||
define ifMarks (.anchors (.above markAboveCap.anchors.above .below markBelowLower.anchors.below .ogonek markOgonekLower.anchors.ogonek))
|
||||
|
||||
define capitalMarks (.anchors (.above markAboveCap.anchors.above .below markBelowZero.anchors.below .trailing markTrailingZero.anchors.trailing .lf markLFZero.anchors.lf))
|
||||
define bMarks (.anchors (.above markAboveCap.anchors.above .below markBelowZero.anchors.below .trailing markTrailingZero.anchors.trailing .lf markLFZero.anchors.lf))
|
||||
define eMarks (.anchors (.above markAboveLower.anchors.above .below markBelowZero.anchors.below .trailing markTrailingZero.anchors.trailing .lf markLFZero.anchors.lf))
|
||||
define pMarks (.anchors (.above markAboveLower.anchors.above .below markBelowLower.anchors.below .trailing markTrailingLower.anchors.trailing .lf markLFLower.anchors.lf))
|
||||
define ifMarks (.anchors (.above markAboveCap.anchors.above .below markBelowLower.anchors.below .trailing markTrailingLower.anchors.trailing .lf markLFLower.anchors.lf))
|
||||
|
||||
Stroke.bindParameters para
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ create-glyph 'servicemark' : glyph-construction {
|
|||
|
||||
define [isAboveMark mark] : mark && mark.anchors && mark.anchors.above && mark.anchors.above.type === MARK
|
||||
|
||||
local customDecompositions (
|
||||
define customDecompositions (
|
||||
# Latvians use comma instead of cedillas in several letters.
|
||||
# Record them as custom decomposition.
|
||||
."\u0156" "R\u0326"
|
||||
|
@ -276,10 +276,16 @@ local customDecompositions (
|
|||
."\u0122" "G\u0326"
|
||||
."\u0123" "g\u0312"
|
||||
)
|
||||
define [decompositionModify s] : s.replace [regex '\u0313\u0300'] "\u1FCD"
|
||||
:.replace [regex '\u0313\u0301'] "\u1FCE"
|
||||
:.replace [regex '\u0313\u0342'] "\u1FCF"
|
||||
:.replace [regex '\u0314\u0300'] "\u1FDD"
|
||||
:.replace [regex '\u0314\u0301'] "\u1FDE"
|
||||
:.replace [regex '\u0314\u0342'] "\u1FDF"
|
||||
|
||||
foreach code [range 0x00A0 0xFFFF] : if [not unicodeGlyphs`code] : begin {
|
||||
local str : String.fromCharCode code
|
||||
local nfd : fallback customDecompositions.(str) [str.normalize 'NFD']
|
||||
local nfd : fallback customDecompositions.(str) : decompositionModify : str.normalize 'NFD'
|
||||
if [nfd.length > 1] : begin {
|
||||
local parts ()
|
||||
local allFound true
|
||||
|
|
|
@ -200,7 +200,7 @@ define [XSHookLower bottom left middle right smooth hook] : glyph-construction {
|
|||
include : create-stroke
|
||||
:.set-transform globalTransform
|
||||
:.start-from right [bottom + smooth]
|
||||
:.set-width 0 STROKE
|
||||
:.set-width [if [left < right] 0 STROKE] [if [left < right] STROKE 0]
|
||||
:.arc-vh-to middle [bottom + O]
|
||||
:.heads-to [if [left < right] LEFTWARD RIGHTWARD]
|
||||
:.curve-to [mix middle left KAPPA_HOOK] [bottom + O] [left + OXHOOK] [bottom + hook]
|
||||
|
|
|
@ -79,23 +79,27 @@ create-glyph 'Sigma' : glyph-construction {
|
|||
}
|
||||
create-glyph 'Theta' : glyph-construction {
|
||||
assign-unicode 0x398
|
||||
include capitalMarks
|
||||
include glyphs.O AS_BASE
|
||||
include : HBar [SB + STROKE - O * 5] [RIGHTSB - STROKE + O * 5] CAPMIDDLE
|
||||
}
|
||||
create-glyph 'Xi' : glyph-construction {
|
||||
assign-unicode 0x39E
|
||||
include capitalMarks
|
||||
include : HBar [mix SB RIGHTSB 0.15] [mix RIGHTSB SB 0.15] [mix 0 CAP 0.54]
|
||||
include : HBar SB RIGHTSB [CAP - HALFSTROKE]
|
||||
include : HBar SB RIGHTSB [0 + HALFSTROKE]
|
||||
}
|
||||
create-glyph 'Pi' : glyph-construction {
|
||||
assign-unicode 0x3A0
|
||||
include capitalMarks
|
||||
include : HBar SB RIGHTSB [CAP - HALFSTROKE]
|
||||
include : VBar [[mix SB RIGHTSB 0.1] + HALFSTROKE] 0 CAP
|
||||
include : VBar [[mix RIGHTSB SB 0.1] - HALFSTROKE] 0 CAP
|
||||
}
|
||||
create-glyph 'Phi' : glyph-construction {
|
||||
assign-unicode 0x3A6
|
||||
include capitalMarks
|
||||
local fine : adviceBlackness 3.5
|
||||
local y1 : CAP * 0.125
|
||||
local y2 : CAP * 0.875
|
||||
|
@ -106,6 +110,7 @@ create-glyph 'Phi' : glyph-construction {
|
|||
}
|
||||
create-glyph 'Psi' : glyph-construction {
|
||||
assign-unicode 0x3A8
|
||||
include capitalMarks
|
||||
local fine : adviceBlackness 3.5
|
||||
local y : CAP * 0.25
|
||||
include : create-stroke
|
||||
|
@ -149,31 +154,31 @@ create-glyph 'alpha' : glyph-construction {
|
|||
assign-unicode 0x3B1
|
||||
include eMarks
|
||||
|
||||
local middle : mix SB RIGHTSB 0.4
|
||||
local cx : mix SB RIGHTSB 0.6
|
||||
local middle : mix SB RIGHTSB 0.425
|
||||
local cx : mix SB RIGHTSB 0.65
|
||||
local cy : mix 0 XH 0.3
|
||||
local cx2 : mix SB RIGHTSB 0.5
|
||||
local cx2 : mix SB RIGHTSB 0.575
|
||||
local fine : adviceBlackness 3.5
|
||||
include : create-stroke
|
||||
:.start-from [RIGHTSB - fine * ITALICCOR] XH
|
||||
:.start-from [RIGHTSB - fine * ITALICCOR - O] XH
|
||||
:.heads-to DOWNWARD
|
||||
:.set-width fine 0
|
||||
:.cubic-to cx cy cx2 [O + STROKE] middle [O + STROKE]
|
||||
:.set-width STROKE 0
|
||||
:.arc-hv-to [SB + STROKE * ITALICCOR] SMALLSMOOTHB
|
||||
:.line-to [SB + STROKE * ITALICCOR] [XH - SMALLSMOOTHA]
|
||||
:.arc-hv-to [SB + STROKE * ITALICCOR + O] SMALLSMOOTHB
|
||||
:.line-to [SB + STROKE * ITALICCOR + O] [XH - SMALLSMOOTHA]
|
||||
:.arc-vh-to middle [XO - STROKE]
|
||||
:.set-width STROKE 0
|
||||
:.cubic-to cx2 [XO - STROKE] cx [XH - cy] [RIGHTSB - fine * ITALICCOR] 0
|
||||
:.cubic-to cx2 [XO - STROKE] cx [XH - cy] [RIGHTSB - fine * ITALICCOR - O] 0
|
||||
:.set-width fine 0
|
||||
:.heads-to DOWNWARD
|
||||
}
|
||||
create-glyph 'iota' : glyph-construction {
|
||||
assign-unicode 0x3B9
|
||||
include eMarks
|
||||
local middle : MIDDLE - JBALANCE
|
||||
local middle MIDDLE
|
||||
set-anchor 'above' BASE middle XH
|
||||
|
||||
include : leftwardTopSerif middle XH LONGJUT
|
||||
include : create-stroke
|
||||
:.start-from middle HOOK
|
||||
:.heads-to UPWARD
|
||||
|
@ -186,6 +191,7 @@ create-glyph 'iota' : glyph-construction {
|
|||
create-glyph 'eta' : glyph-construction {
|
||||
assign-unicode 0x3B7
|
||||
include pMarks
|
||||
set-anchor 'lf' BASE [SB + HALFSTROKE] 0
|
||||
|
||||
include : nBowl [SB + STROKE] MIDDLE RIGHTSB [STROKE * 0.3] XH DESCENDER SMALLSMOOTHA SMALLSMOOTHB
|
||||
include : VBar [SB + HALFSTROKE * ITALICCOR] 0 XH
|
||||
|
@ -228,4 +234,352 @@ create-glyph 'mu' : glyph-construction {
|
|||
:.line-to SB SMALLSMOOTHB
|
||||
:.heads-to UPWARD
|
||||
:.set-width 0 [adviceBlackness 4]
|
||||
}
|
||||
create-glyph 'theta' : glyph-construction {
|
||||
assign-unicode 0x3B8
|
||||
include bMarks
|
||||
include : smallo CAP 0 [SB - O] [RIGHTSB + O]
|
||||
include : HBar [SB + HALFSTROKE] [RIGHTSB - HALFSTROKE] CAPMIDDLE
|
||||
}
|
||||
create-glyph 'beta' : glyph-construction {
|
||||
assign-unicode 0x3B2
|
||||
include ifMarks
|
||||
local ymiddle : [mix 0 CAP 0.55] - HALFSTROKE
|
||||
include : create-stroke
|
||||
:.start-from SB DESCENDER
|
||||
:.set-width 0 STROKE
|
||||
:.line-to SB [CAP - SMALLSMOOTHA]
|
||||
:.arc-vh-to [mix SB [RIGHTSB + O * 2] 0.5] CAPO
|
||||
:.arc-hv-to [RIGHTSB + O * 2] [mix CAP ymiddle 0.5]
|
||||
:.arc-vh-to [mix SB [RIGHTSB + O * 2] 0.5] ymiddle
|
||||
:.line-to [mix SB RIGHTSB 0.3] ymiddle
|
||||
|
||||
include : create-stroke
|
||||
:.start-from [RIGHTSB - ymiddle / 2 - HALFSTROKE] [ymiddle + STROKE]
|
||||
:.set-width 0 STROKE
|
||||
:.arc-hv-to [RIGHTSB - O] [mix 0 [ymiddle + STROKE] 0.5]
|
||||
:.arc-vh-to [RIGHTSB - ymiddle / 2 - HALFSTROKE] 0
|
||||
:.line-to [SB + HALFSTROKE] 0
|
||||
:.heads-to LEFTWARD
|
||||
}
|
||||
|
||||
create-glyph 'gamma' : glyph-construction {
|
||||
assign-unicode 0x3B3
|
||||
include pMarks
|
||||
local x0 : mix MIDDLE SB 0.33
|
||||
local y0 : mix 0 XH 0.8
|
||||
local y1 : mix 0 XH 0.3
|
||||
local y2 0
|
||||
local xmid : [mix SB RIGHTSB 0.46] + HALFSTROKE
|
||||
include : create-stroke
|
||||
:.start-from [SB + 0.4 * STROKE * ITALICCOR] XH
|
||||
:.set-width 0 STROKE
|
||||
:.cubic-to x0 y0 xmid y1 xmid y2
|
||||
:.heads-to DOWNWARD
|
||||
:.line-to xmid DESCENDER
|
||||
:.heads-to DOWNWARD
|
||||
|
||||
local turn : mix 0 XH 0.9
|
||||
include : create-stroke
|
||||
:.start-from RIGHTSB XH
|
||||
:.heads-to DOWNWARD
|
||||
:.set-width 0 STROKE
|
||||
:.line-to RIGHTSB turn
|
||||
:.heads-to DOWNWARD
|
||||
:.curve-to RIGHTSB [[1 - 0.27] * turn] xmid y2
|
||||
}
|
||||
|
||||
create-glyph 'delta' : glyph-construction {
|
||||
assign-unicode 0x3B4
|
||||
include bMarks
|
||||
|
||||
local xNeck : mix SB RIGHTSB 0.05
|
||||
local bar : mix 0 XH 0.96
|
||||
local xOTLeft : mix SB RIGHTSB 0.5
|
||||
local fine : STROKE * 0.5
|
||||
|
||||
include : create-stroke
|
||||
:.start-from [mix MIDDLE RIGHTSB 0.85] [mix XH CAP 0.8]
|
||||
:.heads-to LEFTWARD
|
||||
:.set-width STROKE 0
|
||||
:.curve-to [mix MIDDLE RIGHTSB 0.66] CAPO MIDDLE CAPO
|
||||
:.arc-hv-to xNeck [mix CAPO [bar - STROKE] 0.5]
|
||||
:.arc-vh-to xOTLeft [bar - STROKE]
|
||||
:.heads-to RIGHTWARD
|
||||
:.arc-hv-to [RIGHTSB - STROKE * ITALICCOR - O] [bar - SMALLSMOOTHB]
|
||||
:.line-to [RIGHTSB - STROKE * ITALICCOR - O] SMALLSMOOTHA
|
||||
:.arc-vh-to MIDDLE [STROKE + O]
|
||||
:.heads-to LEFTWARD
|
||||
:.arc-hv-to [SB + STROKE * ITALICCOR + O] SMALLSMOOTHB
|
||||
:.line-to [SB + STROKE * ITALICCOR + O] [bar - SMALLSMOOTHA]
|
||||
:.arc-vh-to xOTLeft [bar - STROKE]
|
||||
:.set-width fine 0
|
||||
}
|
||||
|
||||
create-glyph 'epsilon' : glyph-construction {
|
||||
assign-unicode 0x3B5
|
||||
include eMarks
|
||||
|
||||
local mid : mix SB RIGHTSB 0.65
|
||||
include : sHookUpper XH [SMOOTHA * 0.87] SHOOK
|
||||
include : XSHookLower 0 [RIGHTSB - OXHOOK + TAILADJX * globalTransform.yx] MIDDLE SB [SMOOTHB * 0.87] [SHOOK - TAILADJY * globalTransform.yx]
|
||||
include : create-stroke
|
||||
:.start-from SB [XH - SMOOTHA * 0.87]
|
||||
:.set-width STROKE 0
|
||||
:.arc-vh-to MIDDLE [XH / 2 - HALFSTROKE] KAPPA
|
||||
:.line-to mid [XH / 2 - HALFSTROKE]
|
||||
:.heads-to RIGHTWARD
|
||||
include : create-stroke
|
||||
:.start-from SB [SMOOTHB * 0.87]
|
||||
:.set-width 0 STROKE
|
||||
:.arc-vh-to MIDDLE [XH / 2 + HALFSTROKE] KAPPA
|
||||
:.line-to mid [XH / 2 + HALFSTROKE]
|
||||
:.heads-to RIGHTWARD
|
||||
}
|
||||
create-glyph 'zeta' : glyph-construction {
|
||||
assign-unicode 0x3B6
|
||||
include ifMarks
|
||||
include : HBar SB [RIGHTSB + O] [CAP - HALFSTROKE]
|
||||
include : create-stroke
|
||||
:.start-from [RIGHTSB + O] [CAP - STROKE]
|
||||
:.set-width 0 STROKE
|
||||
:.cubic-to [mix SB RIGHTSB 0.3] [mix 0 CAP 0.66] [SB + STROKE * ITALICCOR] [mix 0 CAP 0.4] [SB + STROKE * ITALICCOR] [mix 0 CAP 0.25]
|
||||
:.arc-vh-to [mix SB RIGHTSB 0.5] STROKE
|
||||
:.arc-hv-to RIGHTSB [mix DESCENDER STROKE 0.5]
|
||||
:.arc-vh-to [RIGHTSB - [STROKE - [mix DESCENDER STROKE 0.5]] * 1.1] DESCENDER
|
||||
:.line-to [mix SB RIGHTSB 0.5] DESCENDER
|
||||
:.heads-to LEFTWARD
|
||||
}
|
||||
create-glyph 'xi' : glyph-construction {
|
||||
assign-unicode 0x3BE
|
||||
include ifMarks
|
||||
include : HBar SB [RIGHTSB + O] [CAP - HALFSTROKE]
|
||||
|
||||
local xbar : mix SB RIGHTSB 0.925
|
||||
local ybar : mix 0 CAP 0.55
|
||||
include : create-stroke
|
||||
:.start-from xbar [CAP - STROKE]
|
||||
:.set-width 0 STROKE
|
||||
:.arc-hv-to [SB - O * 2 + STROKE * ITALICCOR] [mix [CAP - STROKE] ybar 0.6]
|
||||
:.arc-vh-to xbar ybar
|
||||
include : create-stroke
|
||||
:.start-from xbar [ybar - STROKE]
|
||||
:.set-width 0 STROKE
|
||||
:.cubic-to [mix SB RIGHTSB 0.3] [ybar - STROKE] [SB + STROKE * ITALICCOR] [mix 0 ybar 0.65] [SB + STROKE * ITALICCOR] [mix 0 ybar 0.45]
|
||||
:.arc-vh-to [mix SB RIGHTSB 0.5] STROKE
|
||||
:.arc-hv-to RIGHTSB [mix DESCENDER STROKE 0.5]
|
||||
:.arc-vh-to [RIGHTSB - [STROKE - [mix DESCENDER STROKE 0.5]] * 1.1] DESCENDER
|
||||
:.line-to [mix SB RIGHTSB 0.5] DESCENDER
|
||||
:.heads-to LEFTWARD
|
||||
}
|
||||
create-glyph 'nu' : glyph-construction {
|
||||
assign-unicode 0x3BD
|
||||
include eMarks
|
||||
|
||||
local x0 : mix MIDDLE SB 0.33
|
||||
local y0 : mix 0 XH 0.8
|
||||
local y1 : mix 0 XH 0.16
|
||||
local y2 0
|
||||
local xmid : MIDDLE + HALFSTROKE
|
||||
include : create-stroke
|
||||
:.start-from [SB + 0.4 * STROKE * ITALICCOR] XH
|
||||
:.set-width 0 STROKE
|
||||
:.cubic-to x0 y0 xmid y1 xmid y2
|
||||
:.heads-to DOWNWARD
|
||||
|
||||
local turn : mix 0 XH 0.9
|
||||
include : create-stroke
|
||||
:.start-from RIGHTSB XH
|
||||
:.heads-to DOWNWARD
|
||||
:.set-width 0 STROKE
|
||||
:.line-to RIGHTSB turn
|
||||
:.heads-to DOWNWARD
|
||||
:.curve-to RIGHTSB [[1 - 0.27] * turn] xmid y2
|
||||
}
|
||||
create-glyph 'sigmafinal' : glyph-construction {
|
||||
assign-unicode 0x3C2
|
||||
include pMarks
|
||||
include : XSHookUpper XH [SB + O] MIDDLE RIGHTSB SMALLSMOOTHA SHOOK
|
||||
include : create-stroke
|
||||
:.start-from [SB + O + STROKE * ITALICCOR] [XH - SMALLSMOOTHA]
|
||||
:.set-width 0 STROKE
|
||||
:.line-to [SB + O + STROKE * ITALICCOR] SMALLSMOOTHB
|
||||
:.arc-vh-to [mix SB RIGHTSB 0.5] STROKE
|
||||
:.arc-hv-to RIGHTSB [mix DESCENDER STROKE 0.5]
|
||||
:.arc-vh-to [RIGHTSB - [STROKE - [mix DESCENDER STROKE 0.5]] * 1.1] DESCENDER
|
||||
:.line-to [mix SB RIGHTSB 0.5] DESCENDER
|
||||
:.heads-to LEFTWARD
|
||||
}
|
||||
create-glyph 'upsilon' : glyph-construction {
|
||||
assign-unicode 0x3C5
|
||||
include eMarks
|
||||
local x0 : [mix SB RIGHTSB 0.1] + STROKE
|
||||
local y0 : XH - STROKE * 0.2 + TAILADJY * globalTransform.yx
|
||||
local y1 : mix 0 XH 0.75
|
||||
local x1 : SB + STROKE * ITALICCOR + O
|
||||
local y3 : XH * 0.45
|
||||
include : create-stroke
|
||||
:.start-from [WIDTH - x0] y0
|
||||
:.set-width STROKE 0
|
||||
:.curve-to [WIDTH - x1] y1 [WIDTH - x1] [XH / 2]
|
||||
:.arc-vh-to [mix [WIDTH - x1] [SB + STROKE] 0.5] [STROKE + O]
|
||||
:.arc-hv-to [SB + STROKE] y3
|
||||
:.line-to [SB + STROKE] XH
|
||||
:.heads-to UPWARD
|
||||
}
|
||||
create-glyph 'pi' : glyph-construction {
|
||||
assign-unicode 0x3C0
|
||||
include eMarks
|
||||
include : HBar SB RIGHTSB [XH - HALFSTROKE]
|
||||
include : VBar [[mix SB RIGHTSB 0.1] + HALFSTROKE] 0 XH
|
||||
include : VBar [[mix RIGHTSB SB 0.1] - HALFSTROKE] 0 XH
|
||||
}
|
||||
create-glyph 'tau' : glyph-construction {
|
||||
assign-unicode 0x3C4
|
||||
include eMarks
|
||||
include : HBar SB RIGHTSB [XH - HALFSTROKE]
|
||||
include : VBar MIDDLE 0 XH
|
||||
}
|
||||
create-glyph 'rho' : glyph-construction {
|
||||
assign-unicode 0x3C1
|
||||
include pMarks
|
||||
include glyphs.o
|
||||
include : VBar [SB + HALFSTROKE * ITALICCOR + O] DESCENDER SMALLSMOOTHB
|
||||
}
|
||||
create-glyph 'sigma' : glyph-construction {
|
||||
assign-unicode 0x3C3
|
||||
include eMarks
|
||||
start-from [RIGHTSB + 0.25 * SB] XH
|
||||
line-to [RIGHTSB + 0.25 * SB] [XH - STROKE]
|
||||
line-to MIDDLE [XH - STROKE - O]
|
||||
line-to MIDDLE [XH - O]
|
||||
include : create-stroke
|
||||
:.start-from MIDDLE [XH - STROKE - O]
|
||||
:.heads-to LEFTWARD
|
||||
:.set-width 0 STROKE
|
||||
:.arc-hv-to [SB + STROKE * ITALICCOR + O] [XH - SMALLSMOOTHA]
|
||||
:.line-to [SB + STROKE * ITALICCOR + O] SMALLSMOOTHB
|
||||
:.arc-vh-to MIDDLE [STROKE + O]
|
||||
:.heads-to RIGHTWARD
|
||||
:.arc-hv-to [RIGHTSB - STROKE * ITALICCOR + O] SMALLSMOOTHA
|
||||
:.line-to [RIGHTSB - STROKE * ITALICCOR + O] [XH - SMALLSMOOTHB]
|
||||
:.arc-vh-to MIDDLE [XH - STROKE - O]
|
||||
:.set-width 0 [STROKE * 0.5]
|
||||
}
|
||||
create-glyph 'omega' : glyph-construction {
|
||||
assign-unicode 0x3C9
|
||||
include eMarks
|
||||
local fine : adviceBlackness 3.5
|
||||
local x0 : [mix SB RIGHTSB 0.1] + fine
|
||||
local y0 : XH - STROKE * 0.2
|
||||
local y1 : mix 0 XH 0.75
|
||||
local x1 : SB + fine * ITALICCOR + O
|
||||
local y3 : XH / 2
|
||||
local y4 : XH * 0.65
|
||||
|
||||
include : create-stroke
|
||||
:.start-from x0 y0
|
||||
:.set-width 0 fine
|
||||
:.curve-to x1 y1 x1 [XH / 2]
|
||||
:.arc-vh-to [mix x1 [MIDDLE - fine / 2] 0.5] [fine + O]
|
||||
:.arc-hv-to [MIDDLE - fine / 2] y3
|
||||
:.line-to [MIDDLE - fine / 2] y4
|
||||
:.heads-to UPWARD
|
||||
|
||||
include : create-stroke
|
||||
:.start-from [WIDTH - x0] [y0 + TAILADJY * globalTransform.yx]
|
||||
:.set-width fine 0
|
||||
:.curve-to [WIDTH - x1] y1 [WIDTH - x1] [XH / 2]
|
||||
:.arc-vh-to [mix [WIDTH - x1] [MIDDLE + fine / 2] 0.5] [fine + O]
|
||||
:.arc-hv-to [MIDDLE + fine / 2] y3
|
||||
:.line-to [MIDDLE + fine / 2] y4
|
||||
:.heads-to UPWARD
|
||||
}
|
||||
|
||||
create-glyph 'phi' : glyph-construction {
|
||||
assign-unicode 0x3C6
|
||||
include ifMarks
|
||||
local fine : adviceBlackness 3.5
|
||||
local y1 0
|
||||
local y2 XH
|
||||
include : VBar MIDDLE DESCENDER [y1 + HALFSTROKE]
|
||||
include : smallo y2 y1 SB RIGHTSB fine
|
||||
include : VBar MIDDLE y1 y2 fine
|
||||
include : VBar MIDDLE [y2 - HALFSTROKE] CAP
|
||||
}
|
||||
|
||||
create-glyph 'psi' : glyph-construction {
|
||||
assign-unicode 0x3C8
|
||||
include ifMarks
|
||||
local fine : adviceBlackness 3.5
|
||||
include : create-stroke
|
||||
:.start-from SB XH
|
||||
:.heads-to DOWNWARD
|
||||
:.set-width fine 0
|
||||
:.line-to SB SMALLSMOOTHB
|
||||
:.arc-vh-to MIDDLE O
|
||||
:.heads-to RIGHTWARD
|
||||
:.arc-hv-to RIGHTSB SMALLSMOOTHA
|
||||
:.line-to RIGHTSB XH
|
||||
:.heads-to UPWARD
|
||||
include : VBar MIDDLE 0 CAP fine
|
||||
include : VBar MIDDLE DESCENDER HALFSTROKE
|
||||
}
|
||||
create-glyph 'chi' : glyph-construction {
|
||||
set-width WIDTH
|
||||
assign-unicode 0x3C7
|
||||
include pMarks
|
||||
|
||||
include : xStrand SB DESCENDER RIGHTSB XH 0.05 0.4 0.1
|
||||
include : xStrand SB XH RIGHTSB DESCENDER 0.05 0.4 0.1
|
||||
}
|
||||
|
||||
### Polytonic symbols
|
||||
define [GreekLRDoubleMark id unicode leftGlyph rightGlyph] : create-glyph id : glyph-construction {
|
||||
assign-unicode unicode
|
||||
local k : -WIDTH * 0.15
|
||||
|
||||
include leftGlyph
|
||||
apply-transform : Translate [2 * k] 0
|
||||
include rightGlyph
|
||||
apply-transform : Translate [WIDTH - k] 0
|
||||
|
||||
set-anchor 'above' MARK MIDDLE XH MIDDLE aboveMarkTop
|
||||
}
|
||||
GreekLRDoubleMark 'psilivaria' 0x1FCD glyphs.closeApostropheAbove glyphs.variaAbove
|
||||
GreekLRDoubleMark 'psilioxia' 0x1FCE glyphs.closeApostropheAbove glyphs.oxiaAbove
|
||||
GreekLRDoubleMark 'dasiavaria' 0x1FDD glyphs.invCommaAbove glyphs.variaAbove
|
||||
GreekLRDoubleMark 'dasiaoxia' 0x1FDE glyphs.invCommaAbove glyphs.oxiaAbove
|
||||
|
||||
create-glyph 'psiliperispomeni' : glyph-construction {
|
||||
assign-unicode 0x1FCF
|
||||
include glyphs.closeApostropheAbove
|
||||
local yc : XH + ACCENT + DOTRADIUS * 0.25
|
||||
local radius : markHalfStroke * 2.25
|
||||
include : create-stroke
|
||||
:.start-from [markMiddle - radius] yc
|
||||
:.heads-to UPWARD
|
||||
:.set-width [markFine * 2] 0
|
||||
:.arc-vh-to markMiddle [yc + radius]
|
||||
:.arc-hv-to [markMiddle + radius] yc
|
||||
:.heads-to DOWNWARD
|
||||
|
||||
apply-transform : Translate WIDTH 0
|
||||
set-anchor 'above' MARK MIDDLE XH MIDDLE aboveMarkTop
|
||||
}
|
||||
create-glyph 'dasiaperispomeni' : glyph-construction {
|
||||
assign-unicode 0x1FDF
|
||||
include glyphs.invCommaAbove
|
||||
local yc : XH + ACCENT + DOTRADIUS * 0.25
|
||||
local radius : markHalfStroke * 2.25
|
||||
include : create-stroke
|
||||
:.start-from [markMiddle - radius] yc
|
||||
:.heads-to UPWARD
|
||||
:.set-width [markFine * 2] 0
|
||||
:.arc-vh-to markMiddle [yc + radius]
|
||||
:.arc-hv-to [markMiddle + radius] yc
|
||||
:.heads-to DOWNWARD
|
||||
|
||||
apply-transform : Translate WIDTH 0
|
||||
set-anchor 'above' MARK MIDDLE XH MIDDLE aboveMarkTop
|
||||
}
|
|
@ -5,7 +5,7 @@ create-glyph 'A' : glyph-construction {
|
|||
set-width WIDTH
|
||||
assign-unicode 'A'
|
||||
include capitalMarks
|
||||
set-anchor 'ogonek' BASE [RIGHTSB - markHalfStroke] 0
|
||||
set-anchor 'trailing' BASE [RIGHTSB - markHalfStroke] 0
|
||||
local TURN [XH * 0.1]
|
||||
|
||||
include : create-stroke
|
||||
|
|
|
@ -255,6 +255,8 @@ create-glyph 't' : glyph-construction {
|
|||
create-glyph 'a.upright' : glyph-construction {
|
||||
set-width WIDTH
|
||||
dont-export
|
||||
include eMarks
|
||||
set-anchor 'trailing' BASE [RIGHTSB - markHalfStroke] 0
|
||||
local bartop [XH * BARPOS + STROKE]
|
||||
local lowmiddle : mix SB [RIGHTSB - STROKE] [linreg 80 0.55 120 0.625 STROKE]
|
||||
local barsmooth : mix SB RIGHTSB 0.6
|
||||
|
@ -285,6 +287,8 @@ create-glyph 'a.upright' : glyph-construction {
|
|||
create-glyph 'a.italic' : glyph-construction {
|
||||
set-width WIDTH
|
||||
dont-export
|
||||
include eMarks
|
||||
set-anchor 'trailing' BASE [RIGHTSB - markHalfStroke] 0
|
||||
include : oRight
|
||||
include : create-stroke
|
||||
:.start-from RIGHTSB 0
|
||||
|
@ -297,19 +301,17 @@ create-glyph 'a.italic' : glyph-construction {
|
|||
create-glyph 'a' : glyph-construction {
|
||||
set-width WIDTH
|
||||
assign-unicode 'a'
|
||||
include eMarks
|
||||
set-anchor 'ogonek' BASE [RIGHTSB - markHalfStroke] 0
|
||||
|
||||
if [para.italicangle > 0] {
|
||||
then : include glyphs.'a.italic'
|
||||
else : include glyphs.'a.upright'
|
||||
then : include glyphs.'a.italic' AS_BASE
|
||||
else : include glyphs.'a.upright' AS_BASE
|
||||
}
|
||||
}
|
||||
create-glyph 'u' : glyph-construction {
|
||||
set-width WIDTH
|
||||
assign-unicode 'u'
|
||||
include eMarks
|
||||
set-anchor 'ogonek' BASE [RIGHTSB - markHalfStroke] 0
|
||||
set-anchor 'trailing' BASE [RIGHTSB - markHalfStroke] 0
|
||||
include : create-stroke
|
||||
:.start-from SB XH
|
||||
:.heads-to DOWNWARD
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
### Combining marks
|
||||
|
||||
local markExtend [ACCENTX * 0.5]
|
||||
local markStress : 0.5 * [adviceBlackness 3.5]
|
||||
local markStress : 0.5 * [adviceBlackness 3.25]
|
||||
local markFine : markStress * 0.8
|
||||
local markHalfStroke : mix markFine markStress 0.5
|
||||
local markMiddle [-MIDDLE]
|
||||
|
@ -255,14 +255,14 @@ create-glyph 'closeApostropheAbove' : glyph-construction {
|
|||
:.set-width 0 [markFine * 1.75]
|
||||
:.curve-to [markMiddle + radius] [mix [XH + ACCENT] [aboveMarkBot - radius] 0.75] [mix markMiddle [markMiddle - radius] 0.2] [aboveMarkBot - radius]
|
||||
apply-transform : Upright
|
||||
apply-transform : Translate 0 [DOTRADIUS * 0.75]
|
||||
apply-transform : Translate 0 [DOTRADIUS * 0.25]
|
||||
apply-transform : Italify
|
||||
}
|
||||
create-glyph 'openApostropheAbove' : glyph-construction {
|
||||
set-width 0
|
||||
assign-unicode 0x312
|
||||
include glyphs.closeApostropheAbove
|
||||
include : FlipAround markMiddle [XH + ACCENT]
|
||||
include : FlipAround markMiddle [XH + ACCENT - DOTRADIUS * 0.25]
|
||||
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
|
||||
}
|
||||
create-glyph 'invCommaAbove' : glyph-construction {
|
||||
|
@ -278,16 +278,40 @@ create-glyph 'invCommaAbove' : glyph-construction {
|
|||
:.set-width [markFine * 1.75] 0
|
||||
:.curve-to [markMiddle - radius] [mix [XH + ACCENT] [aboveMarkBot - radius] 0.75] [mix markMiddle [markMiddle + radius] 0.2] [aboveMarkBot - radius]
|
||||
apply-transform : Upright
|
||||
apply-transform : Translate 0 [DOTRADIUS * 0.75]
|
||||
apply-transform : Translate 0 [DOTRADIUS * 0.25]
|
||||
apply-transform : Italify
|
||||
}
|
||||
create-glyph 'greekTwistAbove' : glyph-construction {
|
||||
create-glyph 'perispomeniAbove' : glyph-construction {
|
||||
set-width 0
|
||||
assign-unicode 0x342
|
||||
include glyphs.archAbove
|
||||
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
|
||||
}
|
||||
|
||||
# Variant above marks
|
||||
create-glyph 'variaAbove' : glyph-construction {
|
||||
set-width 0
|
||||
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
|
||||
|
||||
include : create-stroke
|
||||
:.start-from [markMiddle + markStress] [aboveMarkBot - markFine * 0.5]
|
||||
:.set-width markFine markFine
|
||||
:.line-to [markMiddle - markExtend * 0.5] [aboveMarkTop + markStress * 0.25]
|
||||
:.set-width markStress markStress
|
||||
:.set-samples 1
|
||||
}
|
||||
create-glyph 'oxiaAbove' : glyph-construction {
|
||||
set-width 0
|
||||
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
|
||||
|
||||
include : create-stroke
|
||||
:.start-from [markMiddle - markStress] [aboveMarkBot - markFine * 0.5]
|
||||
:.set-width markFine markFine
|
||||
:.line-to [markMiddle + markExtend * 0.5] [aboveMarkTop + markStress * 0.25]
|
||||
:.set-width markStress markStress
|
||||
:.set-samples 1
|
||||
}
|
||||
|
||||
### Below marks
|
||||
create-glyph 'cedillaBelow' : glyph-construction {
|
||||
set-width 0
|
||||
|
@ -322,7 +346,7 @@ create-glyph 'ogonekBelow' : glyph-construction {
|
|||
local ogonekBot : [mix belowMarkTop belowMarkBot 0.75] + markStress * 2
|
||||
local ogonekLeft : markMiddle - markExtend * 0.2
|
||||
local ogonekRight : markMiddle + markExtend * 0.85
|
||||
set-anchor 'ogonek' MARK markMiddle 0 ogonekRight ogonekBot
|
||||
set-anchor 'trailing' MARK markMiddle 0 ogonekRight ogonekBot
|
||||
|
||||
include : create-stroke
|
||||
:.start-from markMiddle 0
|
||||
|
@ -334,7 +358,14 @@ create-glyph 'ogonekBelow' : glyph-construction {
|
|||
:.line-to ogonekRight ogonekBot
|
||||
:.heads-to RIGHTWARD
|
||||
}
|
||||
create-glyph 'iotaBelow' : glyph-construction {
|
||||
set-width 0
|
||||
assign-unicode 0x345
|
||||
|
||||
set-anchor 'lf' MARK markMiddle 0 markMiddle belowMarkBot
|
||||
|
||||
include : VBar markMiddle belowMarkBot belowMarkTop [markHalfStroke * 2]
|
||||
}
|
||||
# Flipped below marks
|
||||
create-glyph 'dotBelow' : glyph-construction {
|
||||
set-width 0
|
||||
|
|
|
@ -374,9 +374,9 @@ create-glyph 'quotesingle' : glyph-construction {
|
|||
include : create-stroke
|
||||
:.start-from MIDDLE CAP
|
||||
:.heads-to DOWNWARD
|
||||
:.set-width [HALFSTROKE * 1.2] [HALFSTROKE * 1.2]
|
||||
:.line-to MIDDLE [XH * 0.85]
|
||||
:.set-width HALFSTROKE HALFSTROKE
|
||||
:.line-to MIDDLE [XH - HALFSTROKE]
|
||||
:.set-width [STROKE * 0.4] [STROKE * 0.4]
|
||||
:.heads-to DOWNWARD
|
||||
}
|
||||
|
||||
|
@ -387,16 +387,16 @@ create-glyph 'quotedouble' : glyph-construction {
|
|||
include : create-stroke
|
||||
:.start-from [mix SB RIGHTSB 0.25] CAP
|
||||
:.heads-to DOWNWARD
|
||||
:.set-width [HALFSTROKE * 1.2] [HALFSTROKE * 1.2]
|
||||
:.line-to [mix SB RIGHTSB 0.25] [XH * 0.85]
|
||||
:.set-width HALFSTROKE HALFSTROKE
|
||||
:.line-to [mix SB RIGHTSB 0.25] [XH - HALFSTROKE]
|
||||
:.set-width [STROKE * 0.4] [STROKE * 0.4]
|
||||
:.heads-to DOWNWARD
|
||||
|
||||
include : create-stroke
|
||||
:.start-from [mix SB RIGHTSB 0.75] CAP
|
||||
:.heads-to DOWNWARD
|
||||
:.set-width HALFSTROKE HALFSTROKE
|
||||
:.line-to [mix SB RIGHTSB 0.75] [XH - HALFSTROKE]
|
||||
:.set-width [HALFSTROKE * 1.2] [HALFSTROKE * 1.2]
|
||||
:.line-to [mix SB RIGHTSB 0.75] [XH * 0.85]
|
||||
:.set-width [STROKE * 0.4] [STROKE * 0.4]
|
||||
:.heads-to DOWNWARD
|
||||
}
|
||||
|
|
|
@ -79,14 +79,16 @@ define [Stroke.prototype.cubic-to x1 y1 x2 y2 x y] : begin {
|
|||
this.points.push [tp this.gizmo (.x x1 .y y1 .onCurve false .cubic true)] [tp this.gizmo (.x x2 .y y2 .onCurve false .cubic true)] [tp this.gizmo (.x x .y y .onCurve true)]
|
||||
return this
|
||||
}
|
||||
define [Stroke.prototype.arc-vh-to x y] : begin {
|
||||
define [Stroke.prototype.arc-vh-to x y _kappa] : begin {
|
||||
local kappa : fallback _kappa BKAPPA
|
||||
local last :utp this.gizmo this.points`[this.points.length - 1]
|
||||
this.cubic-to last.x [last.y + BKAPPA * [y - last.y]] [x + BKAPPA * [last.x - x]] y x y
|
||||
this.cubic-to last.x [last.y + kappa * [y - last.y]] [x + kappa * [last.x - x]] y x y
|
||||
return this
|
||||
}
|
||||
define [Stroke.prototype.arc-hv-to x y] : begin {
|
||||
define [Stroke.prototype.arc-hv-to x y _kappa] : begin {
|
||||
local kappa : fallback _kappa BKAPPA
|
||||
local last :utp this.gizmo this.points`[this.points.length - 1]
|
||||
this.cubic-to [last.x + BKAPPA * [x - last.x]] last.y x [y + BKAPPA * [last.y - y]] x y
|
||||
this.cubic-to [last.x + kappa * [x - last.x]] last.y x [y + kappa * [last.y - y]] x y
|
||||
return this
|
||||
}
|
||||
define [Stroke.prototype.set-samples samples] : begin {
|
||||
|
|
Loading…
Reference in New Issue
Block a user