The Amazon Kindle has a default font which features small caps and ligatures, but not ligatures for small caps. For this reason, when it sees ligatures (even common ones, such as "ff"), it renders them in lowcase instead, which is ugly.
I wouldn't like to disable ligatures for everything, but having lowcase letters in the middle of a small caps word is ugly.
Is there a way (preferably using .4ht
files) to disable ligatures in small caps?
Is there maybe a way to disable small caps for a given environment/string?
Edit:
Apparently, this is a generic problem with CSS and font-variant: small-caps
as I get the same result in my browser.
Edit 2:
CSS3 adds a font-variant-ligatures
setting to enable different kind of ligatures using OTF fonts. When using small caps with this setting, ligatures are automatically disabled, just as with LaTeX. However, not a lot of browsers implement it, and calibre's ebook-convert
, which I use, does not seem to support it either.
Edit 3:
My problem with TeX4HT comes from the fact that I have redefined \textsc
for Tex4HT:
% Reconfigure small caps
\NewConfigure{textsc}{2}
\renewcommand\textsc[1]{%
\a:textsc#1\b:textsc
}
\Configure{textsc}{\Tg<span class="small-caps">}{\Tg</span>}
\Css{span.small-caps{
font-variant:small-caps;
}}
The reason for doing so is that TeX4HT's default converts all letters to uppercase and creates one <span>
tag per character, which is heavy, ugly, and does not produce real small-caps (although it does prevent ligatures, since all letters are enclosed in <span>
tags). So I'd rather use a cleaner approach, by disabling ligatures in TeX and using one <span>
element only, without changing letters to uppercase.
Also, I run TeX4HT with htlatex doc.tex 'ebook.cfg,xhtml,charset=utf-8' ' -cunihtf -utf8 -cvalidate'
\documentclass{article} \begin{document} \textsc{sufficient} \end{document}
run throughhtlatex
has no ligatures.htlatex
produces one<span>
node per letter… I found the produced document ugly (also, not really small caps), so I redefined\textsc
in my.4ht
in order to have a single<span>
tag…