forked from akai/readest
feat(font): support loading custom font if embedded fonts in EPUBs are missing (#3439)
This commit is contained in:
@@ -358,3 +358,19 @@ export const parseFontInfo = (fontData: ArrayBuffer, filename: string) => {
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export const isFontType = (mimeType: string) => {
|
||||
const fontMimeTypes = [
|
||||
'font/woff',
|
||||
'font/woff2',
|
||||
'font/ttf',
|
||||
'font/otf',
|
||||
'application/font-woff',
|
||||
'application/font-woff2',
|
||||
'application/x-font-woff',
|
||||
'application/x-font-woff2',
|
||||
'application/x-font-ttf',
|
||||
'application/x-font-otf',
|
||||
];
|
||||
return fontMimeTypes.includes(mimeType);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user