Added proper italic for several cyrillic characters.

This commit is contained in:
Belleve Invis 2015-07-29 06:56:01 +08:00
parent b56990b24a
commit 85890f1be1
5 changed files with 68 additions and 21 deletions

3
.gitignore vendored
View file

@ -24,6 +24,9 @@ build/Release
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules node_modules
.settings
# Special # Special
*.ttf *.ttf
*.7z *.7z

View file

@ -275,6 +275,14 @@ define customDecompositions (
."\u013C" "l\u0326" ."\u013C" "l\u0326"
."\u0122" "G\u0326" ."\u0122" "G\u0326"
."\u0123" "g\u0312" ."\u0123" "g\u0312"
# Cyrillic composite characters
."\u0498" "\u0417\u0327"
."\u0499" "\u0437\u0327"
."\u04AA" "\u0421\u0327"
."\u04AB" "\u0441\u0327"
# Spacing modifers
."\u1FED" " \u0308\u0300" ."\u1FED" " \u0308\u0300"
."\u1FEE" " \u0308\u0301" ."\u1FEE" " \u0308\u0301"
."\u1FEF" " \u0300" ."\u1FEF" " \u0300"

View file

@ -121,24 +121,51 @@ create-glyph 'cyrU' : glyph-construction {
create-glyph 'be' : glyph-construction { create-glyph 'be' : glyph-construction {
assign-unicode 0x431 assign-unicode 0x431
include bMarks include bMarks
include glyphs.o include : smallo [CAP * 0.7] 0 SB RIGHTSB
include : create-stroke include : create-stroke
:.start-from [SB + O] SMALLSMOOTHB :.start-from [SB + O] SMALLSMOOTHB
:.set-width 0 STROKE :.set-width 0 STROKE
:.line-to [SB + O] [XH - SMALLSMOOTHA] :.line-to [SB + O] [XH - SMALLSMOOTHA]
:.cubic-to [SB + O] [mix XH CAP 1.2] [mix SB RIGHTSB 0.4] [mix XH CAP 0.5] [RIGHTSB - HALFSTROKE * ITALICCOR] CAP :.cubic-to [SB + O] [mix XH CAP 1.2] [mix SB RIGHTSB 0.4] [mix XH CAP 0.5] [RIGHTSB - HALFSTROKE * ITALICCOR] CAP
} }
create-glyph 've' : glyph-construction { create-glyph 've.italic' : glyph-construction {
assign-unicode 0x432 include eMarks
local mid : mix RIGHTSB SB 0.65
include : create-stroke
:.start-from mid [XH / 2 - HALFSTROKE]
:.heads-to RIGHTWARD
:.set-width STROKE 0
:.line-to MIDDLE [XH / 2 - HALFSTROKE]
:.arc-hv-to [RIGHTSB + O] [XH - SMOOTHB * 0.87] KAPPA
:.arc-vh-to MIDDLE XO
:.heads-to LEFTWARD
:.arc-hv-to [SB + O] [XH - SMALLSMOOTHA]
:.line-to [SB + O] SMALLSMOOTHB
:.arc-vh-to MIDDLE O
:.heads-to RIGHTWARD
:.arc-hv-to [RIGHTSB - O] [SMOOTHA * 0.87]
:.arc-vh-to MIDDLE [XH / 2 + HALFSTROKE] KAPPA
:.line-to mid [XH / 2 + HALFSTROKE]
:.heads-to LEFTWARD
}
create-glyph 've.upright' : glyph-construction {
include eMarks include eMarks
include : BShape XH include : BShape XH
} }
create-glyph 'ghe' : glyph-construction { italic-variant 've' 0x432
assign-unicode 0x433 create-glyph 'ghe.upright' : glyph-construction {
include eMarks include eMarks
include : LShape XH include : LShape XH
include : FlipAround MIDDLE [XH / 2] 1 [-1] include : FlipAround MIDDLE [XH / 2] 1 [-1]
} }
create-glyph 'ghe.italic' : glyph-construction {
include eMarks
include : twoHookUpper XH [SMOOTHB * 0.87] SHOOK
include : XSHookLower 0 [RIGHTSB - OXHOOK + TAILADJX * globalTransform.yx] MIDDLE SB [SMOOTHB * 0.87] [SHOOK - TAILADJY * globalTransform.yx]
include : sStrand [SMOOTHB * 0.87] [XH - [SMOOTHB * 0.87]] 0.2 0.45
}
italic-variant 'ghe' 0x433
define [DeShape top] : glyph-construction { define [DeShape top] : glyph-construction {
local cutleft : mix SB RIGHTSB 0.2 local cutleft : mix SB RIGHTSB 0.2
local cutright : mix SB RIGHTSB 0.92 local cutright : mix SB RIGHTSB 0.92
@ -154,21 +181,30 @@ create-glyph 'De' : glyph-construction {
include ifMarks include ifMarks
include : DeShape CAP include : DeShape CAP
} }
create-glyph 'de' : glyph-construction { create-glyph 'de.upright' : glyph-construction {
assign-unicode 0x434 include eMarks
include pMarks
include : DeShape XH include : DeShape XH
} }
create-glyph 'de.italic' : glyph-construction {
include bMarks
include : smallo [CAP * 0.7] 0 SB RIGHTSB
local ymiddlea : [XH + SMALLSMOOTHA - SMALLSMOOTHB] / 2
include : create-stroke
:.start-from [RIGHTSB - O] ymiddlea
:.set-width STROKE 0
:.curve-to [RIGHTSB - O] [mix ymiddlea CAP 0.8] [SB + STROKE * 1.1] CAP
}
italic-variant 'de' 0x434
define [ZheShape top] : glyph-construction { define [ZheShape top] : glyph-construction {
local fine : adviceBlackness 3.75 local fine : adviceBlackness 3.75
local midx : mix SB MIDDLE 0.3 local midx : mix SB MIDDLE 0.3
define [AngleShape] : glyph-construction { define [AngleShape] : glyph-construction {
local cor 1 local cor 1
start-from [SB + O] 0 start-from [SB + O * 2] 0
line-to [SB + fine * cor + O] 0 line-to [SB + fine * cor + O * 2] 0
line-to [midx + fine * cor] [top / 2] line-to [midx + fine * cor] [top / 2]
line-to [SB + fine * cor + O] top line-to [SB + fine * cor + O * 2] top
line-to [SB + O] top line-to [SB + O * 2] top
line-to midx [top / 2] line-to midx [top / 2]
reverse-last reverse-last
} }
@ -315,8 +351,8 @@ create-glyph 'shcha' : glyph-construction {
include : ShchaShape XH include : ShchaShape XH
} }
define [YerShape top] : glyph-construction { define [YerShape top] : glyph-construction {
include : YeriShape top [mix SB RIGHTSB 0.2] RIGHTSB include : YeriShape top [mix SB RIGHTSB 0.1] RIGHTSB
include : HBarTop SB [STROKE * 0.1 + [mix SB RIGHTSB 0.2]] top include : HBarTop [mix 0 SB 0.6] [STROKE * 0.1 + [mix SB RIGHTSB 0.1]] top
} }
create-glyph 'Yer' : glyph-construction { create-glyph 'Yer' : glyph-construction {
assign-unicode 0x42A assign-unicode 0x42A
@ -359,9 +395,9 @@ create-glyph 'cyre' : glyph-construction {
} }
define [YuShape top sma smb] : glyph-construction { define [YuShape top sma smb] : glyph-construction {
local fine : adviceBlackness 3.5 local fine : adviceBlackness 3.5
include : VBarLeft SB 0 top fine include : VBarLeft [SB + O] 0 top fine
include : smallo top 0 [mix [SB + fine * ITALICCOR] RIGHTSB 0.2] RIGHTSB fine [sma * 0.8] [smb * 0.8] include : smallo top 0 [mix [SB + fine * ITALICCOR] RIGHTSB 0.15] RIGHTSB fine [sma * 0.8] [smb * 0.8]
include : HBar [SB + fine * 0.1] [mix [SB + fine * ITALICCOR] RIGHTSB 0.2] [top / 2] include : HBar [SB + fine * 0.1] [mix [SB + fine * ITALICCOR] RIGHTSB 0.15] [top / 2]
} }
create-glyph 'Yu' : glyph-construction { create-glyph 'Yu' : glyph-construction {
assign-unicode 0x42E assign-unicode 0x42E

View file

@ -310,8 +310,8 @@ create-glyph 'delta' : glyph-construction {
:.line-to [RIGHTSB - STROKE * ITALICCOR - O] SMALLSMOOTHA :.line-to [RIGHTSB - STROKE * ITALICCOR - O] SMALLSMOOTHA
:.arc-vh-to MIDDLE [STROKE + O] :.arc-vh-to MIDDLE [STROKE + O]
:.heads-to LEFTWARD :.heads-to LEFTWARD
:.arc-hv-to [SB + STROKE * ITALICCOR + O] SMALLSMOOTHB :.arc-hv-to [SB + STROKE * ITALICCOR] SMALLSMOOTHB
:.line-to [SB + STROKE * ITALICCOR + O] [bar - SMALLSMOOTHA] :.line-to [SB + STROKE * ITALICCOR] [bar - SMALLSMOOTHA]
:.arc-vh-to xOTLeft [bar - STROKE] :.arc-vh-to xOTLeft [bar - STROKE]
:.set-width fine 0 :.set-width fine 0
} }

View file

@ -260,7 +260,7 @@ create-glyph 'P' : glyph-construction {
include capitalMarks include capitalMarks
local bowlTop [CAP * 1] local bowlTop [CAP * 1]
local bowlBottom [CAP * 0.5 - HALFSTROKE] local bowlBottom [[CAP - STROKE] * 0.5 - HALFSTROKE]
local bkappa [COKAPPA - 0.2] local bkappa [COKAPPA - 0.2]
local turn : mix bowlTop bowlBottom 0.5 local turn : mix bowlTop bowlBottom 0.5
@ -294,7 +294,7 @@ create-glyph 'R' : glyph-construction {
:.start-from [right - HALFSTROKE] 0 :.start-from [right - HALFSTROKE] 0
:.heads-to UPWARD :.heads-to UPWARD
:.set-width HALFSTROKE HALFSTROKE :.set-width HALFSTROKE HALFSTROKE
:.curve-to [right - HALFSTROKE] [TURN + 0.2 * [XH - TURN]] MIDDLE CAPMIDDLE :.curve-to [right - HALFSTROKE] [TURN + 0.2 * [XH - TURN]] MIDDLE [[CAP - STROKE] / 2]
} }
### C G O zero Q U ### C G O zero Q U