-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
333 changed files
with
181 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"codemetrics.basics.EnabledForJS": false, | ||
"cSpell.enabled": false | ||
"cSpell.enabled": false, | ||
"search.useGlobalIgnoreFiles": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"use strict"; | ||
|
||
const createFinder = require("../common/glyph-finder"); | ||
|
||
// LGC transferring | ||
exports.unlinkRefsOfSymbols = function (font, isTerm) { | ||
const find = createFinder(font); | ||
for (let u = 0x2000; u < 0x20a0; u++) { | ||
let gn = find.gname.unicode(u); | ||
if (!gn) continue; | ||
let gnT = gn; | ||
if (!isTerm) gnT = find.gname.subst("WWID", gn); | ||
if (!gnT) continue; | ||
const g = find.glyph(gn); | ||
const g$ = find.glyph$(gnT); | ||
HCopy(g, g$); | ||
} | ||
}; | ||
|
||
exports.transferMonoGeometry = function (main, lgc) { | ||
for (let u = 0x2000; u < 0x20a0; u++) { | ||
let gnSrc = main.cmap[u], | ||
gnDst = lgc.cmap[u]; | ||
if (gnSrc && gnDst) { | ||
HCopy(main.glyf[gnSrc], lgc.glyf[gnDst]); | ||
} | ||
} | ||
}; | ||
|
||
exports.populatePwidOfMono = function (font) { | ||
const find = createFinder(font); | ||
for (let u = 0x2000; u < 0x20a0; u++) { | ||
const gn = find.gname.unicode(u); | ||
if (!gn) continue; | ||
const gnPwid = find.gname.subst("pwid", gn); | ||
if (!gnPwid) continue; | ||
const g = find.glyph(gnPwid); | ||
const g$ = find.glyph$(gn); | ||
HCopy(g, g$); | ||
} | ||
}; | ||
|
||
function HCopy(g, g1) { | ||
g.contours = g1.contours; | ||
g.references = g1.references; | ||
g.advanceWidth = g1.advanceWidth; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"use strict"; | ||
|
||
exports.removeUnusedFeatures = function (a, kind, mono) { | ||
removeUnusedFeature(a.GSUB, "aalt"); | ||
removeUnusedFeature(a.GSUB, "pwid"); | ||
removeUnusedFeature(a.GSUB, "fwid"); | ||
removeUnusedFeature(a.GSUB, "hwid"); | ||
removeUnusedFeature(a.GSUB, "twid"); | ||
removeUnusedFeature(a.GSUB, "qwid"); | ||
|
||
if (mono) { | ||
removeUnusedFeature(a.GSUB, "locl"); | ||
removeUnusedFeature(a.GPOS, "kern"); | ||
removeUnusedFeature(a.GPOS, "vkrn"); | ||
removeUnusedFeature(a.GPOS, "palt"); | ||
removeUnusedFeature(a.GPOS, "vpal"); | ||
} | ||
|
||
if (mono && kind === "WS") { | ||
removeUnusedFeature(a.GSUB, "ccmp"); | ||
} | ||
}; | ||
|
||
function removeUnusedFeature(table, tag) { | ||
if (!table) return; | ||
for (let f in table.features) { | ||
if (f.slice(0, 4) === tag) { | ||
table.features[f] = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.