0
Answered

Custom Fonts in ePub Reader?

Chase Nordengren 4 years ago updated by Tom 4 years ago 7

Hello,


Is there an easy way to implement the use of custom fonts in the ePub Reader? I tried putting woff files into the fonts folder and creating a CSS file (using the defaults as a template) - while the new font shows up in the preferences menu, the font is still default. I've also tried using this CSS file to refer to Google Fonts with no success. Anybody had luck with this?


Chase

Under review

You followed the right steps.

You can post the custom CSS you wrote if you want me to check it.


Some epub files define the font in their own embedded CSS. In that case, fonts are not customizable.


Are you able to change the font of your book using the defaults fonts provided by Ubooquity ?

If not, this means the font is defined in the book CSS and cannot be changed.

Thanks Tom. I am able to change to the other default fonts.


This is my CSS:

@font-face {

font-family: 'Open Sans';
src: url('fonts/OpenSans-Regular.woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Open Sans';
src: url('fonts/OpenSans-Italic.woff');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Open Sans';
src: url('fonts/OpenSans-ExtraBold.woff');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'Open Sans';
src: url('fonts/OpenSans-ExtraBoldItalic.woff');
font-weight: bold;
font-style: italic;
}

Just in case: your font files are actually woff files, not ttf files ?


Also, could you open your javascript console (F12 in yout browser) and check if there is any error when you change fonts to Open Sans ?


I found a bug related to fonts which happens only in Firefox, not in Chrome.

I don't know yet if it explains your problem, but there is definitely something to fix.

Oddly enough, the bug either went away when I reverted to the default theme, or when some deep seated cache got reset. I'm not sure which but, either way, I'm not experiencing the bug anymore. For reference, this was on Windows 7 and Chrome 48.0.2564.116. Thanks for your help (and your patience)!

Answered

Thanks for the feedback !