mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-10-01 01:26:32 +13:00
fix font crash
This commit is contained in:
parent
56ad15d8b0
commit
80512e657b
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ async function subsetFont (fontPath, glyphs, options = {}) {
|
||||||
let fontdata = Buffer.from(fontPath, 'binary')
|
let fontdata = Buffer.from(fontPath, 'binary')
|
||||||
let type = fileType(fontdata)
|
let type = fileType(fontdata)
|
||||||
if (type && type.mime === 'font/ttf') {
|
if (type && type.mime === 'font/ttf') {
|
||||||
data = fontdata
|
data = fontdata.buffer
|
||||||
} else {
|
} else {
|
||||||
if (!isNode || !options.local) {
|
if (!isNode || !options.local) {
|
||||||
data = await fetch(fontPath, 'arraybuffer')
|
data = await fetch(fontPath, 'arraybuffer')
|
||||||
|
|
Loading…
Reference in a new issue