Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 05-23-2012, 06:30 AM   #1
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
Embedding italics

I've spent that last couple of days groping around trying to embed DejaVuSans.ttf font into an ebook I'm preparing which uses the full range of Greek characters - including those with accents and diacretics - and has some of the English and Greek Words italicised. So far I can get the full range of Greek characters to show on my Sony PRS T1, Kindle3 (after converting with calibre), and iPad/iBooks.

But though the italics show on the Kindle and iPad they don't show on the Sony.

I'm using the CSS below:

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

body {
margin: 0; padding: 0; border-width: 0;
font-size: 95%;
text-align: justify;
line-height: 120%;
font-familyejaVuSans; DejaVuSans-Oblique;
}

with
<item href="Fonts/DejaVuSans.ttf" id="DejaVuSans.ttf" media-type="application/x-font-ttf" />
in the content.opf file.

If I add

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

to the stylesheet file and

<item href="Fonts/DejaVuSans-Oblique.ttf" id="DejaVuSans-Oblique.ttf" media-type="application/x-font-ttf" />

to the content.opf file all the text is italicised on the Sony, not just those parts around which I've put <i></i> tags.

What am I doing wrong? Is there a font I can embed which does not need a
an italicised font to be embedded? And why do the <i></i> tags work in mobi and on the iPad but not on the Sony?

Edit: I've no idea why the big grin smilie shows above - I certainly didn't put it there.
AlexBell is offline   Reply With Quote
Old 05-23-2012, 07:55 AM   #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,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
You need to embed both files, and to add both @font-face rules:

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

@font-face {
 font-family: 'DejaVuSans';
 src: url(Fonts/DejaVuSans-Oblique.ttf);
 font-weight: normal;
 font-style: italic;
}
Note the green parts are the same, the red parts are different.

Now it should be possible to have:

Code:
<p style="font-family: 'DejaVuSans'">Some <i>italic</i> words.</p>
(or with an external CSS instead of the "style" attribute)
Jellby is offline   Reply With Quote
Advert
Old 05-23-2012, 07:34 PM   #3
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
Thanks so much, Jellby, I'm off to make the corrections.

It works! I've done my first embedded font ebook!

Thanks again, Jellby, I really appreciate your patience and your clear instructions.

Last edited by AlexBell; 05-23-2012 at 08:18 PM. Reason: Happy little man today.
AlexBell is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Italics, Bold, Etc. Arekuzanra Amazon Kindle 14 03-09-2014 11:01 PM
Unwanted Italics linzerkipferl Conversion 5 02-18-2012 12:23 PM
problem with italics bobcdy Sigil 12 08-14-2011 08:04 AM
Italics and cover markjoseph ePub 4 02-18-2011 02:00 PM
No italics roquet Bookeen 18 04-26-2009 03:57 PM


All times are GMT -4. The time now is 05:16 PM.


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