Quote:
Originally Posted by Tony_A20
Hello Hitch, thanks for your reply.
I'm at the research stage. I haven't tried to embed a font. I've read this thread carefully and know that getting the code correct in the HTML doc, CSS, and OPF is essential. I also realize the apparently good possibility that an embedded font will be stripped.
I want to improve the odds of success by starting as close as possible to a working example because I don't yet have a firm grasp of the embedding process. What is simple and easy to you, is unknown territory to me.
I know about fontsquirrel, I have Calibre with the unpack plugin—just recently installed—and for e-book testing I have been using the Kindle Previewer, Kindle for PC, and my Kindle 3. For epubs I have FBReader and Adobe Digital Editions. I'm familiar with all aspects of building and testing e-books. I have forty years experience in IT, from programmer, to Major Crown Project Manager. The most important thing I know, is that I don't know everything.
At this stage, I would like a concise overview of the code used to embed a font, beginning with a newly downloaded font. How is the font prepared, where is it located, how is it declared in a document HTML, CSS and OPF. How is an embedded font substituted and removed from use in HTML/CSS.
What is necessary to include in an OPF used to generate a .mobi book using kindlegen.exe. What is necessary to include in the OPF/INF-META/OEPBS used to produce an epub version. What is essential to include/exclude in any file, anywhere. In other words, a design plan.
I don't expect you Hitch, or anyone else on this forum, to do the work to explain all the above, but I would like a pointer to where I can find the information I would like to know. I have found a small introduction in "The Missing Manual - HTML5," and I have "The Missing Manual - CSS3," (which I have not yet read), which contains some information. I would be quite satisified at this point to go away and buy whatever is suggested (books, software) to learn/use embedded fonts. But, it would also be very helpful to have some real-life examples of the files/folders mentioned above, if anyone would care to post them here, or e-mail them to me via my website, www.katiebooks.ca by using the fanmail@katiebooks.ca address.
When I feel I understand what is required, I will join you and others in the struggle to successfully produce e-books with embedded fonts, and document the many, problems with kindlegen and the other software used by Amazon. At the moment, I'm trying desperately to get up to speed.
Any help anyone can provide will be gratefully accepted.
Tony
|
Tony:
Really, and I'm not trying to be self-deprecating here, it's just not as rocket-surgery-ish as it sounds in this thread. Yes, mystery things DO happen. But, fundamentally, it works fairly simply and just like ePUB.
Here's the SS for two fonts (a serif and a sans serif that we've paired and we like together):
Code:
@font-face { font-family: "PTF5"; font-style: normal; font-weight: bold; src:url(fonts/PTF5bd.ttf); }
@font-face { font-family: "PTF5"; font-style: normal; font-weight: normal; src:url(fonts/PTF5.ttf); }
@font-face { font-family: "PTF5"; font-style: italic; font-weight: normal; src:url(fonts/PTF5i.ttf); }
@font-face { font-family: "PTF5"; font-style: italic; font-weight: bold; src:url(fonts/PTF5bi.ttf); }
@font-face { font-family: "PTS7"; font-style: normal; font-weight: bold; src:url(fonts/PTS7bd.ttf); }
@font-face { font-family: "PTS7"; font-style: normal; font-weight: normal; src:url(fonts/PTS7.ttf); }
@font-face { font-family: "PTS7"; font-style: italic; font-weight: normal; src:url(fonts/PTS7i.ttf); }
@font-face { font-family: "PTS7"; font-style: italic; font-weight: bold; src:url(fonts/PTS7bi.ttf); }
NOTE that from the ePUB edition, if you are a Sigil user, that the "f" in "fonts" is now lower-case, although not REQUIRED. Here's the Stylesheet detailing of one (same for all other uses):
Code:
.chap
{
font-weight:normal;
margin-top:2em;
margin-bottom:0em;
text-align:center;
font-size:1.2em;
adobe-hyphenate:none;
-webkit-hyphens: none;
hyphens:none;
font-family: "PTS7";
}
And here it is deployed:
Code:
<p class="chap"><span class="u"><b>YOUR TEXT HERE</b></span></p>
(And, yes, those are underlining spans, not the old u.)
That's it. There's honestly no magic to it. WHEN things go wrong, check your CSS first, then your HTML, and then bracket-navigate your way around the issue. It's all you can do. Start with a paragraph, build it, see if the font works. Go to a section, then a chapter. The slightly faster way is to do it by halves--halve the book, see if both halves fail. Rinse, repeat. Nine times out of ten, it will be some fatal flaw with the font, not something you can fix. Adobe fonts fail often, for reasons that are not clear to me, other than: it happens.
If it's not clear from this thread, the issue will arise, mostly AFTER the book is uploaded at the KDP; in the online preview, the fonts will be GONE. That's not a previewer glitch; it's the reality. That's when you start the troubleshooting.
As far as I know, there is no
primer on how to use fonts at Amazon. Those of us in the trade either tend to do it, or don't. Those of us who learnt how did it by trial-and-error. (There are no end to the myriad threads at the KDP forums
bemoaning the "evils" of embedded fonts--from bookmakers who
don't/won't/can't do it). I like fonts, myself. We have a clientele of print-book-layout providers who use us (in secret, natch) for the ebook portion of their work, and their clientele, particularly, demand fonts. Were it my own book, I'd like just do chapter head fonts, and let the rest fall as it may, but...{shrug}, old-style bookmakers like traditional-looking ebooks.
Hope that helps. Nuthin' fancy.
Hitch