What are ligatures and what problems do they cause?

Moderator: faq-editor

Post Reply
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

What are ligatures and what problems do they cause?

Post by martin »

What is a ligature?
All text in your word processing documents is a sequence of characters, one character after the other. Each character could be a letter, number, punctuation mark, or anything else defined by Unicode.

As text is displayed on screen, the relevant font chooses how to draw the characters. Normally each character is drawn one at a time. However, sometimes two or more adjacent characters are drawn together in unison. That's a display ligature.

ligatures.png
ligatures.png (8.79 KiB) Viewed 20368 times

The above screenshot shows a ligature on its right side. The font used a single glyph to display two characters from the underlying text at once. This ligature simply makes text look nicer.


How do I control ligatures?
By default the font will control whether or not your text displays ligatures. If a font includes a ligature for two or more adjacent characters, the font will normally automatically display those ligatures. Which ligatures are supported is up to the font designer. For example, the Zapfino font has some truly wild ligatures, including a giant 7 character ligature for the font's name:

zapfino.png
zapfino.png (12.34 KiB) Viewed 20368 times

You can override ligatures for text in your Nisus Writer documents by using the Format menu. You should select some text and choose a menu like Format > Ligature > Use None. That will enable or disable ligatures for only that specific text. For global control you should adjust ligature settings using Nisus Writer's style sheet.


What are pre-composed ligature characters?
So far we've only discussed ligatures that are a display phenomenon of your fonts. There are also pre-composed ligature characters. These are individual characters that are inherently a ligature. The joined representation is not a choice that's left to the font or display process.

For example, the Unicode character U+FB01 is a single character, the "fi" ligature. It's intrinsically defined to be a ligature showing two joined letters. It will be displayed and handled by software as a single unit.


What problems do ligatures cause?
Normally display ligatures will not cause any problems. However, pre-composed ligature characters can be a nuisance. If a pre-composed ligature character makes its way into your text (eg: as pasted from a PDF), what you see on screen doesn't really match your computer's understanding of the text.

For example: consider the pre-composed fl ligature. Instead of actually having the "f" and "l" letters in your text, there's only a single "fl" character, with a different underlying character code. This ligature character code is baked into the text; it's no longer just a display choice. That can disrupt a variety of tools that don't know any better.

The system spellchecker often fails to identify words with pre-composed ligatures correctly. The word "flashback" may look correct on screen, but the pre-composed fl ligature at the start of the word likely won't be recognized, incorrectly flagging the word as misspelled.

When you search a document for the letter "f", the pre-composed "fl" ligature won't be found!


How can I remove pre-composed ligature characters?
You can't use formatting to control pre-composed ligature characters, since they are encoded in the underlying text. You'll need to replace the actual characters in the text. Nisus Writer can do this for you automatically using the attached Ligature Cleaner macro. If you run the macro on a document, all pre-composed ligature characters will be replaced with their normal letter counterparts, eg: "fl" becomes "f" and "l".

Ligature Cleaner.nwm.zip
(2.53 KiB) Downloaded 1235 times
Post Reply