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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-11-2010, 01:04 PM   #1
brewt
Boo-Frickety-Hoo-Erizer
brewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enough
 
brewt's Avatar
 
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
De-Ligature-ification

Ok, so I'm back at the font embedding thing.
One of the "good" reasons to use font embedding is so you can use all those really cool ligatures that are in font sets.
But, with a little (finally) successful font embedding in Calibre, I'm finding that some of them are getting stripped (like 'st'). And, the calibre reader doesn't apparently know what to do some of with them, so leaves a blank hole.

Attached is the pic, showing IE (which displays them correctly), Calibre and ADE.

I know, I know, don't use ligatures.

But I wanna!

-bjc
Attached Thumbnails
Click image for larger version

Name:	ligatures.jpg
Views:	475
Size:	202.9 KB
ID:	53222  
brewt is offline   Reply With Quote
Old 06-11-2010, 02:19 PM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
The proper way to deal with ligatures is not using them in your text, but rely on the rendering software to pick them when available. In other words, don't write anything special for "Th", "ffl" or "st", just write the usual individual letters. If you use a font that has ligatures for these combinations but the reader is not displaying them, complain to those responsible of the rendering software, the book itself is right.

By the way, note that in your sample, calibre is not using the same font (that's why some of the glyphs are not available), look at the W shape. As for splitting some ligatures, I think there is some checkbox to disable this.

Last edited by Jellby; 06-11-2010 at 02:22 PM.
Jellby is offline   Reply With Quote
Advert
Old 06-11-2010, 02:35 PM   #3
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
If you really want to get the alternate character forms in ADE, open the font in fontforge and find the actual address of the glyph (eg. the code for the st ligature in Minion is FB06), then insert that as a hexcode ( &xFB06; ).

Jellby is right, though.
charleski is offline   Reply With Quote
Old 06-11-2010, 02:42 PM   #4
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
But there's a remaining question of why it is that Calibre isn't using the right font. Calibre's viewer does support embedded fonts (though it's a bit buggy with them, in the same way that WebKit is generally, especially with fonts sharing the same family name—still, that's not the issue here). You've got to figure out why calibre isn't supporting the embedded fonts. Are you using some kind of obfuscation on the fonts?
frabjous is offline   Reply With Quote
Old 06-11-2010, 05:57 PM   #5
brewt
Boo-Frickety-Hoo-Erizer
brewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enough
 
brewt's Avatar
 
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
No obfustication. And my encrypterator is on the fritz (hence the pic and not the epub).

It seems that the Calibre Viewer is overriding my embedment with it's defaults, i.e., Times New Roman. Bleah. I don't see a switch to turn that off in the Calibre viewer - do I just not know where to look?

Or does Font Embedding only work with the calibre viewer if the fonts are in a certain place in the epub? Like in OEBPS, or Fonts, or something else? The epub shown had them in the root....

No, the Character for the [ st ] glyph was hand-replaced in the right version of the word 'staring' with Unicode character FB06 - it shows up correctly in the Internet Explorer rendition of the source xhtml. It seems that the conversion out of Calibre changed it from
<p class="MsoBodyTextFirstIndent">staring staring</p>
to
<p class="MsoBodyTextFirstIndent">staring staring</p>

I'm assuming that's by design - it can't have just 'accidently' done that.

And, why, yes, there is a "Keep ligatures" checky-boxy thingy in calibre's Look & Feel section, but it doesn't seem to work. Same results on or off. At least, not the way I'm pushing it....

And I can't seem to put my hand to a rendering display software solution (for epubs, anyway) that inserts ligatures when availalble. And don't get me started on kerning, or hyphenation, or or or....


-bjc
brewt is offline   Reply With Quote
Advert
Old 06-11-2010, 06:17 PM   #6
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
Quote:
It seems that the Calibre Viewer is overriding my embedment with it's defaults, i.e., Times New Roman. Bleah. I don't see a switch to turn that off in the Calibre viewer - do I just not know where to look?

Or does Font Embedding only work with the calibre viewer if the fonts are in a certain place in the epub? Like in OEBPS, or Fonts, or something else? The epub shown had them in the root....
As you probably know there's a way to choose your default fonts by clicking on the hammer button, but Calibre overrides those with embedded fonts for me.

They should be in the proper location relative to the CSS file that calls them. E.g., if the CSS file has

src: url("fontfile.otf") format("opentype");

then the font file should be in the same directory as the CSS file. If it says:

src: url("fonts/fontfile.otf") format("opentype");

then it should be in the fonts subfolder of the folder where the CSS file is, and so on.

Not sure how calibre handles this, but I do think it would be best practice to have these under OEBPS or a subfolder of OEBPS.

It might be worth posting the relevant portion of the CSS file so we can see if there might be issues.

Quote:
No, the Character for the [ st ] glyph was hand-replaced in the right version of the word 'staring' with Unicode character FB06 - it shows up correctly in the Internet Explorer rendition of the source xhtml. It seems that the conversion out of Calibre changed it from
<p class="MsoBodyTextFirstIndent">staring staring</p>
to
<p class="MsoBodyTextFirstIndent">staring staring</p>

I'm assuming that's by design - it can't have just 'accidently' done that.

And, why, yes, there is a "Keep ligatures" checky-boxy thingy in calibre's Look & Feel section, but it doesn't seem to work. Same results on or off. At least, not the way I'm pushing it....
I'd ask about that in the calibre forum, or else open a ticket on the calibre bug tracker.

Quote:
And I can't seem to put my hand to a rendering display software solution (for epubs, anyway) that inserts ligatures when availalble. And don't get me started on kerning, or hyphenation, or or or....
Newever versions of Firefox do automatic ligature substitution for OpenType fonts. (Well, the common ones anyway--probably not the historical ones like st and ct.) So ePub software built on Firefox like EPUBReader will do it. Of course, I'm not aware of any mobile devices to which that applies, save Netbooks and the like.

With hyphenation and kerning you're probably out of luck. You could use Jellby's script to convert the ePub to suitably-formatted PDF via PrinceXML, however, with kerning and hyphenation.

Last edited by frabjous; 06-11-2010 at 06:22 PM.
frabjous is offline   Reply With Quote
Old 06-11-2010, 06:38 PM   #7
brewt
Boo-Frickety-Hoo-Erizer
brewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enough
 
brewt's Avatar
 
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
If I really wanted to do the h&j bit, I'd just build pdfs out of Indesign. That is something it's actually good for, unlike epubbing. But thanks - epubs/mobi solves more problems for me at the moment that hard-coded page sizes don't.

I think my css calls are ok - the fonting works in ADE and B&N, which are fussier than calibre, most of the time.

No, my calibre viewer is always set to override all fonts every tiime no matter what the epub source - by my hand, indesign, the best of the boards here. I must be doing something wrong. I'll try to come up with a sensible demo when I get my encrypterator spun up again.

But thanks.

-bjc
brewt is offline   Reply With Quote
Old 06-11-2010, 08:32 PM   #8
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
If your source is already xhtml, then I'd really recommend using Sigil instead of calibre. I've spent too much time cleaning up conversions that were done in calibre.
charleski is offline   Reply With Quote
Old 06-11-2010, 10:19 PM   #9
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
Out of curiousity, what version of calibre are you using? Mine (0.6.51) definitely does embedded fonts.



You might ask about it in the calibre forum.
frabjous is offline   Reply With Quote
Old 06-12-2010, 12:21 AM   #10
brewt
Boo-Frickety-Hoo-Erizer
brewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enough
 
brewt's Avatar
 
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
Quote:
Originally Posted by frabjous View Post
Out of curiousity, what version of calibre are you using? Mine (0.6.51) definitely does embedded fonts.
Todays: 7.2

And yes, I remember earlier versions having embedded fonts override what I could pick (in the viewer).

And I still prefer calibre over sigil - multi-format output is easier there when the css is different for mobi than epub (yes, it's true, I do things the hard way when possible), and I just got the font embedding plugin to work,and I can encrypt again, and all is weller with the world for my needs in calibre.

-b
brewt is offline   Reply With Quote
Old 06-12-2010, 05:22 AM   #11
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
You are not using a custom css in calibre viewer that has "!important" for fonts, are you?

Maybe the font is in a format calibre does not support. I think I tried it with TTF and it worked, but I've never tried OTF. Or maybe the font is not correctly embedded, and ADE and Explorer are using the version of the font installed in your system, not the embedded one, while calibre just doesn't use the embedded one and picks a default instead.

Why don't you post a sample epub, so we can test?
Jellby is offline   Reply With Quote
Old 06-12-2010, 12:06 PM   #12
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
The reason why calibre is having problems displaying embedded fonts is because QtWebKit has problems displaying embedded fonts.

See this bug.

That bug is the #1 reason why Sigil doesn't have explicit font embedding support.
Valloric is offline   Reply With Quote
Old 06-12-2010, 12:41 PM   #13
brewt
Boo-Frickety-Hoo-Erizer
brewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enough
 
brewt's Avatar
 
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
My font call in the css has no !Important!'s on it. the font family reads like this:

Code:
font-family:"Minion Pro","Dutch801 Rm BT","Times New Roman","Goudy Old Style","Baskerville Old Face","Georgia",serif;
The font being used by Calibre viewer is indeed Times New Roman, despite me having the sony Dutch Roman properly installed on my system; if css rules are being followed, shouldn't they go in order if the first one isn't usable/available?

Clearly (at least to me), Calibre viewer 7.2 is overriding the embedment with it's defaults. And yes, I can set those defaults to Minion and have it work 'better'. I've had minion work out before as embedded (ade picks up the embedded font, even if I remove it from my system fonts directory) as an otf - hain't got a ttf version.

I just got my encrypter off its knees last night; I come up with an intelligible demo epub to post.

Seems odd to me that as font embedding is part of the spec that the implementation of it in the viewers is so spotty. I mis-spake earlier; my B&N PC Viewer doesn't seem to utilize embedded fonts - any body have luck seeing embeddings on a real nook or the viewers?

-bjc
brewt is offline   Reply With Quote
Old 06-12-2010, 01:19 PM   #14
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by brewt View Post
My font call in the css has no !Important!'s on it. the font family reads like this:

Code:
font-family:"Minion Pro","Dutch801 Rm BT","Times New Roman","Goudy Old Style","Baskerville Old Face","Georgia",serif;
The font being used by Calibre viewer is indeed Times New Roman, despite me having the sony Dutch Roman properly installed on my system; if css rules are being followed, shouldn't they go in order if the first one isn't usable/available?
Is that the css inside the book or the "user css" of calibre viewer? The second is what I was asking about.

Then, one should make sure the font names specified are the correct ones, in the case of embedded fonts they should match the names given in the @font-face, for system-installed fonts, it could be anything.

But I can tell you calibre (0.7.0) can work with embedded fonts, as the attached screenshot shows. The title and drop-cap fonts are embedded in the ePUB, and they are not installed in this computer. If you are worried about embedding an un-obfuscated version of a commercial font, try with a free font instead and post a sample file, please.
Attached Thumbnails
Click image for larger version

Name:	screenshot.png
Views:	307
Size:	120.5 KB
ID:	53268  
Jellby is offline   Reply With Quote
Old 06-12-2010, 02:02 PM   #15
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
Quote:
Originally Posted by Valloric View Post
The reason why calibre is having problems displaying embedded fonts is because QtWebKit has problems displaying embedded fonts.

See this bug.

That bug is the #1 reason why Sigil doesn't have explicit font embedding support.
That bug is indeed very annoying, but it is possible to get around it by modifying the embedded fonts so that they all contain distinct font family names. I did that for the ePub available here, and now it supports all the font variants in calibre's viewer.

But I don't think this is the issue here. Brewt isn't getting any of the fonts in the family to show.
frabjous 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
Trying to understand re-css-ification. brewt Calibre 10 12-08-2009 03:27 PM


All times are GMT -4. The time now is 10:06 AM.


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