View Single Post
Old 01-25-2013, 09: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:	276
Size:	13.1 KB
ID:	100063   Click image for larger version

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

Name:	section-3.jpg
Views:	283
Size:	16.1 KB
ID:	100065  
Attached Files
File Type: epub ibooks-sans.epub (3.0 KB, 33 views)
xrm0 is offline   Reply With Quote