Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-05-2012, 05:54 PM   #1
Elfwreck
Grand Sorcerer
Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.
 
Elfwreck's Avatar
 
Posts: 5,142
Karma: 24387938
Join Date: Nov 2008
Location: SF Bay Area, California, USA
Device: Clié; PRS-505; EZR Pocket Pro, PRS-600, Kobo Mini
Font embed: works on computer, not on device

I'm using Sigil to make an epub with embedded fonts (embedded font, really, except there's a regular & bold version & I'm using both of those), and it shows up fine on my computer, both in Sigil and in ePubreader-for-Firefox. But when I load it on a portable device, I get the default serif font only.

This happens on three different devices (two e-ink and one tablet), so it's not any particular device settings. It doesn't show up on ADE on a different computer, so I think my copy is checking my Windows fonts rather than the ones in the ePub. What am I doing wrong with the font embedding?

CSS snippet--
Code:
p.body {

     font-family: WellrockSlab, serif;
src:url("../Fonts/WellrockSlab.ttf");
text-indent: 2em;
text-align: justified;
margin: 0em .5em 0em;
  }
The font's in the Fonts folder in the ePub.
Elfwreck is offline   Reply With Quote
Old 02-05-2012, 06:20 PM   #2
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 1,990
Karma: 4633978
Join Date: Dec 2010
Device: Kindle PW2
AFAIK, @font-face is required for the definition of embedded fonts. For example:

Code:
@font-face {
    font-family: 'DejaVu Sans';
    src: url(../Fonts/DejaVuSans.ttf);
}

body { 
   font-family: 'DejaVu Sans', serif;
}
Note that if you define multiple variants of an embedded font, it might not be correctly displayed in BV, because of a Qt Framework bug.
See this post for more information.

Last edited by Doitsu; 02-05-2012 at 06:27 PM.
Doitsu is offline   Reply With Quote
Old 02-05-2012, 07:31 PM   #3
Elfwreck
Grand Sorcerer
Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.
 
Elfwreck's Avatar
 
Posts: 5,142
Karma: 24387938
Join Date: Nov 2008
Location: SF Bay Area, California, USA
Device: Clié; PRS-505; EZR Pocket Pro, PRS-600, Kobo Mini
Quote:
Originally Posted by Doitsu View Post
AFAIK, @font-face is required for the definition of embedded fonts. For example:

Code:
@font-face {
    font-family: 'DejaVu Sans';
    src: url(../Fonts/DejaVuSans.ttf);
}

body { 
   font-family: 'DejaVu Sans', serif;
}
When I put that in the css file, I lose all the custom font formatting and it shows up in default sans-serif.

Without that, it displays fine in Sigil and on my computer in ePubreader, but doesn't work on my Sony or PEZ. (Shows up as default serif on ADE on a different computer.)

If I put single quotes around the font name, the font doesn't show up. I'm not sure if the font name with quotes should be one word or two, nor how I'd figure that out.
Elfwreck is offline   Reply With Quote
Old 02-06-2012, 04:23 AM   #4
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 1,990
Karma: 4633978
Join Date: Dec 2010
Device: Kindle PW2
The syntax definitely works and epubs containing fonts embedded with this syntax display fine with ADE 1.72 (but not always with Sigil).
AFAIK, there are font embedding issues with some Sony ereaders.
For more information on font embedding in general, see Threepress Consulting's very detailed article How to embed fonts in ePub files.
Doitsu is offline   Reply With Quote
Old 02-06-2012, 12:22 PM   #5
Elfwreck
Grand Sorcerer
Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.
 
Elfwreck's Avatar
 
Posts: 5,142
Karma: 24387938
Join Date: Nov 2008
Location: SF Bay Area, California, USA
Device: Clié; PRS-505; EZR Pocket Pro, PRS-600, Kobo Mini
Thanks! I'll go over it more carefully. Looks like the quotes aren't actually part of the code; they're just used to indicate "name of your font goes here."

I've got two readers of my own (Sony & Astak) and a friend with a Galaxy tablet, plus Sigil, epubreader-in-Firefox, and ADE to test on. If I can get it working on just some of them I'll be happy.

I don't have any special characters or precision formatting to worry about; I'd just like fonts I think look nicer on ereaders than Times New Roman. (Embedded fonts for specialized formatting can happen later. Maybe a lot later. After I'm more comfortable with the CSS.)
Elfwreck is offline   Reply With Quote
Old 02-06-2012, 01:32 PM   #6
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 1,990
Karma: 4633978
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Elfwreck View Post
Thanks! I'll go over it more carefully. Looks like the quotes aren't actually part of the code; they're just used to indicate "name of your font goes here."
AFAIK, single or double quotes are only required, if the font name contains spaces.

If you haven't already done so, you also may want to validate your ePub in Sigil by clicking the green check mark symbol.

Also, just to be on the safe side, download the free MS Font properties extension. This will allow you to right-click your font to find out whether it can be legally embedded and whether it supports the Unicode range(s) that you need.

You can test whether your reader supports ePubs with embedded fonts with my simple Turkish test file from this thread. (Since ADE won't display all Turkish characters without embedded fonts, this is good test case.)

If all goes well, you should see a Turkish pangram with a couple of accented Turkish characters:

Pijamalı hasta yağız şoföre çabucak güvendi.

If some of them are displayed as question marks, the reader cannot handle embedded fonts:

Pijamalı hasta ya?ız ?oföre çabucak güvendi.

In that case, you might have to install additional fonts on your reader.

See also the How to embed fonts in ePub after Calibre thread for additional information.

Last edited by Doitsu; 02-06-2012 at 02:11 PM.
Doitsu is offline   Reply With Quote
Old 02-06-2012, 02:41 PM   #7
Elfwreck
Grand Sorcerer
Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.
 
Elfwreck's Avatar
 
Posts: 5,142
Karma: 24387938
Join Date: Nov 2008
Location: SF Bay Area, California, USA
Device: Clié; PRS-505; EZR Pocket Pro, PRS-600, Kobo Mini
Quote:
Originally Posted by Doitsu View Post
AFAIK, single or double quotes are only required, if the font name contains spaces.

If you haven't already done so, you also may want to validate your ePub in Sigil by clicking the green check mark symbol.
It validates fine. The fonts just don't show up on other devices.

Quote:
Also, just to be on the safe side, download the free MS Font properties extension. This will allow you to right-click your font to find out whether it can be legally embedded and whether it supports the Unicode range(s) that you need.
It's legal to embed, and has the symbols we need. (I think emdash is the most exotic symbol we've dealt with so far.)

Quote:
You can test whether your reader supports ePubs with embedded fonts with my simple Turkish test file from this thread. (Since ADE won't display all Turkish characters without embedded fonts, this is good test case.)
Thanks! I'll check that out when I'm at home with both ereaders.

Quote:
In that case, you might have to install additional fonts on your reader.
These are for distribution; "install fonts on the device itself" is not going to be an option. If they won't work on some readers, shrug; I just want them to work on the devices that *do* support embedded fonts in epubs.

Quote:
See also the How to embed fonts in ePub after Calibre thread for additional information.
I am, so far, staying away from Calibre; I don't need a combination library-and-conversion program, and the library functions are just so much clutter for me. (I'd love a library program for my ebooks. Calibre isn't going to be it; too many problems with multiple versions of the same book for different purposes.)
Elfwreck is offline   Reply With Quote
Old 02-06-2012, 03:08 PM   #8
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 1,990
Karma: 4633978
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Elfwreck View Post
Quote:
Originally Posted by Doitsu View Post
See also the How to embed fonts in ePub after Calibre thread for additional information.
I am, so far, staying away from Calibre; I don't need a combination library-and-conversion program, and the library functions are just so much clutter for me. (I'd love a library program for my ebooks. Calibre isn't going to be it; too many problems with multiple versions of the same book for different purposes.)
Actually, the thread has nothing to do with Calibre. It describes how to add embedded fonts to ePubs after conversion with Calibre. I.e. it's software-agnostic.

BTW, I did a quick test with the WellrockSlab font and it seems that ADE doesn't like it, even though the embedded font displays correctly in Sigil.
And since most epub reader manufacturers have licensed ADE, chances are your readers won't support it either.
You'll most likely have to choose a similar font or don't embed a font at all.

Last edited by Doitsu; 02-06-2012 at 03:27 PM.
Doitsu is offline   Reply With Quote
Old 02-07-2012, 12:52 AM   #9
Elfwreck
Grand Sorcerer
Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.
 
Elfwreck's Avatar
 
Posts: 5,142
Karma: 24387938
Join Date: Nov 2008
Location: SF Bay Area, California, USA
Device: Clié; PRS-505; EZR Pocket Pro, PRS-600, Kobo Mini
Quote:
Originally Posted by Doitsu View Post
BTW, I did a quick test with the WellrockSlab font and it seems that ADE doesn't like it, even though the embedded font displays correctly in Sigil.
And since most epub reader manufacturers have licensed ADE, chances are your readers won't support it either.
You'll most likely have to choose a similar font or don't embed a font at all.
Well, darn. I looked for similar fonts; Wellrock Slab was what we liked best out of what I found. I want a slab serif that's not fancy; there are no doubt plenty of them, but they're hard to find, because font sites have all sorts of bizarre headline and artsy fonts mixed in with the "normal" fonts.

Maybe Museo Slab would work better. For now, though, we may be content with default serifs for ADE-based ereaders.
Elfwreck is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Embed a font after the ePub is created. Adjust ePub 26 08-03-2011 01:09 AM
Classic Font and epub, what works on sony, now works on Nook too! ctos Barnes & Noble NOOK 26 07-25-2011 09:24 AM
embed font is too narrow - need help NASCARaddicted ePub 15 06-06-2011 10:00 PM
Embed a font in a PDF without making it huge Kosst Amojan PDF 4 11-21-2009 11:34 AM
how to embed unicode font atu1303 LRF 8 08-21-2009 10:06 PM


All times are GMT -4. The time now is 03:11 AM.


MobileRead.com is a privately owned, operated and funded community.