Skip to content

ccmp — Glyph Composition/Decomposition

ccmp (Glyph Composition/Decomposition) composes or decomposes character sequences at the glyph level, to minimize the number of glyph alternates.

It covers both directions: decomposing the default glyph for a single character into multiple glyphs, and composing the default glyphs for multiple characters into a single glyph.

A representative case of decomposition is reverting a character encoded as a ligature back into its components. This is covered in Multiple Substitution (Lookup Type 2)’s “Why decompose”. For composition, the specification gives the example of merging the Arabic shadda (U+0651) and fatha (U+064E) into a single glyph. This direction is written with Ligature Substitution (Lookup Type 4).

The specification states that ccmp should always be applied, and that it needs to be processed before any other feature.

Without ccmp
fish
With ccmp
fish
.fea source
Compiling…

The rule is written with Lookup Type 2 for decomposition, or Lookup Type 4 for composition. This demo shows decomposition.

Without rules
fish fish flow flow
With rules
fish fish flow flow
Compiling…