This commit is contained in:
Daniel Imms
2021-04-02 07:58:59 -07:00
parent 54cdbb3035
commit 4fa58c978b
+4 -4
View File
@@ -3,8 +3,8 @@
* @license MIT * @license MIT
*/ */
import {FontList} from 'font-finder'; import { FontList } from 'font-finder';
import {Font, loadBuffer, loadFile} from 'font-ligatures'; import { Font, loadBuffer, loadFile } from 'font-ligatures';
import parse from './parse'; import parse from './parse';
@@ -74,9 +74,9 @@ export default async function load(fontFamily: string, cacheSize: number): Promi
if (fonts.hasOwnProperty(family) && fonts[family].length > 0) { if (fonts.hasOwnProperty(family) && fonts[family].length > 0) {
const font = fonts[family][0]; const font = fonts[family][0];
if ('blob' in font) { if ('blob' in font) {
return loadBuffer(await (await font.blob()).arrayBuffer(), {cacheSize}); return loadBuffer(await (await font.blob()).arrayBuffer(), { cacheSize });
} }
return await loadFile(font.path, {cacheSize}); return await loadFile(font.path, { cacheSize });
} }
} }