futurepress / epub.js

Enhanced eBooks in the browser.
http://futurepress.org
Other
6.45k stars 1.11k forks source link

change default font #1136

Open openitstore opened 4 years ago

openitstore commented 4 years ago

hello,

we were wondering how is the best way to change default font to edit epub file.

in file "epub.main.css", font-family is "fontello", and directory "css/font", stored those files, but when we change it, it's change default font => so, how do we have to proceed ?

thank you !!

mcthulhu commented 3 years ago

I think rendition.themes.default after the book has been rendered might be what you need. An example with some random values:

rendition.themes.default({ h2: { 'font-size': '32px', color: 'purple' }, p: { "margin": '10px' } });

You can also set single values in your JavaScript with something like rendition.themes.fontSize("120%"); which ought to work for font family too.