![]() |
#16 |
Booklegger
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
|
You might try "font-style oblique;" as that is perhaps more likely computed anyway. My CSS book is mostly for browsers, but it might be allowed in ADE.
Edit: For ADE, using a fall-back generic seems to work OK - from this span class: .TurinTalk { font-family: "Hand Me Down S (BRK)", sans-serif; font-style: italic; } I do get italic sans-serif text... from this: .subvocal { font-family: "Hand Me Down S (BRK)", sans-serif; } I get the hand-me-down font used. So try a fall-back in the class definition -not in the @font-face definition, as you may recall ![]() Last edited by pholy; 08-29-2010 at 07:39 PM. Reason: further testing... |
![]() |
![]() |
![]() |
#17 | |
Zealot
![]() ![]() ![]() ![]() ![]() Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
|
Quote:
![]() I'll give this a try and see what happens. Thanks! |
|
![]() |
![]() |
Advert | |
|
![]() |
#18 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
Quote:
@font-face { font-family: "BlackChancery"; font-style: normal; font-weight: normal; src:url(../Fonts/BlackChancery.ttf) format(opentype);; } So that's telling the renderer that this font file corresponds to the normal weight and normal style of the BlackChancery font. But then in your xhtml you tell it you want the text rendered in BlackChancery italic. The renderer looks at the fonts it has available and finds that none correspond to BlackChancery italic, so it falls back to the default font. I'm afraid this is a case of computers having the irritating habit of trusting that you mean what you tell them ![]() You don't need to include the font-style and font-weight attributes, they're used when you embed different font files for the same family so that you get proper bold and italics. If you want to use both BlackChancery roman and BlackChancery italic you need to embed two font files, one for each style, give them the same font-family name, and indicate the difference through the font-style attribute. Last edited by charleski; 08-29-2010 at 10:52 PM. |
|
![]() |
![]() |
![]() |
#19 |
Booklegger
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
|
An evil Hack, or maybe a kluge...
If I change the font-style in my @font-face definition to italic, and leave the span class definition as
.TurinTalk { font-family: "Hand Me Down S (BRK)", sans-serif; font-style: italic; } then in ADE I get the hand-me-down font used, and in fb2 (which doesn't do embedded fonts) I get the default font with italic rendering... Is that sort of like what you wanted, Jane? I think something like that may be the only way to get a fall-back generic font to render with a style. As long as you don't try to use the same font with different styles, I think it works OK. But I think it's kind of ugly... Does anybody think it would be acceptable? On the other hand, if hand-me-down was an italic font, you would want to say so in the @font-face, and you would have to use italic in the class definition, so maybe it is OK? How many epub readers don't do embedded fonts (besides iPads, of course)? (And on iPads, you can specify up to five of the 30-some available fonts.) Last edited by pholy; 08-29-2010 at 11:58 PM. Reason: more musings |
![]() |
![]() |
![]() |
#20 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
What is unacceptable is generating an 'italic' from a roman font simply by shifting its axis 30°. Luckily ADE refuses to inflict this sort of carnage. Italic is not 'rendered', it's a completely different font and therefore needs to have a separate font defined in the css.
|
![]() |
![]() |
Advert | |
|
![]() |
#21 | |
Booklegger
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
|
Quote:
As I recall, Jane was using a cursive font in some places, and wanted a fall-back to show up as italic to distinguish it from the rest of the text. I was using the hand-me-down because I had it handy, and I wanted to see if parens in the font name caused a problem (they don't). Setting the font-style of a cursive font to italic is not so far-fetched, and then setting the font-style in the class definition would be required (I think) to use that font-face. I haven't dug into CSS enough yet to know for sure, though. I'm guessing that font engines must know how to apply styles and weights to their generic fonts, because we can't supply @font-face definitions to them anyway. Jane, does this help any? |
|
![]() |
![]() |
![]() |
#22 |
Zealot
![]() ![]() ![]() ![]() ![]() Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
|
Hey, guys! I think you've done it! Thanks. Pholy...you're absolutely correct re my goals, and charlesky, thanks for the explanation. I was kinda figuring that out. I just wanted the written letters/notes to show up differently, whether embedded fonts worked or not on the reader.
I agree, an ad hoc ital is uuuuugly, but I'm trying to accommodate all readers. I've done as you suggest, Pholy, and it's lookin' good in all readers I have available to test. Hand me down is a scritchy font anyway. Not meant to be pretty. ![]() Thanks again!!!! |
![]() |
![]() |
![]() |
#23 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
You still need to define the font as italic in your @font-face
@font-face { font-family: "Hand Me Down S (BRK)"; font-style: italic; font-weight: normal; src:url(../Fonts/handmeds.ttf) format(opentype); } .TurinTalk { font-family: "Hand Me Down S (BRK)", sans-serif; font-style: italic; } will work, but @font-face { font-family: "Hand Me Down S (BRK)"; font-style: normal; font-weight: normal; src:url(../Fonts/handmeds.ttf) format(opentype); } .TurinTalk { font-family: "Hand Me Down S (BRK)", sans-serif; font-style: italic; } won't. |
![]() |
![]() |
![]() |
#24 |
Booklegger
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
|
Thanks, Charleski. That is what I had done. I guess I just got tired of all the cut and paste between postings. It is best to have it all completely clear.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Merging multiple HTML files into one HTML file | skoobwoman | Workshop | 45 | 07-11-2014 10:46 AM |
Calibre Recipe HTML content differs from raw html of index.html. | krunk | Calibre | 4 | 09-20-2010 09:48 PM |
HTML Book + non HTML TOC to epub | aarcane | Calibre | 4 | 03-02-2010 02:58 AM |
HTML to ??? | Yayafava | Workshop | 2 | 02-23-2010 11:32 PM |
Can we do this in HTML? | Nate the great | Workshop | 17 | 08-04-2009 11:02 AM |