Changes

Jump to navigation Jump to search
3,171 bytes added ,  08:35, 28 September 2017
new
= Introduction =

Ligatures are combinations of letters that use different glyph shapes to avoid clashing of parts like i-dots and f-arcs. Many fonts contain at least fi and fl ligatures, well-furnished fonts have also ffl, ffi, fb, fh and maybe some traditional ones like ct, ch and combinations with long s – German ß was originally a long-s + end-s ligature (even if it looks like s+z and is called szlig).

While the use of ligatures is a feature of good typography, there are places where they don’t belong, namely at syllable seams where hyphenation can or should take place.

Some typical German examples are Auf-lage, auf-laden, auf-fallen, Zupf-instrument, Schiff-fahrt.

= Traditional TeX methods to break ligatures =

* Auf\/lage – breaks the ligature, but also kills hyphenation and kerning
* Auf{}lage – worked in pdfTeX (MkII), but not in modern TeX engines
* For LaTeX, there’s the [https://www.ctan.org/pkg/selnolig selnolig] package.

= Enabling Ligatures in fonts =

Ligatures in OpenType fonts are defined via "features" that you can/must enable. Usual ligature features are liga and tlig, but some fonts my have others for more/exotic ligatures.
Here’s an example for a good set of default features:

<texcode>
\definefontfeature[default]
[mode=node,kern=yes,
liga=yes,tlig=yes,
ccmp=yes,language=dflt,
protrusion=quality,
expansion=quality]
</texcode>

The other way round – if you don’t enable ligatures in your font features, you won’t get any; this might be desirable for mono width (typewriter) fonts.

= Single places =

If you only want to fix a few occurrences, you can use {{cmd|noligature}}. Compare:

<texcode>
Auflage Zupfinstrument
Au\noligature{fl}age Zup\noligature{fi}nstrument
</texcode>

= Replacements =

ConTeXt has a method of replacing words that you can use for ligature exception dictionaries:

<texcode>
\mainlanguage[de]
\definefontfeature[default]
[mode=node,liga=yes,kern=yes,tlig=yes,
ccmp=yes,language=dflt,
protrusion=quality,
expansion=quality]

\replaceword[eg][Auflage][Au{fl}age]
\replaceword[eg][Zupfinstrument][Zup{fi}nstrument]

\starttext
Auflage Zupfinstrument

\setreplacements[eg]
Auflage Zupfinstrument
\stoptext
</texcode>

Much better.
The first parameter os {{cmd|replaceword} is a set (collection) keycode, i.e. you can define different sets of replacements and activate them with {{cmd|setreplacements}}.

In current versions (after 2017-09-28) you may also define several exceptions at once, like

<texcode>
\replaceword [eg] [Au{fl}age Schiff{f}ahrt Zup{fi}nstrument]
</texcode>

= Blocking =

You can also define blocking of ligatures as a font feature:

<texcode>
\blockligatures[fi,ff]
\blockligatures[fl]
\blockligatures[au:fl:age]
\definefontfeature[default:nolig][default][blockligatures=yes]

\definedfont[Serif*default:nolig] % no ligatures
fi ff fl Auflage Zupfinstrument

\definedfont[Serif*default] % yes ligatures
fi ff fl Auflage Zupfinstrument
</texcode>

While general blocking ({{cmd|blockligatures}}[fi,fl]) works, the exception handling ({{cmd|blockligatures}}[au:fl:age]) might depend on a version unpublished as of this writing (i.e. after 2017-09-28).

Navigation menu