View Single Post
Old 12-20-2013, 06:02 PM   #1
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
@media amzn-kf8 and @font-face

According to --

http://www.bergsland.org/2012/10/ann...blishing-wins/

Quote:
It should be okay for EPUB. For the KF8, the @font-face rule need to be inside the Amazon KF8 query, like this:

@media amzn-kf8{

/*== @font-face rules can go below here, but above the closing brace ==*/

}
So to get my embedded fonts to display on the Kindle, I have a Style sheet

Code:
@media amzn-kf8{

@font-face {
    font-family: 'AmeriGarmnd BT';
    font-weight: normal;
    font-style: normal;
    src: url('../Fonts/AmeriGarmnd BT Roman.ttf');
}

@font-face {
    font-family: 'AmeriGarmnd BT';
    font-weight: bold;
    font-style: normal;
    src: url('../Fonts/AmeriGarmnd BT Bold.ttf');
}

@font-face {
    font-family: 'AmeriGarmnd BT';
    font-weight: normal;
    font-style: italic;
    src: url('../Fonts/AmeriGarmnd BT Italic.ttf');
}

@font-face {
    font-family: 'AmeriGarmnd BT';
    font-weight: bold;
    font-style: italic;
    src: url('../Fonts/AmeriGarmnd BT Bold Italic.ttf');
}

}
It seems to display correctly on the Touch, but .... the new Calibre epub editor displays an error saying "@font-face cannot be in @media and will be ignored"

Searching seems to indicate that you cannot have @font-face inside a @media, but it does seem to work

Question -- Is the Calibre error message wrong, or am I, or is there a better way to handle embedded fonts?

I didn't know there was a @media 'thing' until a few days ago

Paul
phossler is offline   Reply With Quote