View Single Post
Old 09-01-2011, 08:21 PM   #190
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,254
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by bookfanmd View Post
Jackie_W,

I'm also in camp 2 and can't really enjoy the book if there are too many formatting issues. Could you please elaborate on the "epub font customisation" and how to use it? I've looked in the documentation but haven't found anything or if I did it was over my head.
I don't want to hijack unboggling's thread so I'll restrict my reply to general info which may be of use to other new users. Much of it is not Calibre-related so apologies if it's not appropriate here. Nevertheless, Calibre can play a part in customising epub fonts.

There are many threads in the MR forum discussing this subject.
This is the one I used to get started - unfortunately it's quite large, start at post #9.
This post may be easier to digest. It contains one user's step-by-step guide in a PDF attachment.

Reading epubs in the font of your choice is not actually as difficult as many people imagine. Any reader which uses an Adobe epub renderer requires only 2 things:
  • the actual font files (.ttf or .otf) for the font you want to use, e.g CharisSIL.
    There are usually 4 of them, one each for rendering Regular, Italic, Bold and BoldItalic text.
  • a bit of extra css, which specifies which font files you want to use and tells the reader where to find them.
    The extra css is a series of @font-face{} statements, one for each of the font files, i.e. usually 4.

There are 3 ways to achieve epubs-with-customized-fonts. Each has its pros and cons:
  1. Embedding. Font files are copied into the epub, @font-face css is added to the epub's existing css file.

    This method is often used by publishers for DRM'd retail epubs. But anyone can do it for an epub not locked by DRM. There is no Calibre feature to do this (probably Sigil can, but I don't use it, so not sure)

    Pros
    - epub should work on any reader which uses the Adobe renderer.
    Cons
    - non-DRM epubs only
    - The font files would be contained in every single epub. Some (e.g. CharisSIL) are quite large. This can add up to a lot of disk space if you keep thousands of books on the reader.
    - You have to manually edit each epub to embed font files, extra @font-face css and make some changes to the epub's .opf file.

  2. Font files are copied to the reader, @font-face css is placed in a specially-named .css file on the reader.

    Unfortunately, to date, this requires the firmware on your reader to be slightly modified to recognise the .css filename containing the @font-faces. This is because Adobe has seen fit to hide its default css file deep inside the firmware where users can't get at it. For Sony readers, the PRS+ customised firmware project provides the modification.

    Pros
    - Can be used for all epubs whether they have DRM or not.
    - You only need to copy the font files and @font-face css to your reader once.
    - You don't need to do anything special in Calibre, nor do you need to edit each epub.
    Cons
    - You have to 'hack' your reader firmware. In my own experience, this was not actually as scary as it sounds.

  3. A kind of hybrid. Font files are copied to the reader, @font-face css added to each epub's css file.

    You can add the @font-face css into each epub's css file manually using Calibre's Tweak-epub feature (and probably Sigil). However, you can also do it with a Calibre conversion to epub, by copying the @font-face css into Calibre's Convert - Look&Feel - ExtraCSS box.

    Pros
    - no hacking required
    - You only need to copy the font files to your reader once.
    - If you add the @font-face css to Calibre Preferences, you only need to do it once.
    Cons
    - non-DRM epubs only
    - Because the @font-face css is slightly different for each brand of reader, you cannot use the same epub on different readers, e.g. an epub prepared for a Sony will not display correctly on a PocketBook, and vice versa. Let me re-phrase that, the same epub will be perfectly readable on both devices, but you'll only get the customised fonts on one of them. This will only matter if you own multiple readers of different brands.

Caveat: Whichever method you use, you cannot 100% guarantee that it will work first time for every epub because it depends on the rest of the contents of the epub's css file, which in turn will depend on the quality of the source file used to create the epub. If it doesn't work it is usually because the original css contains one or more font-family statements which are overriding yours. However, I've never yet found an epub which could not be Calibre-tweaked in a few minutes so that it does work. The better you understand the 'cascading' nature of CSS the easier it is to epub-tweak-to-taste
jackie_w is offline