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;
}