Precomposed character


A precomposed character is a Unicode entity that can also be defined as a sequence of one or more other characters. A precomposed character may typically represent a letter with a diacritical mark, such as é. Technically, é is a character that can be decomposed into an equivalent string of the base letter e and combining acute accent. Similarly, ligatures are precompositions of their constituent letters or graphemes.
Precomposed characters are the legacy solution for representing many special letters in various character sets. In Unicode they are included primarily to aid computer systems with incomplete Unicode support, where equivalent decomposed characters may render incorrectly.

Comparing precomposed and decomposed characters

In the following example, there is a common Swedish surname Åström written in the two alternative methods, the first one with a precomposed Å and ö, and the second one using a decomposed base letter A with a combining ring above and an o with a combining diaeresis.
  1. Åström
  2. Åström
Except for the different colors, the two solutions are equivalent and should render identically. In practice, however, some Unicode implementations still have difficulties with decomposed characters. In the worst case, combining diacritics may be disregarded or rendered as unrecognized characters after their base letters, as they are not included in all fonts. To overcome the problems, some applications may simply attempt to replace the decomposed characters with the equivalent precomposed characters.
With an incomplete font, however, precomposed characters may also be problematic – especially if they are more exotic, as in the following example :
  1. ḱṷṓn
  2. ḱṷṓn
In some situations, the precomposed green k, u and o with diacritics may render as unrecognized characters, or their typographical appearance may be very different from the final letter n with no diacritic. On the second line, the base letters should at least render correctly even if the combining diacritics could not be recognized.
OpenType has the ccmp "feature tag" to define glyphs that are compositions or decompositions involving combining characters.

Chinese characters

In theory, most Chinese characters as encoded by Han unification and similar schemes could be treated as precomposed characters, since they can be reduced to their constituent strokes and ideograph descriptions with Chinese character description languages. Such an approach could reduce the number of characters in the character set from tens of thousands to just a few hundred. On the other hand, such a highly decomposed character set would introduce challenges for searching and editing software and require more bytes of encoding per document.