View Single Post
Old 05-12-2013, 11:23 AM   #5
Anak
Guru
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 603
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
I know there is another issue when two different font families are used.
A sans-serif font for headers and a serif font for bread text.
The user agent (device) should use its default font family for sans serif and serif fonts. No actual fonts are embedded in the epub/kepub it self.

The regular epub shows the headers with sans-serif font (correct).
The kepub uses the serif font for headers (incorrect).

In this example different font families were used for header an non-header text but applies to every element (or class) for which a different font family is defined.

Just use the code below in a normal epub 2 package.

Simple css
Code:
body {
margin:0;
font-family:serif; /* use the default ua serif font */
font-size:100%;
font-weight:normal;
font-style:normal;
font-variant:normal;
line-height:1.3em;
text-indent:0;
text-align:justify;
}
h1,h2,h3,h4 {
font-family:sans-serif; /* telling the ua to use a sans-serif font (override default font setting (body tag)*/
}
p {
margin:0; /* p tag: no specific font settings use the default font  as defined in body tag */
padding:0;
}
Simple html file
Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <link href="../Styles/Style0001.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <h2>This headline (h2-tag) should use the default ua sans-serif font.</h2>

  <p>This is the bread text and should be displayed with the default ua serif font.</p>
</body>
</html>

Last edited by Anak; 05-12-2013 at 03:19 PM.
Anak is offline   Reply With Quote