View Full Version : Workaround for lack of capitals in ADE


ozaru
08-20-2010, 07:00 PM
I have an ePub which contains lots of small caps, defined in CSS (it's a play, and they're used to mark the characters speaking). In some reading systems it displays fine, but Adobe Digital Editions does not support font-variant:small-caps so it fails there. I'd still like the names to be shown either in small caps (ideally) or all caps (if need be), and tried using text-transform:uppercase - but this isn't supported by ADE either.

The workaround I've thought of is embedding an all-caps font (ideally one that has small-caps for the lowercase letters), and setting the CSS class to use that font -- assuming I can find such a font that is free to embed, and that also sits well with the main font used for the rest of the text.

As I've not yet decided on the main font, can anyone suggest (a) a suitable caps font, and (b) a normal (mixed case) font that would match it well?

Adjust
08-20-2010, 07:56 PM
Trajan is an all CAPS font.

But if you do a few searches here it's been explained how to get around this problem

ozaru
08-20-2010, 08:17 PM
Trajan is an all CAPS font.

But not free, I believe. Fontin is free, has a small caps version, and is nice & small, but it doesn't contain vowels with macrons (and a few more obscure Czech accented characters), which I need.

But if you do a few searches here it's been explained how to get around this problem

I have searched the site and read many related threads, but apart from finding confirmation that ADE fails on caps, I've not found anything that solves my issue: hence the question.

awp
08-20-2010, 08:18 PM
Atlantis Word Processor simulates "small caps" formatting in the eBooks it creates by applying both the uppercase pattern and a reduced font size to lowercase letters formatted with "small caps". In other words, instead of keeping the "small caps" formatting of the original text, Atlantis converts it to uppercase with reduced font size. It won't be "small caps" per se but it will look exactly like it in any eReader. You can find details in the following blog post:
http://atlantiswordprocessor.blogspot.com/2010/01/lifting-limitations.html

If you converted your eBook to the RTF, DOC, DOCX, or ODT format, then loaded it to Atlantis Word Processor, you would have a simple workaround for the problem with small caps.

ozaru
08-20-2010, 08:45 PM
Atlantis converts it to uppercase with reduced font size.

That's certainly one way of doing it -- and I suppose I could achieve the same (and avoid having to traverse two more formats) by doing a global search & replace on e.g.
<span class="smallcaps">Jack:</span> ->
J<span class="smallsize">ACK:</span>

The code doesn't look quite as neat, but it'll probably work. Also, true small caps do look better in print, but I dare say on most reading systems nobody will notice... Thanks.

Jellby
08-21-2010, 04:07 AM
Consider just ignoring the lack of smallcaps in ADE. There could be a new version of ADE launched tomorrow with support for smallcaps, or readers could start adding support for them independently, or ADE may be discontinued and a new ePUB reader take its place.

Nevertheless, the idea of using a smallcaps font is good. Since it's a workaround for ADE, you could wrap it in this conditional CSS. You could also use bold or underline instead of smallcaps in ADE.

ozaru
08-23-2010, 10:43 AM
Consider just ignoring the lack of smallcaps in ADE. There could be a new version of ADE launched tomorrow

True - but in the meantime, any Thespians reading this play would (apparently) be quite irritated not to see the characters' names in capitals (they don't like bold/underline), and as the aim is to get the play produced, I don't want to take that risk. Originally I had the names hard-coded in all caps, and I may yet revert to this scheme as although the other methods suggested would look prettier (on whichever systems support them), the hassle involved in catering for all the different possibilities (and keeping up to date as their specs change) mean it is probably not worth it after all.

Nevertheless, the idea of using a smallcaps font is good.

It would be better if there were a free & small font (like Gentium) including macrons etc., which *also* had a matching smallcaps version (like Fontin), so I could avoid 'mix & match'. There may indeed be one, but I've not found it. :blink:

Since it's a workaround for ADE, you could wrap it in this conditional CSS.

Hmm, ingenious... I doubt I'll use that though, as workarounds of this type tend to stop working when the specs are updated (and I don't want to have to keep returning to the text and publishing a new version).

llasram
08-24-2010, 10:56 AM
You can modify any font with small caps to use those small caps as the primary glyphs. This appears to work perfectly as long as the relevant substitution tables are also updated to refer to the small cap glyphs. I'm sure you could apply the same technique to use the uppercase glyphs.

I've attached a cheesy script which performs the necessary modifications on the XML font representation used by the TTX tool (http://www.letterror.com/code/ttx/index.html). It assumes that small caps glyphs end in ".sc" -- it would be better to use the contents of the 'smcp' substitution tables. It would also be better to use the fonttools Python library directly, but this is what I had lying around :-).

ozaru
08-24-2010, 02:42 PM
You can modify any font with...

That looks like a great tool... but sadly, when I tried out TTX on Gentium all I got was two short <GlyphOrder> & <Feat> tables, then an AssertionError. I suspect solving this, and then tweaking the font to get the results needed (above all, acquiring enough knowledge about fonts to understand how it needs to be achieved) will end up taking too much time. I don't even know yet if Gentium contains small cap glyphs, in which case I suppose we're back to square one, i.e. looking for the right free font to start with.

Annoying in a way that ADE is forcing me to spend time learning the details of font construction, but wonderful that such resources exist (and the same goes for mobileread, natch). Annoying too to think that as likely as not, in 5 years' time ADE will support small-caps, there will be hundreds of free fonts with small caps & macrons, and MS Word (?) will support saving straight to ePub with fully validated code & optimized CSS...

llasram
08-24-2010, 04:24 PM
I don't even know yet if Gentium contains small cap glyphs, in which case I suppose we're back to square one, i.e. looking for the right free font to start with.

Oh, it appears not to anyway, so fair enough. It looks like Charis does -- although names the glyphs with a ".SC" suffix (sigh). And the TeX Gyre fonts do -- I'm not sure how they'd look next to Gentium, but they've got large glyph complements and most of the typographic bells and whistles.

Annoying in a way that ADE is forcing me to spend time learning the details of font construction, but wonderful that such resources exist (and the same goes for mobileread, natch). Annoying too to think that as likely as not, in 5 years' time ADE will support small-caps, there will be hundreds of free fonts with small caps & macrons, and MS Word (?) will support saving straight to ePub with fully validated code & optimized CSS...

I do hope that ADE supports it soon -- every other contemporary renderer can at least fake it. I'm pretty skeptical about MSWord producing fully validated and optimized CSS though :-).

jharker
08-27-2010, 10:29 AM
Try out Linux Libertine (http://www.linuxlibertine.org/index.php?id=1&L=1). It has a normal version and a separate, matching "small caps" variant. It's a serif font designed to be a cleaner and more pleasing alternative to Times. I quite like it.

ozaru
09-02-2010, 08:59 PM
Try out Linux Libertine

Many thanks for the heads-up on this... It looks quite interesting, and better still, it took me to a Japanese page all about free fonts (http://wiki.fdiary.net/font/?freefont) which in turn led me to discover GlyphWiki (http://glyphwiki.org/).

Now the problem I have is not that there are too few options, but too many... all with slightly different licensing terms, which will take ages to understand. I want a font I can modify to include a few Japanese characters but delete the thousands of glyphs that aren't needed (to cut down on size), perhaps using FontSquirrel's utility suggested earlier. Some seem to say "modding is fine, but keep/change/mention the original font name", others say "you must include the full license text with any modded version" etc. (which is a bit of a pain). Ah well, I guess I'll just have to wade through all the LICENSE.TXT files.