-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom fonts not working #1849
Comments
Can you provide startup logs? Can you also check the browser's network tools / console and check for any errors in there? |
Server Logs: Browser network tools: Doesn't even try to load the fonts /api/v1/fonts/resource/[font_name]/css responses looks like this: |
I am running into this issue as well. I can provide additional logs if necessary. |
Not sure if related. When I used OTF fonts, it worked on my desktop computer, but not on iOS (I can still select the font but it just switches back to the system default font). Converting the fonts WOFF2 solves the issue. |
OTF fonts do not work for me on Web/Windows and Edge/iOS. |
Can you try other browsers on Windows ? |
Seems like it's a browser/platform issue. For better compatibility you should always use woff2/woff. |
I think the Will fix that. |
I've also updated the mediaType returned in the HTTP response for the fonts to reflect the proper media type instead of |
Tried with Firefox and Chrome, it doesn't work. woff2 fonts works just as @gharden91 said |
if you can try the latest |
I just noticed something else, but it happens with all fonts types. It doesn't detect the font family well. @font-face {
font-family: 'Merriweather';
src: url('Merriweather-BoldItalic.ttf') format('truetype');
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'Merriweather';
src: url('Merriweather-Black.ttf') format('truetype'),url('Merriweather-Regular.ttf') format('truetype'),url('Merriweather-Light.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Merriweather';
src: url('Merriweather-LightItalic.ttf') format('truetype'),url('Merriweather-Italic.ttf') format('truetype'),url('Merriweather-BlackItalic.ttf') format('truetype');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Merriweather';
src: url('Merriweather-Bold.ttf') format('truetype');
font-weight: bold;
font-style: normal;
} For example, "Merriweather-Black" is loaded by default when font-weight: normal and font-style: normal instead of "Merriweather-Regular" |
Look at how many variants a professional commercial typeface can have AJensonPro-Bold.otf |
you need to split the files into different folders yourself, 1 folder = 1 family |
All these files are from a single family. I don't think the project should support all the variants (if an epub uses so many fonts variations it probably has them embedded), but it would be nice if the documentation say that only: normal, bold, normal-italic and bold-italic are supported. Anyway, i just keep the normal, bold, normal-italic and bold-italic variations and it works perfect. |
The documentation already says that:
|
🎉 This issue has been resolved in |
Steps to reproduce
Add fonts in /config/fonts/
Expected behavior
The book should be displayed with the selected font
Actual behavior
The UI detects them but when you select it it switches to the browser's default font, not the selected one.
The selected font is not installed on my OS
Logs
No response
Komga version
1.19.0
Operating system
Docker, Debian Host. Edge browser on Windows
Installation method
Docker
Other details
No response
Acknowledgements
The text was updated successfully, but these errors were encountered: