Skip to content

Commit

Permalink
Fixed FontFace Load Error
Browse files Browse the repository at this point in the history
Fixed incorrect usage of FontFace causing error screen when books load.
  • Loading branch information
btpf committed Nov 5, 2023
1 parent befd0b2 commit cbb9163
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Settings/pages/Fonts/Fonts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cbb9163

Please sign in to comment.