MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / _detectFontDirectory

Method _detectFontDirectory

packages/alphatab/src/Environment.ts:315–329  ·  view source on GitHub ↗

* @target web

()

Source from the content-addressed store, hash-verified

313 * @target web
314 */
315 private static _detectFontDirectory(): string | null {
316 if (!Environment.isRunningInWorker && Environment.globalThis.ALPHATAB_FONT) {
317 return Environment.ensureFullUrl(Environment.globalThis.ALPHATAB_FONT);
318 }
319
320 const scriptFile = Environment.scriptFile;
321 if (scriptFile) {
322 const lastSlash: number = scriptFile.lastIndexOf(String.fromCharCode(47));
323 if (lastSlash >= 0) {
324 return `${scriptFile.substr(0, lastSlash)}/font/`;
325 }
326 }
327
328 return null;
329 }
330
331 /**
332 * @target web

Callers 1

EnvironmentClass · 0.80

Calls 2

ensureFullUrlMethod · 0.80
fromCharCodeMethod · 0.80

Tested by

no test coverage detected