From cbb9163fec16d880ea74ccb5321cd03dab898e55 Mon Sep 17 00:00:00 2001 From: btpf Date: Sat, 4 Nov 2023 22:56:01 -0400 Subject: [PATCH] Fixed FontFace Load Error Fixed incorrect usage of FontFace causing error screen when books load. --- .../Reader/SettingsBar/FontsContainerV2/FontsContainer.tsx | 2 +- src/routes/Settings/pages/Fonts/Fonts.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/Reader/SettingsBar/FontsContainerV2/FontsContainer.tsx b/src/routes/Reader/SettingsBar/FontsContainerV2/FontsContainer.tsx index f29161d..9447392 100644 --- a/src/routes/Reader/SettingsBar/FontsContainerV2/FontsContainer.tsx +++ b/src/routes/Reader/SettingsBar/FontsContainerV2/FontsContainer.tsx @@ -41,7 +41,7 @@ const FontsContainer = ()=>{ } // this means if the name has an extension like .ttf const fontName = item.replaceAll(" ", "_") - const font = new FontFace(fontName, `url(${IS_LINUX?encodeURI("http://127.0.0.1:16780/" + typedPath.split('/').slice(-4).join("/")):convertFileSrc(typedPath)})`); + const font = new FontFace(fontName, `url("${IS_LINUX?encodeURI("http://127.0.0.1:16780/" + typedPath.split('/').slice(-4).join("/")):convertFileSrc(typedPath)}")`); // wait for font to be loaded font.load().then(()=>{ document.fonts.add(font); diff --git a/src/routes/Settings/pages/Fonts/Fonts.tsx b/src/routes/Settings/pages/Fonts/Fonts.tsx index e056bdd..caa0e23 100644 --- a/src/routes/Settings/pages/Fonts/Fonts.tsx +++ b/src/routes/Settings/pages/Fonts/Fonts.tsx @@ -65,7 +65,7 @@ const FontManager = (props:any)=>{ if(IS_LINUX){ fontSource = encodeURI("http://127.0.0.1:16780/" + newPath.split('/').slice(-4).join("/")) } - const font = new FontFace(fontName, `url(${fontSource}) format('truetype')`); + const font = new FontFace(fontName, `url("${fontSource}") format('truetype')`); // // wait for font to be loaded font.load().then(()=>{ document.fonts.add(font);