View Full Version : Best Practice: Embed Fonts??


luthar28
08-14-2010, 01:00 AM
I recently did an export from InDesign to Epub. Seems to work really nicely (before, I was only given a press-ready PDF...which made it a lot more difficult).

Anyhow, InDesign even embeds the fonts. Generally speaking, is this okay to do? Will these embedded fonts cause some readers to not display correctly? Or does this break any best practices rules?

The press I'm working for puts a lot of work into their books in regards to design, so if I could actually use their chosen fonts (title headers mostly) I'd like to do it -- but not at the expense of ruining it in certain readers.

AlexBell
08-14-2010, 05:30 AM
I recently did an export from InDesign to Epub. Seems to work really nicely (before, I was only given a press-ready PDF...which made it a lot more difficult).

Anyhow, InDesign even embeds the fonts. Generally speaking, is this okay to do? Will these embedded fonts cause some readers to not display correctly? Or does this break any best practices rules?

The press I'm working for puts a lot of work into their books in regards to design, so if I could actually use their chosen fonts (title headers mostly) I'd like to do it -- but not at the expense of ruining it in certain readers.

Firstly, I don't know that there are any 'best practice rules'. There are a lot of opinions, but they vary from person to person.

Secondly, my personal preference is that publishers NOT embed fonts in body of the text - for headers and title pages and so on is fine, but not the rest of the text. I very much like to have the option of choosing among the font families that my ebook reading devices offer me, rather than be forced to read using someone else's favourite font.

Thirdly, I suggest that you say to yourself three times before brushing your teeth 'ebooks are not print books'.

Regards, Alex

Jellby
08-14-2010, 05:33 AM
I don't think font embedding will prevent the book from working in any reader, at worst, the embedded fonts will not work and default fonts be used.

The main "problem" is InDesign will probably encrypt the embedded fonts. There are currently two methods for encrypting fonts in ePUB, one is suported by the official specification, the other is used by Adobe. If the generated ePUB uses the second method, it won't be standard-compliant, but it will work in ADE-based readers.

As for whether it's better to embed or not to embed fonts, I prefer not embedding them, at least not for the main text, so that the user can choose his preferred font. For some decorative or special purposes (titles, blackletter fragments, pieces of handwritten text, etc.) embedding is fine

charleski
08-14-2010, 06:38 AM
As Jellby said, there's a whole issue with font obfuscation when it comes to InDesign. On the whole, though, I far prefer it if ebooks do embed fonts. Ebooks aren't print books, but that doesn't mean they don't deserve to be treated with the same respect and be presented in a font that reflects and enhances the content. It's not a matter of having a 'favourite font', since you should use a different font for setting Tolstoy compared to Roth. But some publishers have adopted the practice of embedding the same rather sub-standard font in all their epubs, and that's certainly a practice to avoid, since it adds nothing to the text.

iBooks doesn't use embedded fonts (and the submission guide states you shouldn't use them), but other readers don't have a problem with them.

The major issue is licensing. The majority of font licences don't allow embedding in epubs, even if obfuscated. One way around this that I saw used in Philip Pullman's latest book is to specify the font in the css, but not embed it, so that it will be used if present on the reader's system.

luthar28
08-14-2010, 10:41 PM
Font licences -- good thing that was brought up. I never would've considered that (I would've thought this would be similar to a distributed PDF) and the last thing I'd want to do is get my publisher in hot water.

My publisher puts a lot of effort into the look of their books (font choices for headers, formatting, etc) so I was hoping to carry some of that over -- but without screwing up the experience.

Honestly, a lot of this reminds me of the browser wars back in the 90s. Sure, you could do some really cool stuff, but often it excluded one segment or another. And that's what I wanted to stay away from.

AlexBell
08-15-2010, 05:53 AM
... since you should use a different font for setting Tolstoy compared to Roth.

As I said, there are a lot of different personal opinions. For what it is worth I think I exercise a great deal of care and show a great deal of respect when preparing ebooks for the forum.

And it has been my experience that most if not all books with embedded fonts in the text body do prevent me from exercising my choice of font family with my Cybook and ECO Reader.



Regards, Alex

tomsem
08-17-2010, 12:10 AM
.

The main "problem" is InDesign will probably encrypt the embedded fonts. There are currently two methods for encrypting fonts in ePUB, one is suported by the official specification, the other is used by Adobe. If the generated ePUB uses the second method, it won't be standard-compliant, but it will work in ADE-based readers.



By 'ADE-based readers' I assume you are not referring to ADE itself (which doesn't support them, at least not yet), but rather to readers which use Adobe Mobile Reader SDK (e.g. Sony, Nook, etc.)?

charleski
08-17-2010, 07:24 AM
By 'ADE-based readers' I assume you are not referring to ADE itself (which doesn't support them, at least not yet)

Desktop ADE supports fonts embedded by InDesign just fine. They're actually obfuscated rather than encrypted.

Freeshadow
08-17-2010, 07:32 AM
Secondly, my personal preference is that publishers NOT embed fonts in body of the text.

you read english only don't you?

nyrath
08-17-2010, 10:46 AM
I can also see a need for embedding fonts if you are trying to display mathematical symbols or other non-standard special characters.

Freeshadow
08-17-2010, 12:20 PM
and some subsetting solution as an anti bloater d' be nice

shall1028
08-17-2010, 01:47 PM
This issue at hand should not be whether or not fonts be embedded in an epub and it should not be whether or not epub creators override the device's default font. Embedding fonts and overriding device fonts are valid as part of the whole XHTML and CSS ethos.

The issue, rather, should be the inability of the device to provide the last and most important point of control of CSS inheritance. That is: the user has final control of font choice and size.

http://webaim.org/techniques/css/media/css.jpg

Man Eating Duck
08-17-2010, 03:10 PM
you read english only don't you?I can also see a need for embedding fonts if you are trying to display mathematical symbols or other non-standard special characters.For instance in academic publications. Even if they are in English you will have names of persons and places of every nationality. Not many default fonts will support for instance Icelandic, Turkish, Russian and Polish characters. I work at an accredited academic publishing house, and misprinting the name of a researcher is BAD.

That's primarily why we embed fonts. In some readers the user can choose another font, and that's good. Other readers won't use embedded fonts at all, in that case we haven't really lost anything. All in all I feel that we provide a better product with embedded font, the 4-500 KB added to the file size is negligible for most modern equipment IMHO.

On a side note I wholeheartedly agree with shall1028, unfortunately most reader implementations are still bad. Hopefully in the future we can concentrate on making quality source material, and don't need to wrestle with the Big Companies' sloppy work :)

Adjust
08-18-2010, 12:11 AM
Also you cannot rule out the Font License, when dealing and embedding font into ePub, because you can't subset, you are effectively distributing full and complete font without having permission to do so. Unless you use free fonts, which the majority of publishers do not...

I think for this reason alone, the readers have their own set of fonts to choose from

shall1028
08-18-2010, 02:59 AM
the 4-500 KB added to the file size is negligible for most modern equipment IMHO.

There is a place for saving space. I well remember optimizing a number to character conversion routine to save 3 or 4 bytes off of a 20 byte subroutine on a computer with a whopping 16 kilobytes of memory (circa 1980).

But given that my Kobo ereader has 3 gigabytes of memory (that's 187,500 times as much as that 16K machine) I also don't worry about a bit of extra size in an epub file. A quick perusal of my font folder shows 161 files only 60 of which exceed 400K. The remainder tend towards 100 to 200K.

Man Eating Duck
08-18-2010, 08:04 AM
Also you cannot rule out the Font License, when dealing and embedding font into ePub, because you can't subset, you are effectively distributing full and complete font without having permission to do so. Unless you use free fonts, which the majority of publishers do not...
We do :)

That's why we use the DejaVu fonts. While not very pretty, they are easy to read on a variety of screens and have very decent Unicode coverage, while being free for commercial use. There are not many fonts with these characteristics, Libertine is an alternative although it has marginally fewer glyphs.

Adjust
08-18-2010, 09:22 PM
We do :)

That's why we use the DejaVu fonts. While not very pretty, they are easy to read on a variety of screens and have very decent Unicode coverage, while being free for commercial use.

Yeah I think that's the main problem... Most authors who don't have contact with publishing houses or other industry bodies probably won't be aware...

So I think there could be, if the makers of the fonts, which people are embedding decide to go looking, some very unhappy people out there who have embedded fonts without knowing the licensing conditions.

4. Font Embedding.
The basic P22 license allows for the embedding of P22 fonts only if the document created is set to "Print and Preview". If P22 fonts can be extracted, edited and therefore transferred in any way, an additional license is required to account for each recipient of the document and font file(s)

And from Linotype website:
1.5 Embedding of the Font Software into electronic documents or Internet pages is only permitted under the absolute assurance that the recipient cannot use the Font Software to edit or create a new document (read-only). It must be ensured that the Font Software cannot be fully or partially extracted from said documents.

ozaru
08-19-2010, 06:41 AM
There is a place for saving space. [...] A quick perusal of my font folder shows 161 files only 60 of which exceed 400K.

I have a problem in that the ePub I've just painstakingly produced (and which displays fine on my PC in Sigil, Calibre and EPUBReader/Firefox), fails totally in Adobe Digital Editions -- because it contains a few Unicode characters (not even on the roadmap for ADE, it appears: see http://forums.adobe.com/thread/314859)

Some might be relatively easy to fix with a smallish font (vowels with macrons, used throughout the text), but there are also about a dozen Japanese characters used on just 2 pages, for which the only solution I can think of is embedding a whole Japanese font file -- around 5MB. Not ideal, huh?

If there were some way to subset this in ePub that would be great, but I've not seen it anywhere. I suppose an alternative would be to 'extract' the characters from a Japanese font whose licensing terms allow it (I bet MS Mincho doesn't) and create a new font from them, just for this one book, which seems a bit silly -- and I suspect will also break various reading systems.

Any advice?

Man Eating Duck
08-19-2010, 06:53 AM
If there were some way to subset this in ePub that would be great, but I've not seen it anywhere. This online service seems to be able to do what you need: http://www.fontsquirrel.com/fontface/generator

Select expert options, where you can enter single glyphs for subsetting with preview. I tried subsetting five glyphs from a ttf font, and ended up with a ttf file only 3.5 KB in size.

charleski
08-19-2010, 09:06 AM
Some might be relatively easy to fix with a smallish font (vowels with macrons, used throughout the text), but there are also about a dozen Japanese characters used on just 2 pages, for which the only solution I can think of is embedding a whole Japanese font file -- around 5MB. Not ideal, huh?

Subsetting, as mentioned above, is a good route, though you still have to deal with licensing issues. If it's only a dozen characters on 2 pages, why not just render them to png files and use those? All font licences will allow that. You can get the images to show up in-line with the text.

Macrons are a different issue, as most fonts have a macron, but rely on overstriking to use it. You can get an epub to overstrike by using a span with adjusted margins, eg
o<span class="o-macron">& #175;</span> {remove the space}
with
span.o-macron {
margin-left: -0.37em;
margin-right: 0.12em
}

But frankly this is very fiddly, needs to be fine-tuned for each character and breaks if the font is changed. For macrons it would be easier to embed something like SIL Gentium Basic (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=Gentium_basic) which includes macroned vowels and has a fully open licence that allows epub embedding. It's still a hefty font at over 200k for each weight and style, but you could get away with not having to subset. (A lot of people use SIL's Charis, but personally I can't stand slab-serifs, and its massively inclusive range means each weight is 1.6MB.)

ozaru
08-19-2010, 10:01 AM
Subsetting, as mentioned above, is a good route, though you still have to deal with licensing issues.

True, but even free & amateur fonts that 'have problems' in certain areas may be acceptable for those few characters, so I think there is likely to be a good choice of licensable material.

If it's only a dozen characters on 2 pages, why not just render them to png files and use those?

I did consider that, but don't really like that approach on principle -- it's like translating a web page into GIFs (and losing the ability to search, reflow nicely at line ends, output to voice readers, etc.).

Macrons are a different issue, as most fonts have a macron, but rely on overstriking to use it.

Those types never looks quite as good as e.g. U+014D -- that method also increases the size, and makes searching awkward.

For macrons it would be easier to embed something like SIL Gentium Basic (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=Gentium_basic) which includes macroned vowels and has a fully open licence that allows epub embedding. It's still a hefty font at over 200k for each weight and style, but you could get away with not having to subset.

Alternatively, I could use it and subset to strip out all the characters I don't need, decreasing the size... sounds tempting. I suppose I could also get around it by specifying e.g. Times New Roman on the basis that most systems will have it available, including macrons? (Currently I simply put 'serif', and maybe that's why Adobe Digital Editions fails. Mind you, it also fails to pick up on several things in the CSS so I'm not sure how reliable that will be.)

charleski
08-19-2010, 11:13 AM
I suppose I could also get around it by specifying e.g. Times New Roman on the basis that most systems will have it available, including macrons?
They won't. Mobile ADE-based readers only need to include a font with glyphs that cover the subset specified by Adobe.

ozaru
08-19-2010, 06:55 PM
This online service seems to be able to do what you need: http://www.fontsquirrel.com/fontface/generator

It did indeed look promising -- I managed to get my 25 characters from a free Japanese 6MB font down into a tiny 9K TTF. In Charmap the character spacing was a bit off, but in Sigil it appeared to work OK (although Sigil was displaying the characters OK before in any case, so I'm not 100% certain...). In Adobe Digital Editions, however, they rigidly stayed as "?" marks. I note some similar comments in the ThreePress blog (http://blog.threepress.org/2009/09/16/how-to-embed-fonts-in-epub-files/). But even on a Japanese website (http://builder.japan.zdnet.com/sp/epub2010/story/0,3800103623,20410648-2,00.htm) they demonstrate ADE failing to display Japanese ePubs. I wonder if changing the TTF to OTF would make any difference... Yet another avenue to explore.

Microsoft's Expression Studio (trial) (http://www.microsoft.com/downloads/details.aspx?FamilyID=f17ac9b8-6d4d-4acc-93cb-54fabdeb3cfe&displaylang=en) also apparently has the facility to subset a font. I'm not too confident it will work if Squirrel failed, but the options are running out... Perhaps I ought to give up on ePub for now and try Kindle instead.

ozaru
08-20-2010, 10:16 AM
In Adobe Digital Editions, however, they rigidly stayed as "?" marks [...] even on a Japanese website they demonstrate ADE failing to display Japanese ePubs

OK, scrub that: I've now found another Japan-based website (http://www.kobu.com/docs/epub/index-en.htm) that demonstrates the only change needed is adding xml:lang="ja" after xmlns="http://www.w3.org/1999/xhtml" -- then the Japanese characters (and even macrons) do display in ADE.

Embedding therefore seems irrelevant (although I have to say I've not tested it in ADE on a system with no Unicode fonts). It's not a perfect solution yet, though, as the font for that whole chapter has now changed to an awful Japanese typeface, completely ignoring what is specified in the CSS: indeed, ADE appears to ignore my CSS entirely. That probably calls for a separate thread though. Thanks to all who assisted.

JSWolf
08-20-2010, 10:38 AM
The font most publishers use is Charis. It's not a bad font overall. It definitely is better then the default serif font used in ADE. And you will get true bold and true italics. So that's good for sure.

Adjust
08-20-2010, 07:20 PM
The font most publishers use is Charis.

That's the font Indian companies (CodeMantra etc) use. It isn't a conscious decision on the publishers end...

marytg
08-18-2011, 02:51 PM
Embedded fonts will be allowed in EPUB3 which is due out soon. This is quote from idpf.org site:3.4 Fonts
EPUB 3 does not require that Reading Systems come with any particular set of built-in system fonts. As occurs in Web contexts, Users in a particular locale may have installed fonts that omit characters required for other locales, and Reading Systems may utilize intrinsic fonts or font engines that do not utilize operating system installed fonts. As a result, the text content of a Publication may not natively render as intended on all Reading Systems.

To address this problem, EPUB 3 supports the embedding of fonts to facilitate the rendering of text content, and this practice is recommended in order to ensure content is rendered as intended.

Support for embedded fonts also ensures that Publication-specific characters and glyphs can be embedded for proper display.

This is what an Adobe staff person said about embedding UNICODE glyphs in ADE. It seems they feel the same about Cyrillic fonts:
Full Unicode font support for all glyphs would bloat the Digital Editions download from ~6Mb to around 32 to 40 Mb. This is not something we are anxious to do. We are looking at other mechanisms to download the fonts on demand, but this is fairly low in priority compared to long laundry list of other features we want to do.

Understandable, but reflective of American arrogance in my opinion.

JSWolf
08-18-2011, 03:26 PM
Embedded fonts is allowed in ePub now. No need to wait until ePub 3 is is finished.

Jellby
08-18-2011, 05:53 PM
This is what an Adobe staff person said about embedding UNICODE glyphs in ADE. It seems they feel the same about Cyrillic fonts:
Nonsense. All they need is allow using system fonts. Web browsers don't come with a full unicode font embedded either, and they don't have that problem.

marytg
08-19-2011, 01:16 PM
ADE doesn't display Cyrillic characters even if the UNICODE code is in the epub. For example, when it encounters the code for the letter "č" it displays a "?." A sad state of affairs for lots of Europeans.

Embedding fonts in an epub seems to increase the file size greatly but if that's what we have to do to properly display non-English characters, so be it.

Jellby
08-19-2011, 01:24 PM
Embedding fonts in an epub seems to increase the file size greatly but if that's what we have to do to properly display non-English characters, so be it.

Or use a reader that lets you choose your own font, like Bookeen's Cybooks.

LaurelRusswurm
10-31-2011, 04:00 PM
As a wet-behind-the-ears self publisher, I am curious what kind of size limitations do ereaders have if a 40mb embedded font is considered to be too large?

Adjust
10-31-2011, 08:35 PM
40mb file? I don't think there are limits...maybe tough for people to download though

pholy
10-31-2011, 09:43 PM
To say nothing of expecting the ereader to open the font. Just out of curiosity, which font do you have in mind? A link to its description is good enough... I thought the Chinese fonts I'd seen were only 4 MB or so.

LaurelRusswurm
11-01-2011, 03:41 AM
I know I want to embed fonts when I publish, but before I do I want to have an idea what is reasonable. I don't want to overload readers, for instance, so I was just pulling numbers from this thread:

...This is what an Adobe staff person said about embedding UNICODE glyphs in ADE. It seems they feel the same about Cyrillic fonts:
"Full Unicode font support for all glyphs would bloat the Digital Editions download from ~6Mb to around 32 to 40 Mb. "... .

So I just went and looked at some numbers. The Font I will for sure be using just for the title is a free font called Rebel Caps which I am lucky to have in OpenType Format at 29.8kb I also have the TrueType font, which is much larger, weighing in at 87.7 kb. [http://www.dafont.com/rebel-caps.font]

The others I'd use are:

Play 167.1 kb
Goudy Bookletter 1911 39.1kb
Gentium (regular) 266.1 kb
(italic) + 259.9 kb

But I'm still figuring things out, and haven't decided for sure.
[And now I have to go write a murder to kick off my 2011 NaNoWriMo mystery.]

Adjust
11-01-2011, 04:16 AM
Wow, ok, you said MB and not kb in the original post...no you'll be fine...Although as a rules I wouldn't embed any font at all

Toxaris
11-01-2011, 04:53 AM
I agree, only add fonts when it really add things and not for the body.

Jellby
11-01-2011, 05:16 AM
I didn't try with embedded fonts, but my Orizon apparently does not use Arial Unicode (23 MB) or Code 2000 (8 MB). The largest font I have installed is Charis SIL (1.6 MB per weight and style), and I believe it works right.

I don't know how much RAM the Orizon has, but the Gen3 has 32MB, so I doubt it can use a 40MB font.