Change default font to Roboto Light 14

This commit is contained in:
James Babcock committed 2026-08-19 20:58:03 -07:00
1 parent eef9fbaab4
commit 695d6fb8d3
4 files changed
+31 -27

No files matched your search

-13
View File
@@ -23,7 +23,6 @@
* rasters as immutable — safe because renderGlyphCell is deterministic for a
* given (path, size, gamma), all of which are baked into the atlasKey.
*/
import { knownFolders } from "@nativescript/core";
import { allocateFontFingerprintId, type Glyph } from "./bdffont";
import { GrayImage, grayToNibble, type GlyphFont } from "./image";
import { toUint8Array } from "../util/array-util";
@@ -38,12 +37,6 @@ declare const global: any;
*/
const DEFAULT_TTF_GAMMA = 1.0;
/** Fonts bundled as app assets (paths relative to the app folder). */
const BUNDLED_FONTS = {
"inter-light": "fonts/ttf/Inter_18pt-Light.ttf",
} as const;
export type BundledTtfName = keyof typeof BUNDLED_FONTS;
const loadedFonts = new Map<string, TtfFont | null>();
export class TtfFont implements GlyphFont {
@@ -98,12 +91,6 @@ export class TtfFont implements GlyphFont {
return font;
}
/** A font bundled with the app, or null when it can't load. */
static bundled(name: BundledTtfName, sizePx: number, gamma = DEFAULT_TTF_GAMMA): TtfFont | null {
if (!global.isAndroid) return null;
return TtfFont.load(`${knownFolders.currentApp().path}/${BUNDLED_FONTS[name]}`, sizePx, gamma);
}
/**
* The codepoint's glyph (rendered and memoized on first use), or undefined
* when the render fails outright. Android renders SOMETHING for any