Skip to content

Stop rejecting BaseFontBlend as a Multiple Master CFF font - #10

Merged
soadzoor merged 1 commit into
soadzoor:mainfrom
sebgoubier:fix/cff-basefontblend-is-not-mm
Sep 17, 2026
Merged

soadzoor merged 1 commit into
soadzoor:mainfrom
sebgoubier:fix/cff-basefontblend-is-not-mm

Conversation

@sebgoubier

Copy link
Copy Markdown
Contributor

What this fixes

A real PDF fails with Synthetic or Multiple Master CFF fonts are not supported. Probed at the failure point, the font's Top DICT holds operator 12 23 with the values [408, -397].

12 23 is not a Multiple Master marker. Per the CFF Top DICT layout it is BaseFontBlend, a delta array — which is exactly the shape of those two values. It is a leftover from Multiple Master tooling and carries no blend axes and no interpolation state. A font holding it has exactly the glyphs in its CharStrings INDEX.

So the check rejected an ordinary font over an inert metadata entry, and took the whole document with it.

What still rejects

12 20 SyntheticBase — and that one is substantive: those glyphs are defined against another font and cannot be read from this CharStrings INDEX alone. Only the message changed there, since it no longer needs to mention Multiple Master.

Test

testBaseFontBlendIsNotMultipleMaster parses the same fixture twice, with and without BaseFontBlend in its Top DICT, and asserts identical glyph names and identical outline commands. That proves the entry is inert rather than merely tolerated. buildCffFixture gained a topDictExtra option to make that possible.

Checks

  • npm run test:file -- scripts/test-native-cff-semantics.mjs — passes
  • npm test — tsc --noEmit clean, 36 / 37 fast files pass
  • npm run test:integration — 41 / 41
  • npm run test:unit — 66 / 68
  • the source PDF gets past this font (it then hits an ExtGState /UCR2 refusal, reported separately)

The two failing files also fail on main; Windows-only path failures.

Scope

CFF Top DICT only. Independent of #4 through #9.

Refs #2

Top DICT operator 12 23 is BaseFontBlend, not a Multiple Master marker.
It is a delta array left behind by Multiple Master tooling; it carries
no blend axes and no interpolation state, and the glyphs of a font
holding it are exactly the ones in its CharStrings INDEX.

A real PDF carries a font whose Top DICT has 12 23 with the values
[408, -397] -- a plain delta -- and the whole document failed to render
because of it.

12 20 SyntheticBase still rejects, and that one is substantive: those
glyphs are defined against another font and cannot be read from this
CharStrings INDEX alone. The message no longer claims Multiple Master
support is the issue.

The new case parses the same fixture twice, with and without
BaseFontBlend, and asserts identical glyph names and identical outline
commands -- so the entry is proven inert rather than merely tolerated.

Refs soadzoor#2

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@soadzoor
soadzoor merged commit 1f86e89 into soadzoor:main Sep 17, 2026
1 check passed
@soadzoor

Copy link
Copy Markdown
Owner

Thank you!

soadzoor added a commit that referenced this pull request Sep 17, 2026
- 0.1.30
- Fix: use native ESM paths in Vite config
- Prefer usable PDF output with bounded raster fallback and approximation warnings
- Strengthen CFF BaseFontBlend regression coverage
- Merge pull request #10 from sebgoubier/fix/cff-basefontblend-is-not-mm
- Clarify stitching bounds tolerance and expand regression tests
- Merge pull request #9 from sebgoubier/fix/stitching-bounds-plateau
- Feat(pdf): Add support for ICC color profiles (qcms, lcms, and alternate) with fallback
- Fix(pdf): recover Flate EOL padding without losing decoded output
- Feat(pdf): synthesize cloudy borders for Square annotations
- Feat(pdf): support underline borders on Square annotations
- Feat(pdf): synthesize Square annotations with validated geometry
- Test: reject invalid CIDSystemInfo strings
- Merge pull request #5 from sebgoubier/fix/cid-system-info-nul-padding
- Fix(tests): handle file URLs correctly on Windows
- Merge pull request #4 from sebgoubier/fix/ccitt-b1-strictly-right-of-a0
- Stop rejecting BaseFontBlend as a Multiple Master CFF font
- Treat repeated stitching Bounds as the empty subdomain they describe
- Trim fixed-width NUL padding in /CIDSystemInfo strings
- Fix CCITT b1 selection so vertical modes cannot move backwards

Source-Revision: 5d761c9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants