Skip to content
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

Font-size customizer? #703

Closed
enclary opened this issue Dec 29, 2017 · 7 comments
Closed

Font-size customizer? #703

enclary opened this issue Dec 29, 2017 · 7 comments

Comments

@enclary
Copy link

enclary commented Dec 29, 2017

Hello, like i know, epub.js create iframe and take all settings from css in .epub file, but maybe i can add stylesheet for all epub books on site without editing all loaded files, adding my fonts, styles e.t.c, maybe someone have a permission epub.js reader with customizer.

@Thom3K
Copy link

Thom3K commented Jan 8, 2018

Hello Enclary,
You can simply add style to the epub by using this : Book.setStyle("font-size", "1.2em");
This will add an font-size attribute on the element

==> see the documentation : https://github.com/futurepress/epub.js/tree/master/documentation

@enclary
Copy link
Author

enclary commented Jan 8, 2018 via email

@Thom3K
Copy link

Thom3K commented Jan 9, 2018

You can also add style by injecting a css file in the header :

Book.addHeadTag('link',{'rel':'stylesheet','href':'MyCustomCss.css'});

Just try it ;)

@enclary
Copy link
Author

enclary commented Jan 9, 2018 via email

@fchasen fchasen closed this as completed May 18, 2018
@libertab
Copy link

Hi,
I tried to use both book.addHeadTag and book.setStyle but it tells me they are not functions....
(while book alone it is defined).

Is there a new way to change font size and family?

thanks

@fchasen
Copy link
Contributor

fchasen commented Aug 15, 2018

Yep! Have a look at the themes example https://github.com/futurepress/epub.js/blob/master/examples/themes.html

@looknear
Copy link

But, on scrolled view - the iframe size stay the same...
It is not adjusting to the changed content height.
in fact, in many cases - the iframe is cutting the inner page content. even in epub.js scrolled example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants