View Full Version : Best font stack?


vootie
02-24-2012, 07:54 AM
I'm creating an ePub with InDesign 5.5, to be distributed to the stores supported by BookBaby, except for Amazon., which I'll do directly. I want to use a safe serif font for the body text and a safe one for the heads and subheads. What is the best practice for defining the font stack in the style sheet? Should I specifiy several of those supported by the various readers and then conclude with generic serif or sans serif? Is there an ideal stack for the Kindle versus other eReaders?

Thanks

Chris

DiapDealer
02-24-2012, 08:34 AM
It's best not to define a general body text font, at all. Headers, sub-headers and special text, sure... if you want. But unless your text contains special characters that can't be displayed with normal fonts, then you should probably let the reader (the device or the user attached to it) decide the body text font that they prefer.

JSWolf
02-24-2012, 11:00 AM
Charis SIL is a very nice font to use and it's the font used by most publishers when they embed fonts as it's free. This is the code to use Charis such that it will work and still allow readers that can change fonts to do so.

Put the fonts directory in the same place as the stylesheet. So if you have OEBS/style.css then you want OEBS/fonts/.

@font-face {
font-family: serif;
font-weight: normal;
font-style: normal;
src: url(fonts/CharisSILR.ttf)
}
@font-face {
font-family: serif;
font-weight: bold;
font-style: normal;
src: url(fonts/CharisSILB.ttf)
}
@font-face {
font-family: serif;
font-weight: normal;
font-style: italic;
src: url(fonts/CharisSILI.ttf)
}
@font-face {
font-family: serif;
font-weight: bold;
font-style: italic;
src: url(fonts/CharisSILBI.ttf)
}
body {
font-family: serif;
widows: 0;
orphans: 0;
margin-top: 0;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
text-align: justify
}

frostschutz
02-24-2012, 11:07 AM
It's best not to define a general body text font, at all.

+1

embedding fonts into epub is just unnecessary bloat

JSWolf
02-24-2012, 11:11 AM
+1

embedding fonts into epub is just unnecessary bloat

Some readers such as ADE for Windows don't have the ability to change fonts and the default font is ugly. Plus you don't get true italics. So while you think it may be bloat, it's not really as it makes the text look nicer.

Jellby
02-24-2012, 11:25 AM
Some readers such as ADE for Windows don't have the ability to change fonts and the default font is ugly. Plus you don't get true italics. So while you think it may be bloat, it's not really as it makes the text look nicer.

It makes it nicer in bad readers, whereas in well designed readers (those that let you choose your preferred font) it looks worse (from the user's perspective, since he can't choose the font anymore).

frostschutz
02-24-2012, 12:32 PM
So while you think it may be bloat

I don't *think* it's bloat, it *IS* bloat.

Fonts should be provided by the reader, not embedded separately in every book. All it serves is make the files bigger. The Charis SIL font is 6.5MB large (3MB compressed), that's several time the size of a regular book with cover.

it makes the text look nicer.

If you want the text to look nicer, you should spend your time and effort on clean consistent formatting, as well as on the text itself (grammar, spelling, ...). Overloading your book with fancy fonts and styles does not help, quite the opposite. With ebooks, simpler formatting actually tends to look better.

JSWolf
02-24-2012, 12:43 PM
It makes it nicer in bad readers, whereas in well designed readers (those that let you choose your preferred font) it looks worse (from the user's perspective, since he can't choose the font anymore).

Not so. If you do it the way I have shown, then readers that allow font changing will still work to change the font. Notice I used serif instead of the font name. Thus means that it's not overriding the font changing systems. Using the font name could very well override such. So with my example, you still have a better default font and you have the ability to change the font is the reader software allows.

JSWolf
02-24-2012, 12:46 PM
I don't *think* it's bloat, it *IS* bloat.

Fonts should be provided by the reader, not embedded separately in every book. All it serves is make the files bigger. The Charis SIL font is 6.5MB large (3MB compressed), that's several time the size of a regular book with cover.



If you want the text to look nicer, you should spend your time and effort on clean consistent formatting, as well as on the text itself (grammar, spelling, ...). Overloading your book with fancy fonts and styles does not help, quite the opposite. With ebooks, simpler formatting actually tends to look better.

Again, I have to disagree with you. It's NOT bloat to make things look better. This has nothing to do with the content. Use ADE for Windows. You don't have the ability to change the fonts on the fly. The default built-in font doesn't look so good. So using a font such as Charis SIL does look nicer and gives a better reading experience. Even if the ePub was perfect, it would still not look as nice with the default font on some readers.

Jim Lester
02-24-2012, 11:56 PM
For Reading systems based on RMSDK (Nook, Bluefire Reader, ADE 1.8 Mac, etc...) the font changing system is based on user stylesheets, which carry a higher level of precedence than a normal stylesheet. Placing the font definition in a body rule (or even just a p/div) rule should be okay. Placing it in a class rule (ie p.myClass or .myClass) will cause problems with overrides for those readers (this is what InDesign does by default, BTW).
Using a class rule won't cause problems with Nook Color/Tablets, and soon not on the NST, but that's a whole different can o' worms.

I don't know how Reading Systems (iBooks, etc...) not based on RMSDK work for this, and would suggest testing to make sure you get the results you desire.

That being said, I agree with Jellby - as a general rule don't embed the font.
If you really think you need to embed the font, please keep your CSS clean (only use the level of specificity you have to).

Note: This is my personal opinion, and not necessarily that of my employer.

Jellby
02-26-2012, 08:20 AM
Notice I used serif instead of the font name. Thus means that it's not overriding the font changing systems.

It is, if the user prefers a sans-serif font, and I'm not sure you can use generic family names (like "serif") in a @font-face rule...

Rob Lister
02-26-2012, 09:02 AM
i wanna chime in to +1 all those that said not to specify the font. I very much enjoy my reader's default font as well as the ability to change it at will.

If some people have readers with crappy default fonts, then it just sucks to be them; should'a bought a reader that invested in a decent font set.

Of course you could always create epubs specific to/tailored to individual readers if it is really an issue with specific cases.

JSWolf
02-26-2012, 12:06 PM
It is, if the user prefers a sans-serif font, and I'm not sure you can use generic family names (like "serif") in a @font-face rule...

Yes, you can use serif. It works fine in ADE. On a T1, it means, I can setup a default embedded font and the user can still change it if wanted. No need to then have to remove the fonts from the ePub or change the CSS code.

It should work fine in most readers that allow font changing. It won't work in a Kobo because Kobo doesn't give a damn (font-family in body doesn't work) and you won't see the embedded fonts.

JSWolf
02-26-2012, 12:09 PM
i wanna chime in to +1 all those that said not to specify the font. I very much enjoy my reader's default font as well as the ability to change it at will.

If some people have readers with crappy default fonts, then it just sucks to be them; should'a bought a reader that invested in a decent font set.

Of course you could always create epubs specific to/tailored to individual readers if it is really an issue with specific cases.

I've some ePubs that do have embedded fonts that are meant to be there because there is a specific look being obtained. ADE for Windows does not allow font changes. So the only way to get a better look is to embed fonts. Not everyone has a reader and some people do read via the computer.

What would really help is if there was a way to subset the embedded fonts.

vootie
03-03-2012, 07:53 AM
Thanks for those that have contributed to this thread. I've learned quite a bit from it and the temptation to embed fonts is significant. But for my first book I think I'll err on the side of caution. The safest thing would simply be to use "serif" for the body text and "sans-serif" for heads and subheads, if I understand correctly.

Chris

JSWolf
03-03-2012, 12:11 PM
Thanks for those that have contributed to this thread. I've learned quite a bit from it and the temptation to embed fonts is significant. But for my first book I think I'll err on the side of caution. The safest thing would simply be to use "serif" for the body text and "sans-serif" for heads and subheads, if I understand correctly.

Chris

You have nothing to lose by following the code I posted earlier in this thread and everything to win as your eBook will then look much nicer then it would otherwise.

Freeshadow
03-10-2012, 06:56 AM
i wanna chime in to +1 all those that said not to specify the font. I very much enjoy my reader's default font as well as the ability to change it at will.

If some people have readers with crappy default fonts, then it just sucks to be them; should'a bought a reader that invested in a decent font set.

Of course you could always create epubs specific to/tailored to individual readers if it is really an issue with specific cases.

Which is fine for all those living in ASCII-land. Don't know if there is any reader with fonts embedded which include polish special characters.

Jellby
03-10-2012, 08:30 AM
There are readers that let you use whatever font you like. Just copy the TTF or OTF files to the right folder and you can choose them. But for this, the book file must not use embedded fonts.

Rob Lister
03-10-2012, 09:24 AM
Which is fine for all those living in ASCII-land. Don't know if there is any reader with fonts embedded which include polish special characters.

And I'm okay with embedding 'special' font sets; that goes without saying...so I didn't say it.

DiapDealer
03-10-2012, 09:47 AM
And I'm okay with embedding 'special' font sets; that goes without saying...so I didn't say it.
I did. ;)

But unless your text contains special characters that can't be displayed with normal fonts, then you should probably let the reader (the device or the user attached to it) decide the body text font that they prefer.

Toxaris
03-10-2012, 09:58 AM
I sometimes add a small font with only the special characters I need. That results in very small font files. This especially for headers, notes and so.
Usually the problem is getting all the characters without missing one. I still must write a script someday that lists all the characters in a text document...

frostschutz
03-10-2012, 10:49 AM
Including only the required characters would certainly help a lot with the size of the font. But adapting a font like this is beyond the ability of most people, so if it's not done by the ebook creation tools like Sigil/Calibre, it's simply not done.

But I'd expect most readers to support special characters for European character sets out of the box. Even English books have them sometimes if it's writing names the way they're supposed to be written...

Timur
03-10-2012, 12:13 PM
Which is fine for all those living in ASCII-land. Don't know if there is any reader with fonts embedded which include polish special characters.

All 6 built-in fonts in Nook STR has support for both Latin Extended-A unicode range and 1250(Latin 2: East Europe). These should cover all polish special characters.

JSWolf
03-10-2012, 05:36 PM
There are readers that let you use whatever font you like. Just copy the TTF or OTF files to the right folder and you can choose them. But for this, the book file must not use embedded fonts.

Not so. For example, if I have an eBook using Charis SIL as the embedded font and I want to use one of the fonts on the T1, as long as the font name is serif, I can still change the font or go back to the default of Charis SIL. I'm guessing this method also works with other readers that have the option to change the font.

JSWolf
03-10-2012, 05:37 PM
I sometimes add a small font with only the special characters I need. That results in very small font files. This especially for headers, notes and so.
Usually the problem is getting all the characters without missing one. I still must write a script someday that lists all the characters in a text document...

a script to do subestting would be great.

Freeshadow
03-11-2012, 06:47 PM
I sometimes add a small font with only the special characters I need. That results in very small font files. This especially for headers, notes and so.
Usually the problem is getting all the characters without missing one. I still must write a script someday that lists all the characters in a text document...

Apart from space saving this could resolve the problem of adding commercial fonts: strip all unnecessary chars from the file makes it useless for everything than the ebook it is used for and the font publisher has no reason to complain about redistribution.

Toxaris
03-14-2012, 06:05 AM
I have created a Word macro to determine the unique characters in a document. It can be restricted to certain fonts.

Please see other thread.

roger64
03-16-2012, 11:27 PM
Hi

I am still using an old PRS-505, so I am not aware of the latest advances in ebook-readers.

But, considering what has been said above, it seems there is a choice to be made by EPUB producers:
- either to create a font-free EPUB (or nearly free) and let the reader choose its own font(s) according to its own tastes and material.
- or to create an EPUB with fonts included, maybe even adding carefully chosen embedded fonts (special characters, and/or smallcaps etc.) to avoid producing a bloated EPUB.

Logically this would lead to two EPUB types. I wonder which side has the majority among current MR ebooks? Naked ones. Clothed ones? :)

Would it not be wiser to publish EPUBs in two versions? How many people do it here? Is it the way to go?

Freeshadow
03-17-2012, 12:07 AM
Since the majority here uses West European languages I assume no fonts embedded; they are not really needed and it 'd follow the KISS rule.

Toxaris
03-17-2012, 02:50 PM
I only do it in special cases. If it is not necessary, I won't do it.

roger64
03-17-2012, 10:00 PM
Hi

On the other hand, even some "Western Europeans" may enjoy for example using true smallcaps (coming from embedded font). These can be added with as few as 60k to each EPUB. Even if smallcaps represent probably less than 1% of the EPUB text content, I think they are really nice looking and are a worthy addition (see screenshots below).

I checked that these true smallcaps can be properly displayed both on ADE (contrary to the - fake - font-variant: smallcaps) and on my old PRS-505.

If they are not seen by some ebook readers, what happens? Will these ebook-readers display a standard default replacement font ? A user-controlled one? I can live with that.

If they crash the EPUB, it would be a different story, and it would make sense to provide two EPUBs, one with them, one without.

To make a sound decision about this, some down-to-earth information of this kind would be needed. To condamn it on principles is a little like refusing to add salt to your menu to avoid coronary diseases. Sure, it's an extra step (adding salt too...). I understand that sometimes it could be better to avoid it.

But when? For whom? :)

Jellby
03-18-2012, 09:38 AM
What if the embedded smallcap font doesn't match the chosen/default font for the rest of the text? I'd rather have no smallcaps than smallcaps in a clashing font in that case.

roger64
03-18-2012, 11:09 AM
I have no clue. :) I will follow on for some weeks publishing with smallcaps and ask reader's feedback.

In the end, it's fairly possible, I decide to publish in dual mode, second choice being with all fonts stripped.

JSWolf
03-18-2012, 12:46 PM
If you like, I can post the samllcaps version of Charis SIL. Works very will on my 650 Charis SIL. Looks quite nice too.

frostschutz
03-18-2012, 12:57 PM
These can be added with as few as 60k to each EPUB.

60k is already quite a lot for A-Za-z in smallcaps. Most likely your font covers a much wider charset (which kind of makes sense, as your example also has to deal with accents and punctuation). But it's sad indeed if smallcaps is not part of the default functionality...

roger64
03-19-2012, 05:17 AM
If you like, I can post the samllcaps version of Charis SIL. Works very will on my 650 Charis SIL. Looks quite nice too.

Please, do it. Don't forget to join the @font-face declaration. It makes life easier.

60k is already quite a lot for A-Za-z in smallcaps. Most likely your font covers a much wider charset (which kind of makes sense, as your example also has to deal with accents and punctuation). But it's sad indeed if smallcaps is not part of the default functionality...

You are right on both points.

FontSquirrel provided me with the web-font of a regular smallcap of LinuxLibertine. I use now the ttf version.

It's true that I selected probably conservatively too many options (accents bien sūr and others) but I'm OK with the end result. I have other smallcaps about 30k each.

Smallcaps are not widespread.

if you publish using a world-widespread font, it misses smallcaps
if you embed everything, readers may not accept your book

I am trying now a small path in the middle, just embedding smallcaps. I'll see if it's working.

Freeshadow
03-19-2012, 06:15 AM
What I tought about was the possibility of a python script (because Fontforge is accepting it) which scans an epub for all used chars + variants (as mentioned smallcaps monospace naumerals and ligatures) per every used font passes said charlist to Fontforge which throws everything not on list out of the fonts. The script renames the stripped fontfiles and the replaces the still full-char fonts in the epub with the stripped ones.
Combined with the spec-compliant font encryption as shown on MR by pdurrant this would be a solution not only to save space but also to embed commercial fonts in an epub without distributing whole fontfiles, which should be in accordance with the licenses, being kind of the same thing that's done when you do embedding in PDFs

JSWolf
03-20-2012, 05:07 PM
Here are the Charis SIL Smallcaps fonts. They do look a lot better then simulated smallcaps.

Enjoy!