View Full Version : Basic CSS Font family question!


kjk
05-27-2010, 12:53 PM
Hi,
If I call out:
font family: Georgia,"Times New Roman", serif;

My understanding is that if the system can find Georgia, it uses Georgia. If it can't find Georgia, it uses Times New Roman, and if it can't find THAT it defaults to whatever serif font it CAN find :p

But I have been playing with an ePub, and if I call out-
font family: Georgia;
I definitely get Georgia.
if I call out-
font family: Georgia, serif;
I definitely don't get Georgia, I get Times.

Am I just not understanding the font family order thing?

frabjous
05-27-2010, 01:15 PM
It has to be font-family with a hyphen in the middle. Not "font family" with no hyphen. That shouldn't do anything at all.

What program/device are you using to view these ePubs?

In most browsers, the generic "serif" font is not "whatever it can find", but rather whatever is set as the default serif font in the Browser preferences. (E.g., under "Edit > Preferences > Content > Fonts & Colors > Advanced" in Firefox.) You can set that as some crazy sans-serif font if you wanted. Otherwise, you understand how things should work. A lot of ePub viewers don't support these parts of CSS as well as they should, however.

kjk
05-27-2010, 01:28 PM
It has to be font-family with a hyphen in the middle. Not "font family" with no hyphen. That shouldn't do anything at all.

What program/device are you using to view these ePubs?

In most browsers, the generic "serif" font is not "whatever it can find", but rather whatever is set as the default serif font in the Browser preferences. (E.g., under "Edit > Preferences > Content > Fonts & Colors > Advanced" in Firefox.) You can set that as some crazy sans-serif font if you wanted. Otherwise, you understand how things should work. A lot of ePub viewers don't support these parts of CSS as well as they should, however.

Thanks, frabjous! Ok, I did have font-family with a hyphen, sorry about that :o.

I'm just testing with Calibre and Sigil right now-will try it in some other viewers to see what is up.