|
|
#1 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 286
Karma: 56788
Join Date: Jun 2011
Device: Kindle
|
CSS: font-family fallbacks
for example: I would like text to be in "Courier", but if it can't be displayed as "Courier", then I'd like it to display whatever font it does use in italics.
__________________
When some wild-eyed, eight-foot-tall maniac grabs your neck, taps the back of your favorite head up against the barroom wall, and he looks you crooked in the eye and he asks you if you've paid your dues, well, you just stare that big sucker right back in the eye, and you remember what ol' Jack Burton always says at a time like that: "Have ya paid your dues, Jack?" "Yessir, the check is in the mail." |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,699
Karma: 3644259
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2
|
Try: font-family:"Courier New", Courier, monospace;
The fallback is via a comma separated list with the last entry as generic as possible.
__________________
Dale DePriest http://pages.suddenlink.net/dalede or http://daledepriest.wikispaces.com currently using an EZ Reader or a Literati or my iPad. |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 286
Karma: 56788
Join Date: Jun 2011
Device: Kindle
|
right, I understand how the format works for creating font-family fallbacks. But my question was can i make a font-style a fallback for a font-family. The example you gave is for monospace font-families as fallbacks for a monospace font. As I said (almost verbatim), I want the fallback for "Courier" to be whatever font the device renders, but in italics.
__________________
When some wild-eyed, eight-foot-tall maniac grabs your neck, taps the back of your favorite head up against the barroom wall, and he looks you crooked in the eye and he asks you if you've paid your dues, well, you just stare that big sucker right back in the eye, and you remember what ol' Jack Burton always says at a time like that: "Have ya paid your dues, Jack?" "Yessir, the check is in the mail." |
|
|
|
|
|
#4 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 194002
Join Date: Aug 2009
Device: Nook Classic wi-fi, iPod Touch (Bluefire Reader)
|
Sounds like you want it to be in non italic Courier if the font is available and in an italic font if not. The way I would do it is to embed a non italic font in the epub (I don't think you can legally embed Courier though, you might have to find a similar font that you can embed), then use this CSS,
Code:
@font-face {
font-family: "somefont";
src: url(../Fonts/somefont.otf);
}
.somefont {
font-family: "somefont";
font-style: italic;
}
Code:
<span class="somefont">Text</span> |
|
|
|
|
|
#5 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 286
Karma: 56788
Join Date: Jun 2011
Device: Kindle
|
Keroberos, you exactly articulated my intent, thank you! Unfortunately, it seems that your answer is: No, you can't use styles as a fallback. Oh well, it's no great loss.
__________________
When some wild-eyed, eight-foot-tall maniac grabs your neck, taps the back of your favorite head up against the barroom wall, and he looks you crooked in the eye and he asks you if you've paid your dues, well, you just stare that big sucker right back in the eye, and you remember what ol' Jack Burton always says at a time like that: "Have ya paid your dues, Jack?" "Yessir, the check is in the mail." |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Font fail with Epub CSS | gregcd | Sony Reader | 0 | 10-28-2010 03:45 PM |
| Changing Font Family | thymaster | Sony Reader | 6 | 09-19-2010 01:10 AM |
| Basic CSS Font family question! | kjk | ePub | 2 | 05-27-2010 01:28 PM |
| Free Font Family für ePubs? | toertchn | Deutsches Forum | 3 | 05-24-2009 04:02 PM |
| Font Family should help Contrast | jbruce | Sony Reader | 31 | 04-17-2009 12:43 AM |