mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
Handle not finding font file (#942)
This commit is contained in:
parent
8308cb99ee
commit
d56e688cd9
1 changed files with 4 additions and 0 deletions
|
|
@ -95,6 +95,10 @@ const parsers = {
|
|||
truetypefont: async (node, parent, zip) => {
|
||||
const { file } = node.attributes;
|
||||
const font = Utils.getCaseInsensitveFile(zip, file);
|
||||
if (!font) {
|
||||
console.warn(`Unable to find font file ${file}`);
|
||||
return new MakiObject(node, parent);
|
||||
}
|
||||
const fontBlob = await font.async("blob");
|
||||
const fontUrl = await Utils.getUrlFromBlob(fontBlob);
|
||||
const fontFamily = `font-${Utils.getId()}-${file.replace(/\./, "_")}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue