Minor optimization of references -- now spaces will not be referenced.

This commit is contained in:
be5invis 2024-02-19 17:59:01 -08:00
parent 6459be6f68
commit 2a9be6e815
6 changed files with 56 additions and 49 deletions

View file

@ -3,6 +3,15 @@ import { Nwid, Wwid } from "@iosevka/glyph/relation";
import { gcFont } from "./gc.mjs";
import { finalizeGlyphs } from "./glyphs.mjs";
export function finalizeFont(cache, para, glyphStore, excludedCodePoints, restFont) {
assignGrAndCodeRank(glyphStore, Wwid, Nwid);
assignSubRank(glyphStore);
glyphStore = gcFont(glyphStore, excludedCodePoints, restFont);
glyphStore = finalizeGlyphs(cache, para, glyphStore);
validateMonospace(para, glyphStore);
return glyphStore;
}
function assignGrAndCodeRank(glyphStore, ...flatteners) {
for (const g of glyphStore.glyphs()) {
g.codeRank = 0xffffffff;
@ -32,11 +41,3 @@ function validateMonospace(para, glyphStore) {
throw new Error("Unreachable! Building monospace with more than 2 character widths");
}
}
export function finalizeFont(cache, para, glyphStore, excludedCodePoints, restFont) {
assignGrAndCodeRank(glyphStore, Nwid, Wwid);
assignSubRank(glyphStore);
glyphStore = gcFont(glyphStore, excludedCodePoints, restFont);
glyphStore = finalizeGlyphs(cache, para, glyphStore);
validateMonospace(para, glyphStore);
return glyphStore;
}