Skip to content

Commit

Permalink
Release 1.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
be5invis committed May 12, 2024
2 parents 56b471e + f91bf1f commit 66f5706
Show file tree
Hide file tree
Showing 165 changed files with 692 additions and 469 deletions.
12 changes: 12 additions & 0 deletions make/pass2/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export default (async function makeFont(argv) {
simplifySingleSub(main.gsub, "vert");
simplifySingleSub(main.gsub, "vrt2");

padCvtToAppeaseFreetype(main);

await writeFont(argv.o, main);
});

Expand Down Expand Up @@ -71,3 +73,13 @@ function isFarEastLanguage(tag) {
tag = tag.trim();
return tag === "JAN" || tag === "KOR" || tag === "ZHS" || tag === "ZHT" || tag === "ZHH";
}

// Freetype limits the "available" twilight point count to 2 * max(glyph points, cvt size).
// Thus, we pad the CVT to make sure all twilights could be properly accessed.
function padCvtToAppeaseFreetype(font) {
if (!font.cvt || !font.maxp) return;
while (2 * font.cvt.items.length < font.maxp.maxTwilightPoints) {
font.cvt.items.push(0);
font.cvt.items.push(0);
}
}
Loading

0 comments on commit 66f5706

Please sign in to comment.