About your first request, do you wish the title to be updated every time the user selects a different font-family or font-size in the menu? The problem with matching the title’s font with the font inside the ebook, is that the ebook can have its own custom fonts (possibly more than one) with various sizes.
Or do you wish that the title matches the font of your page outside the viewer?
I might add a couple of css variables like --simebv-ui-font-family (cfr. the readme) to allow the customisation of the title’s font (the result would be static, though).
Regarding your second request, I’m considering it. I’ll do some experimentation.
Good questions. By default, the header font should match the body text font. I understand that the ebook could have multiple fonts. In that case, just pick one used in the body of the text. I recognize that can be tricky, since the first words in the story may be a preamble in a different font from the body text. But you have to choose something.
To cover cases where that is the wrong choice, you could add options to set the header font.
I don’t know what you mean by the “font of your page outside the viewer.” Do you mean the surrounding web page? If so, I would say you should ignore that font and focus only on the ebook’s default font.
I did recently see a guide on creating EPUB books called “The Complete Guide to Creating EPUB-Ready Documents for eBooks” by Paul Hoke. He advises against using headers or footers in an ebook, as the standard doesn’t allow them and they can cause problems. But since you control the plugin and already have a header option, I figure you can do whatever you want.
Right now, my workaround is to set the title to a blank character so nothing shows at the top of the page.
Ok, so I think I’ll add an attribute in the shortcode to hide the ebook’s title in the viewer’s header, with possible values “always”, “first-page”, “never” (default “never”).
I’m going to also add 3 CSS variables to customise the appearance of the title (--simebv-header-font-family, --simebv-header-font-size, --simebv-header-font-weight). Extracting fonts from inside the ebook and using them in the viewer can cause various issues, so for now I’m leaving that out. I’ll keep it in mind so that I can reconsider it in the future.
About the guide, it’s correct that an epub with flowing text doesn’t have pages’s headers and footers, since it doesn’t have fixed pages: it’s the job of the viewer to provide them.
That sounds perfect.
I agree that it is better not to guess the font.
What does “simebv” stand for? Would it be sufficient to use the tags--header-font-family, --header-font-size, --header-font-weight
I will be happy to test this once you get it done.
“simebv” is a code to distinguish this plugin from any other (SIMple EBook Viewer), it’s mostly used internally, but I’m also using it as a prefix in CSS to avoid accidental collisions.
If you want to test it, you should already be able to download the updated version from this page https://wordpress.org/plugins/simple-ebook-viewer/advanced/ (in the “Advanced options” section), otherwise in one or two days it will be available as the new stable version anyway (if there are no surprises during the tests).
In the shortcode, you can use the new features like this: [simebv_viewer book="..." hide-title="first-page" style="--simebv-header-font-size:1rem;--simebv-header-font-weight:normal;"]
I published the updated version of the plugin (v2.1.0). I’m closing this thread for now, let me know if you find any issues.