Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 01-25-2013, 09:43 PM   #1
xrm0
Member
xrm0 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2013
Location: Argentina
Device: Kindle
iBooks sans-serif weirdness

Although by the title it may look this is the same as the thread at Sans-serif fonts and iBooks it isn't.

I've got an epub show text in sans in iBooks without embedding fonts nor adding com.apple.ibooks.display-options.xml but somehow in one file, a line of text in sans serif is rendered as serif.

There's a test case epub attached. You'll see three pages, nearly identical:

Section0001:
Code:
<p>no font family specified</p>
<p class="serif">serif</p>
<p class="sans">sans-serif</p>
<p class="serif"><span class="sans">initially serif, overridden with sans-serif</span></p>
Section 01 screenshot:


Section0002:
Code:
<p>no font family specified</p>
<p class="serif">serif</p>
<p class="sans">sans-serif</p>
<p class="sans"><span class="serif">initially sans-serif, overridden with serif</span></p>
Section 02 screenshot:


And here's what I don't understand.

Section0003:
Code:
<p>no font family specified</p>
<p class="serif">serif</p>
<p class="sans">sans-serif</p>
<p class="serif"><span class="sans">initially serif, overridden with sans-serif</span></p>
<p class="sans"><span class="serif">initially sans-serif, overridden with serif</span></p>
Section 03 screenshot:


In this last file, the <p> with the text "sans-serif" is rendered as serif. Does anyone know why this happens? Am I doing something wrong or it's a bug?

The serif and sans css classes are defined as:
Code:
.serif {
  font-family: serif;
}

.sans {
  font-family: sans-serif;
}
Spoiler:
After finishing writing this post I've realized I had a typo (overriden), I've changed it in the post/epub but not on the screenshots!
Attached Thumbnails
Click image for larger version

Name:	section-1.jpg
Views:	718
Size:	13.1 KB
ID:	100063   Click image for larger version

Name:	section-2.jpg
Views:	738
Size:	13.2 KB
ID:	100064   Click image for larger version

Name:	section-3.jpg
Views:	769
Size:	16.1 KB
ID:	100065  
Attached Files
File Type: epub ibooks-sans.epub (3.0 KB, 218 views)
xrm0 is offline   Reply With Quote
Old 01-25-2013, 10:28 PM   #2
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Adding the following com.apple.ibooks.display-options.xml file:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<display_options>
    <platform name="*">
        <option name="specified-fonts">true</option>
    </platform>
</display_options>
in the META-INF folder appears to fix this problem, so this is probably a curious quirk behavior designed to avoid some problem that the iBooks folks saw with old, broken eBooks.

I would strongly suggest just adding the file. It will save you lots of problems and head scratching.
dgatwood is offline   Reply With Quote
Advert
Old 01-26-2013, 12:30 AM   #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
Quote:
Originally Posted by dgatwood View Post
Adding the following com.apple.ibooks.display-options.xml file:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<display_options>
    <platform name="*">
        <option name="specified-fonts">true</option>
    </platform>
</display_options>
in the META-INF folder appears to fix this problem, so this is probably a curious quirk behavior designed to avoid some problem that the iBooks folks saw with old, broken eBooks.

I would strongly suggest just adding the file. It will save you lots of problems and head scratching.
Thanks for the information. Could you point me please to some source where I can read up on this file?
AlexBell is offline   Reply With Quote
Old 01-26-2013, 02:39 PM   #4
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
If you're registered as a book publisher with iTunes, download the iBookstore Asset Guide. Otherwise, the following links cover it fairly well:

http://authoradventures.blogspot.com...s-part_24.html

http://ideate.verioiponly.com/Noir%2...sMiniguide.pdf
dgatwood is offline   Reply With Quote
Old 01-27-2013, 01:00 AM   #5
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
Quote:
Originally Posted by dgatwood View Post
If you're registered as a book publisher with iTunes, download the iBookstore Asset Guide. Otherwise, the following links cover it fairly well:

http://authoradventures.blogspot.com...s-part_24.html

http://ideate.verioiponly.com/Noir%2...sMiniguide.pdf
Thanks, dgatwood. I'm not an Apple user, so I looked at the two guides. Is the file only used in fixed layout ePubs?
AlexBell is offline   Reply With Quote
Advert
Old 01-27-2013, 08:15 AM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
From what I understand it fixes some quirkiness on flowable books as well. I just include it in all my ebooks in case someone really wants to use iBooks. It's a very small file and doesn't add to the size of the book anymore than some of the other 'hacks' we have to do to accomodate devices/apps inconsistent implementations.
I just have the file already incorporated into my template when I create a new ePub (I use Sigil) so I don't ever have to think about it being there.

Cheers!
Turtle91 is offline   Reply With Quote
Old 01-27-2013, 05:43 PM   #7
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by AlexBell View Post
Thanks, dgatwood. I'm not an Apple user, so I looked at the two guides. Is the file only used in fixed layout ePubs?
No. Many fonts won't work on iBooks reflowable without it.

Hitch
Hitch is offline   Reply With Quote
Old 01-27-2013, 08:02 PM   #8
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by AlexBell View Post
Thanks, dgatwood. I'm not an Apple user, so I looked at the two guides. Is the file only used in fixed layout ePubs?
No, but with the exception of the specified-fonts option, all the other options are specific to fixed-layout EPUB books, IIRC.

In other words, the snippet I posted is pretty much everything that reflowable book authors need to know or care about, AFAIK.
dgatwood is offline   Reply With Quote
Old 01-27-2013, 11:53 PM   #9
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 again.
AlexBell is offline   Reply With Quote
Reply

Tags
ibooks, sans, sans-serif


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sans-serif fonts and iBooks Adjust ePub 17 01-26-2013 07:31 PM
Which typeface should use for ebook, Serif or Sans-serif droople Workshop 8 06-13-2010 07:20 AM
Serif or Sans Serif for readability? kilofox Amazon Kindle 19 02-20-2009 02:22 PM
Serif and Sans-Serif fonts in Libprs500 benong Calibre 1 02-06-2008 04:43 AM
Do you prefer the Reader's serif or its sans serif font? (poll) Alexander Turcic Sony Reader 9 11-25-2006 12:15 PM


All times are GMT -4. The time now is 11:28 PM.


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