Skip to content

Commit

Permalink
Bug fix for loading font modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronyeh committed Jan 14, 2022
1 parent aefb5f5 commit 3650f3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions entry/vexflow-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ Flow.fetchMusicFont = async (fontName: string, fontModuleOrPath?: string | FontM
return;
}

if (fontName in fontModules) {
fontModuleOrPath = fontModules[fontName];
}

if (!fontModuleOrPath) {
throw new RuntimeError('UnknownFont', `Music font ${fontName} does not exist at path [${fontModuleOrPath}].`);
// Determine the font module path.
if (fontName in fontModules) {
fontModuleOrPath = fontModules[fontName];
} else {
throw new RuntimeError('UnknownFont', `Music font ${fontName} does not exist.`);
}
}

let fontModule: FontModule;
Expand Down
4 changes: 2 additions & 2 deletions src/version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const VERSION: string = '4.0.0';
export const ID: string = '116f5052a929bf70c4f84993691b8bbe67178e8a';
export const DATE: string = '2022-01-14T01:03:03.555Z';
export const ID: string = 'aefb5f5b39bf0920a20fdd788253e944fbf2176e';
export const DATE: string = '2022-01-14T01:12:41.366Z';

0 comments on commit 3650f3b

Please sign in to comment.