Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
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
Old 12-20-2013, 10:07 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
As per the CSS spec you do not put @font-face inside @media, which is why calibre warns you about it.

As far as I know, there is no need to put them inside @media for azw3, just use them the same as you would in epub, they will work.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-21-2013, 11:25 AM   #3
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
Thank you

1. Your answer helped me to find a CSS mistake in a related style sheet.

2. The more robust debug (compared to Sigil) also points out an issue with the 4 variations of the embedded font (R, B, BI, and I) not having the same family name, but each has a unique family name (FONTNAME, FONTNAME-BOLD, FONTNAME-ITALIC", etc.)

I have some more work to do

Thanks again

Paul
phossler is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle Previewer Font Face grayed out? katl Kindle Formats 7 05-01-2013 05:44 PM
Am I using @font-face correctly? phossler Sigil 12 11-30-2012 04:38 PM
Font size problems with KF8 - solved Tugger Kindle Formats 21 10-05-2012 09:47 AM
KF8, Sigil, and font size Paddlin Kindle Formats 0 04-24-2012 05:41 PM
TWO OPF files or something like Media Queries in the OPF file for KF8 and MOBI? DHahn Kindle Formats 3 04-17-2012 04:06 AM


All times are GMT -4. The time now is 12:25 AM.


MobileRead.com is a privately owned, operated and funded community.