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 01-25-2013, 10:43 PM   #1
xrm0
Member
xrm0 began at the beginning.
 
Posts: 12
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:	298
Size:	13.1 KB
ID:	100063   Click image for larger version

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

Name:	section-3.jpg
Views:	309
Size:	16.1 KB
ID:	100065  
Attached Files
File Type: epub ibooks-sans.epub (3.0 KB, 43 views)
xrm0 is offline   Reply With Quote
Old 01-25-2013, 11: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.
 
Posts: 312
Karma: 1028382
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
Old 01-26-2013, 01: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: 2,335
Karma: 3943904
Join Date: May 2008
Location: Launceston, Tasmania
Device: Kindle3, Kobo Touch, Sony PRS T3, Nexus 7, iPad mini
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, 03: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.
 
Posts: 312
Karma: 1028382
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, 02: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: 2,335
Karma: 3943904
Join Date: May 2008
Location: Launceston, Tasmania
Device: Kindle3, Kobo Touch, Sony PRS T3, Nexus 7, iPad mini
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
Old 01-27-2013, 09:15 AM   #6
Turtle91
Guru
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: 669
Karma: 3807234
Join Date: Dec 2012
Location: Shannon, Ireland today
Device: iPhone 5/iPad 1&2/Surface Pro/Kindle PW
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, 06: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: 2,649
Karma: 15280959
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
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, 09: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.
 
Posts: 312
Karma: 1028382
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-28-2013, 12:53 AM   #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: 2,335
Karma: 3943904
Join Date: May 2008
Location: Launceston, Tasmania
Device: Kindle3, Kobo Touch, Sony PRS T3, Nexus 7, iPad mini
Thanks again.
AlexBell is offline   Reply With Quote
Reply

Tags
ibooks, sans, sans-serif

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 07:45 AM.


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