Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-08-2012, 12:42 AM   #1
ElMiko
Addict
ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.
 
ElMiko's Avatar
 
Posts: 286
Karma: 56788
Join Date: Jun 2011
Device: Kindle
CSS: font-family fallbacks

is there any way to make a font-family fallback a font-style?

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."
ElMiko is offline   Reply With Quote
Old 02-08-2012, 12:11 PM   #2
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
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.
DaleDe is offline   Reply With Quote
 
Enthusiast
Old 02-08-2012, 01:21 PM   #3
ElMiko
Addict
ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.
 
ElMiko's Avatar
 
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."
ElMiko is offline   Reply With Quote
Old 02-08-2012, 02:01 PM   #4
Keroberos
Zealot
Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.
 
Keroberos's Avatar
 
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;
}
With this styling in your XHTML,

Code:
<span class="somefont">Text</span>
Then if the reader doesn't support the embedded font it displays in italics of the default font.
Keroberos is offline   Reply With Quote
Old 02-08-2012, 03:43 PM   #5
ElMiko
Addict
ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.
 
ElMiko's Avatar
 
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."
ElMiko is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 05:36 AM.


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