View Full Version : Inverse behaviour of fonts


ADelm
02-16-2013, 05:01 AM
Hi!

I did define in the stylesheet a font like this (example for p):
p
{
margin:0pt;
text-indent:1.5em;
text-align: justify;
font-family: "Rokwell",serif;
font-size: 1.00em;
widows: 2;
orphans: 2;
}
In another book I did suppress the font-family line.
I didn't define a @font-face.

I Calibre and in FBreader (under Windows 7) I defined the default font for serif as Rokwell. (I do have Rokwell on my computer)
The book with the defined font-family appears as sans-serif and the one without definition appears with Rokwell.
But in both cases, italics are sans-serif!

Any suggestion?

Should there always be an "src: url..." line in the definition of a @font-face

Thanks,

Alain

AlPe
02-16-2013, 09:38 AM
Have you tried


font-family: Rokwell, serif;


(no quotes)?

Otherwise, if you embed the font in the eBook, define it with @font-face in the CSS and it should work. (Note: Calibre has problems with embedded fonts.)

ADelm
02-16-2013, 10:56 AM
The problem is that Rockwell is not a free font.

Alain

AlPe
02-16-2013, 11:00 AM
I see.

Looking for the font (http://en.wikipedia.org/wiki/Rockwell_(typeface)), I have just noticed: "Rockwell" has a 'c', while your code above does not. Double check that.

BTW, for a better test of embedded fonts, I suggest to use Readium in Chrome or Lucifox in Firefox.

ADelm
02-16-2013, 02:36 PM
Thanks!

I'll follow your suggestions.
A,d report.

ADelm
02-16-2013, 05:00 PM
OK, the problem was the misspelled name of the font.
Everything seems all right now.
I'll make all checks.

JSWolf
02-19-2013, 10:42 PM
It might work if the font is installed on your computer. But it won't work if you want to read the ePub away from your computer. In that case, you have to embed the font(s).

JSWolf
02-19-2013, 10:44 PM
Hi!

I did define in the stylesheet a font like this (example for p):
p
{
margin:0pt;
text-indent:1.5em;
text-align: justify;
font-family: "Rokwell",serif;
font-size: 1.00em;
widows: 2;
orphans: 2;
}

To neaten up your CSS code...

p {
margin: 0;
text-indent: 1.5em;
text-align: justify;
font-family: Rockwell,serif
}

The lines I removed are because they are default values.

ADelm
02-25-2013, 07:14 AM
Thanks for the suggestion on cleaning the code.
I'll extend this to other parts of the style sheet.