This article includes alist of references,related reading, orexternal links,but its sources remain unclear because it lacksinline citations. Please helpimprove this article byintroducing more precise citations.(October 2024) (Learn how and when to remove this message) |
Aprecomposed character (alternativelycomposite character ordecomposable character) is a multi-glyph entity represented inUnicode by a singlecodepoint. A precomposed character may typically represent a letter with adiacritical mark, such as⟨é⟩ (U+00E9 éLATIN SMALL LETTER E WITH ACUTE).
The same character can also be created using a sequence of codepoints, one for each of the glyphs that comprise the character. For example in Unicode terms, the letter⟨é⟩ is a character that can be represented directly usingU+00E9 or alternatively can be decomposed into anequivalent string of the base letter⟨e⟩ (U+0065 eLATIN SMALL LETTER E), together with thecombining form of theacute accent (U+0301 ◌́COMBINING ACUTE ACCENT). Similarly, precomposedligatures are precompositions of their constituent letters orgraphemes – for example, theU+0133 ijLATIN SMALL LIGATURE IJ used inDutch.
Precomposed characters are the legacy solution for representing many special letters in variouscharacter sets. In Unicode, they were included for compatibility with early encoding systems such as the various components ofISO 8859 or other kinds of "extended ASCII". More recent Unicode policy has been to resist creation of new precomposed characters if the character can be produced using combining forms.
In the following example, there is a commonSwedish surname Åström written in the two alternative methods, the first one with a precomposedÅ (U+00C5) andö (U+00F6), and the second one using a decomposed base letterA (U+0041) with a combiningring above (U+030A) and ano (U+006F) with a combiningdiaeresis (U+0308).
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 allcomputer 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 (showing the reconstructedProto-Indo-European word for "dog"):
In some situations, the precomposed greenk,u ando with diacritics may render asunrecognized characters, or theirtypographical appearance may be very different from the final lettern 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 theccmp "feature tag" to define graphemes that are compositions or decompositions involving combining characters.
In theory, mostChinese characters as encoded byHan unification and similar schemes could be treated as precomposed characters, since they can be reduced (decomposed) to their constituentradical and phonetic components withChinese character description languages. Such an approach could reduce the number of characters in the character set from tens of thousands to just a few thousand. On the other hand, a decomposed character set would introduce challenges for searching and editing software and require more bytes of encoding per document. One particular challenge would be the multiple-to-multiple projections between the set of decomposed characters and the precomposed character—one precomposed character may be decomposed into multiple different sets of decomposed characters while one set of decomposed characters could contract themselves into multiple different precomposed characters. There is no strict requirement or constraints regarding the relative position between components within a character, the form of variant and transform (narrow, widen, stretch, rotate, etc.) applied on components, nor the number of each components.