Skip to content

#2511 - Add GSUB Multiple Substitution (Type 2) and enable ccmp - #2512

Open
swmal wants to merge 2 commits into
develop9from
feature/i2511
Open

#2511 - Add GSUB Multiple Substitution (Type 2) and enable ccmp#2512
swmal wants to merge 2 commits into
develop9from
feature/i2511

Conversation

@swmal

@swmal swmal commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

See #2511.

GSUB Lookup Type 2 (Multiple Substitution) was not implemented, so a font could not expand one glyph into several - what most real-world ccmp decomposition relies on. ccmp was also unreachable: it had no flag in the public GsubFeature enum.

Changes

  • New MultipleSubstSubTable + deserializer, wired into GsubTableLoader.
  • MultipleSubstitutionProcessor: expands a glyph into its sequence during shaping, as a new first phase in TextShaper.
  • MultipleSubstHandler: preserves the expanded glyphs through subsetting.
  • GsubFeature.Ccmp added, enabled by default in ShapingOptions and PdfPageSettings, ordered first.
  • PdfContentStream: fixed a latent bug dropping a trailing glyph with CharCount 0, cutting off the tail of an expanded cluster.

Behaviour change
Enabling ccmp affects existing output: fonts may compose decomposed sequences (Roboto renders e+U+0301 as one precomposed glyph) or swap marks for cap-height variants. Two tests now shape without ccmp to keep testing mark positioning.

@swmal swmal added this to the EPPlus 9.0 or later milestone Sep 10, 2026
@swmal swmal self-assigned this Sep 10, 2026
@swmal swmal added the enhancement New feature or request label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant