View Single Post
Old 05-22-2010, 04:47 PM   #15
jswinden
Nameless Being
 
BTW, part of the confusion is probably due to the fact we are using a standard font name Georgia for the font-family name, for example "Georgia". You could name your font family whatever you want to. For example, you could name it "MSJim". In that case the CSS would look like this:

@font-face {
font-family: "MSJim";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/georgia.ttf);
}
@font-face {
font-family: "MSJim";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/georgiab.ttf);
}
@font-face {
font-family: "MSJim";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/georgiai.ttf);
}
@font-face {
font-family: "MSJim";
font-weight: bold;
font-style: italic;
src: url(res:///Data/fonts/georgiaz.ttf);
}

body { font-family: "MSJim", serif; }


In this example, a statement like body { font-family: Georgia, serif; } located within an HTML document will cause the web browser to use the Georgia font to display the text. But the same statement in an ePub book would result in the Sony Reader being unable to interpret this statement and would instead display the ePub text in the Reader's default serif font. Why? Because the Sony Reader cannot interpret font names directly, fonts must be defined through @font-face statements.

In this example, a statement like body { font-family: "MSJim, serif; } in an ePub book would tell the Sony Reader to use the MSJim font family. The Reader would then lookup the specifics on the MSJim font family, note that it uses the Georgia font, and thus display the text using the Georgia font.
  Reply With Quote