Replaced String.prototype.normalize with library unorm.

This commit is contained in:
be5invis 2015-09-13 14:37:38 +08:00
parent 96c1551b85
commit ba2834ce5d
4 changed files with 6 additions and 4 deletions

1
.gitignore vendored
View File

@ -26,6 +26,7 @@ node_modules
.settings
.vscode
# Special
*.ttf

View File

@ -326,7 +326,7 @@ define [buildFont para recursive] : begin {
otherwise unimportant
}
return knots
}
}
define [g4 x y f] (.x x .y y .type 'g4' .af f)
define [g2 x y f] (.x x .y y .type 'g2' .af f)
define [corner x y f] (.x x .y y .type 'corner' .af f)

View File

@ -3,7 +3,7 @@
local font.features (.)
# Build accented glyphs
define unorm : require 'unorm'
define [isAboveMark mark] : mark && mark.anchors && mark.anchors.above && mark.anchors.above.type === MARK
define customDecompositions (
@ -149,7 +149,7 @@ define [decideName namingParts parts code] : begin {
foreach code [range 0x0000 0xFFFF] : if [not unicodeGlyphs`code] : begin {
local str : String.fromCharCode code
local nfd : fallback customDecompositions.(str) : str.normalize 'NFD'
local nfd : fallback customDecompositions.(str) : unorm.nfd str
if [nfd.length > 1] : begin {
local parts ()
local allFound true

View File

@ -7,6 +7,7 @@
"bezier-js" : "*",
"yargs" : "*",
"libspiro-js" : ">=0.2.1",
"toml": ">=2.3.0"
"toml": ">=2.3.0",
"unorm": ">=1.4.1"
}
}