View Single Post
Old 04-15-2016, 12:54 AM   #8
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
I don't know anything about MS Word, but I can probably help with what the final ePub needs to look like.

Quote:
Originally Posted by SJC-Caron View Post
1) How do I force sections of text not to be user modifiable on a e-reader? eg: keep chapter headings in publisher default font (eg: a handwriting font) while letting the user select his/her font preferences for the main body of text; keep a quote center-justified while letting the user select the text justification for the rest of the text.
With the KePub reader it is not possible to do what you want for font styles, unless you patch the firmware. The patch to look at is called `Un-Force user font-family in KePubs`. You might also want to look at `Un-Force user text-align in div,p tags in KePubs`, and perhaps `KePub full justification default`.

With the ePub reader (or patched KePub reader) the easiest way to prevent the font and alignment used for headings, subheadings, etc.from changing is just to make sure they are marked up with appropriate heading tags, <h1>, <h2>, etc. The problem is that some publishers (or some conversion software) mark headings with <p> or <div> tags instead of <h1>, <h2>, etc.

Edit: Also, for the ePub reader if you want to explicitly reference a font that has been sideloaded to the device (other than the generic serif, sans-serif, etc.) then you need to specify it with @font-face in a similay way to what you would an embedded font, but using the paths "res:///fonts/normal/Fontname", "res:///fonts/italic/Fontname", "res:///fonts/bold/Fontname", "res:///fonts/bolditalic/Fontname", where Fontname is the name of the font rather than its filename. It is probably simpler just to use an embedded font for decorative things like headings etc., and only sideload fonts that you would actually select as reading fonts.

(There is a lot more to this subject, if you want to get into more detail. There are complications because the !important modifier has a different meaning to the KePub reader than it does to the ePub reader. But in general as long as the publisher uses appropriate tags when making the ePub, i.e. <h*> for headings, subheadings, etc. and <p> for paragraphs, then things will usually work as expected.)


Quote:
2) How do I ensure that chapters don't end on a blank page on e-readers?
I have noticed ePubs from a number of publishers have lines of non-breaking spaces at the end of chapters. These can cause a blank page following the chapter, depending on how far from the bottom of the page the text ends, and I think the only way to fix it is to go through the ePub and delete all the offending lines. E.g. here is an example of a chapter ending from an ePub published by Baen:
Code:
<p class="calibre1">[...] And I can forget that you ever came."</p>
<p class="calibre1">&nbsp;</p>
</body>
</html>

Last edited by GeoffR; 04-15-2016 at 01:18 AM. Reason: ... explicitly reference a font that has been sideloaded ...
GeoffR is offline   Reply With Quote