Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-29-2010, 07:23 PM   #16
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
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...
pholy is offline   Reply With Quote
Old 08-29-2010, 09:15 PM   #17
JaneFancher
Zealot
JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.
 
JaneFancher's Avatar
 
Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
Quote:
Originally Posted by pholy View Post
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
Hah! thou dost assume far greater capacity in CSS than I doth have. I make it up as I go along. Compare what happens when I change something.

I'll give this a try and see what happens. Thanks!
JaneFancher is offline   Reply With Quote
Advert
Old 08-29-2010, 10:40 PM   #18
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
Quote:
Originally Posted by JaneFancher View Post
This paragraph had four style codes, font size, font type, italics and an sgc_1 code that I think Sigil puts in. Once I had everything but the font type out, viola! BlackChancery appeared. Wheeee. I tried Arabella...and there it was. Wheeeee. Now, I began adding the other code back in. Font size went in OK. But if either the italics code or the sgc code was in, the font disappeared again.
In your css you defined the font as:
@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.
charleski is offline   Reply With Quote
Old 08-29-2010, 11:49 PM   #19
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
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
pholy is offline   Reply With Quote
Old 08-30-2010, 04:41 AM   #20
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
Quote:
Originally Posted by pholy View Post
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?
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.
charleski is offline   Reply With Quote
Advert
Old 08-30-2010, 08:46 AM   #21
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
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:
Originally Posted by charleski View Post
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.
Oh, yes, I forgot to make this clear; the hand-me-down font was rendered unchanged, exactly as it was before, only the fall-back font version was rendered as italic. Which was, I think, pretty much what Jane wanted.

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?
pholy is offline   Reply With Quote
Old 08-30-2010, 10:41 AM   #22
JaneFancher
Zealot
JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.
 
JaneFancher's Avatar
 
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!!!!
JaneFancher is offline   Reply With Quote
Old 08-30-2010, 02:26 PM   #23
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
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.
charleski is offline   Reply With Quote
Old 08-30-2010, 10:02 PM   #24
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
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.
pholy is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 07:22 PM.


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