Update font handling to better bundle fonts

This commit is contained in:
Idrees Hassan
2026-03-08 12:47:08 -07:00
parent 953d2cde47
commit 45743d2caf
13 changed files with 1022 additions and 846 deletions

View File

@@ -1,9 +1,12 @@
import { Context } from "./context";
export const Directions = {
LEFT: -1,
RIGHT: 1,
};
let debugMode = location.hostname === "127.0.0.1";
/** @type {Context|null} */
let context = null;
/**
@@ -20,6 +23,9 @@ export function setDebug(value) {
debugMode = value;
}
/**
* @returns {Context} The specific context for this platform
*/
export function getContext() {
if (!context) {
throw new Error("Context requested before being set");
@@ -27,6 +33,9 @@ export function getContext() {
return context;
}
/**
* @param {Context} newContext
*/
export function setContext(newContext) {
context = newContext;
}