Skip to content

fix(pptx): name the carried face whose program states another family - #1069

Merged
DemchaAV merged 2 commits into
developfrom
fix/pptx-italic-face-not-drawn
Nov 15, 2026
Merged

DemchaAV merged 2 commits into
developfrom
fix/pptx-italic-face-not-drawn

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Why

A PPTX deck carries an embedded face in a container and declares the family on p:embeddedFont.
A presentation matches the carried face to that declared family by the family the program
states for itself — name id 1 — and not by the names the container carries. Where the two
differ, the runs laid out in that face are not reached the way the page laid them out, and nothing
said so.

Measured in PowerPoint 16, one deck per run, a 45-character line at 20pt, with neither family
installed on the machine. The engine's own render of those two faces is 443.14pt regular and
443.96pt italic:

what varied italic program states deck declares regular paragraph italic paragraph
nothing — the file as published Asap Condensed Condensed Regular Asap Condensed 442.92 from its program 566.51 in Arial Italic, against the 443.65 PowerPoint draws that program at once its record names the declared family
that record rewritten to the same string unchanged Asap Condensed 442.92 566.51 — as above
that record rewritten to the declared name Asap Condensed Asap Condensed 442.92 443.65 from the program
nothing; the deck declares the other name Asap Condensed Condensed Regular Asap Condensed Condensed Regular 443.64 from the italic program 443.65

The second row is the control that makes the third a proof rather than a coincidence: the rewriter
appends a name table and leaves the table directory's checksums stale, and rewriting the record to
the string it already held changed nothing, so neither the rewriting nor the checksums are what the
viewer went by. The fourth row is the same finding from the other side — declaring the name the
italic states draws that program for both paragraphs and leaves the regular face unused, so for a
family whose faces disagree in that record no single declared name serves them all. The container's
own name fields were varied in the previous change and altered nothing PowerPoint drew, which is
why they are not the key.

What the mismatch costs differs, and both halves are measured. The face above was not drawn at all.
Oswald-SemiBold, which the OrangeOps preset here pairs under Oswald and whose own record
reads Oswald SemiBold, was drawn and then weighted again by the viewer — 480.10pt where the
program itself draws 469.70pt. So the condition predicts trouble without predicting which.

What changed

  • PptxEmbeddedFont.statedFamilyOf reads the family a program states for itself, pinned to the
    Windows en-US record because that is the record the measurement read; a face stating id 1 only
    elsewhere answers null and is left unsaid, which is the safe direction for a warning.
  • PptxRenderEnvironment.readPrograms compares it with the declared typeface and logs
    render.pptx.font.name.mismatch with both families and the face's own source. The key names the
    condition and the line names no outcome, because the two measured outcomes differ. Deliberately
    on id 1
    and not on the typographic family (id 16) the DOCX backend prefers: that answers the declared
    name for the very face a presentation refuses, and would silence the Oswald pair as well. A
    sabotage holds that choice.
  • The line claims nothing about the outcome and nothing about whether the family travels — a later
    face of it can still collide or fail to be read, and those have their own lines. Nothing is
    refused here: the program travels as the caller asked and no deck's bytes change.
  • The limit is recorded in the PPTX font-portability entry of the backend capability details, in
    its log-key list, in the capability matrix row, and on the font-coverage page — which now also
    says the thing a caller needs: declare a family under the name its files state, since the
    declared name is wordFamily() and defaults to whatever the family was registered under, and
    docs/troubleshooting.md answers the symptom a caller searches for. The capability matrix cell and its
    details entry move from ✅ to ⚠️ together, the mark the legend reserves for a backend whose
    details name a deviation — the documentation guard in qa requires the two marks to agree, and
    caught the first attempt that moved only the matrix.

Verification

./mvnw -B -ntp clean test -pl :graph-compose-render-pptx -am — 188 tests, none skipped.
PptxFontNameMismatchTest holds 4: the reading itself against four real files, the warning read
off both the artefact (both faces travel — this is not a refusal) and the log, silence for a family
whose every face states the declared name, and a sweep of the bundled catalogue asserting that
exactly one bundled face differs, which is the count the two documents quote and which a font bump
would otherwise falsify silently.

Two sabotages, each turning exactly one case red (tests=1 failures=1) with both sources
byte-identical afterwards: warning about a face that states the declared name turns the silent case
red, and reading id 16 where the viewer matches on id 1 turns the warning case red.

The 105-document DOCX corpus, exported from this head and from develop: unchanged — 105
documents byte-identical, with the same 1718 report notes, none added and none removed. The change
is on the PPTX path and in the log, so it could not reach a DOCX byte; the export is reported
because the claim is cheap to check.

The full reactor gate ran on this branch's final head: GATE PASS — core, the three render
backends, templates, testing, qa and coverage, the four knowledge-pack checks, core javadoc, then
the install and the examples suite (93 tests). No example deck draws the new line: the two presets
that use that family render to PDF and DOCX, and the one bundled face it names is embedded by no
example deck.

A presentation matches an embedded face to the family a deck declares by the
family the program states for itself — `name` id 1 — and not by the names its
container carries. Where the two differ, the runs laid out in that face are not
drawn from it, and nothing said so.

Measured in PowerPoint 16, one deck per run, a 45-character line at 20pt, with
neither family installed: a deck declaring `Asap Condensed` and carrying the
bundled `AsapCondensed-Italic`, whose own record reads `Asap Condensed
Condensed Regular`, had that paragraph drawn in Arial Italic at 566.51pt where
the program itself draws 443.96pt, while the same deck's regular paragraph came
out at 442.92pt against 443.14pt. Rewriting that one record to the declared
name had the program drawn at 443.65pt; rewriting it to the string it already
held changed nothing, so neither the rewriting nor the stale checksums it leaves
were what the viewer went by. Declaring the family as the italic states it drew
that program for both paragraphs and left the regular face unused, so for a
family whose faces disagree in that record no single declared name serves them
all.

What the mismatch costs differs, and both halves were measured: that face was
not drawn at all, while `Oswald-SemiBold`, which a preset here pairs under
`Oswald`, was drawn and then weighted again — 480.10pt where the program draws
469.70pt. So `render.pptx.font.undrawn` names both families and the face's own
source and leaves the outcome to the reader. It claims nothing about whether the
family travels either: a later face of it can still collide or fail to be read,
and those have their own lines. Nothing is refused, the program travels as the
caller asked, and no deck's bytes change.

The comparison is on id 1 and not on the typographic family the DOCX backend
prefers, which would answer the declared name for the very face a presentation
refuses and silence the `Oswald` pair as well; a sabotage holds that. The
reading is pinned to the Windows en-US record, the one the measurement read, and
a face stating id 1 only elsewhere is left unsaid.

The condition is not confined to a mis-built file: the declared name is
`wordFamily()` and defaults to whatever a family was registered under, so the
font-coverage page now tells a caller to declare the name their files state. A
sweep over the bundled catalogue keeps the count the documents quote honest.
The line said the runs laid out in such a face "are not drawn from it", and its
key said `undrawn`. One of the two measured arms refutes that: `Oswald-SemiBold`
under `Oswald` was drawn from the program and then weighted again by the viewer.
The key is now `render.pptx.font.name.mismatch`, which names the condition the
export tests, and the line says the runs are not reached the way the page laid
them out — true of a substituted face and of a re-weighted one. The CHANGELOG
headline, the capability details, the font-coverage page and the test class
carried the same claim and no longer do.

The line also presupposed runs that need not exist: a registered family is read
before a slide is drawn, so all four of its faces are read whether or not the
deck sets text in them. It says "any runs" now, as the substitution line beside
it does.

`statedFamilyOf`'s javadoc said the header read keeps no record it needs, which
is wrong and contradicted the same file's account of that predicate: the header
read does keep the family record, but `FontHeaders` exposes only fontbox's own
English-name pick and not the record itself. It now says that, and the parse is
asked to take an embedded font so a face missing a table a standalone one must
have is read here as the embedder reads it — which also makes the unreadable
branch below it reachable. The name is trimmed, as the name a family declares
already is, so a trailing space in a file cannot pass for another family.

`wrap` takes the bytes a caller already holds, which the embedder does: it reads
each face once to ask what family the program states, and the stream overload
would have copied every face a second time.

The capability matrix cell and its details entry move from ✅ to ⚠️ together: the
row now names a deviation, and the legend reserves ✅ for a backend whose details
name none. The documentation guard requires the two marks to agree.
`docs/troubleshooting.md` gains the symptom a caller searches for — Arial where
the deck embeds a font.
@DemchaAV
DemchaAV marked this pull request as ready for review November 15, 2026 12:26
@DemchaAV
DemchaAV merged commit ed903a3 into develop Nov 15, 2026
13 checks passed
@DemchaAV
DemchaAV deleted the fix/pptx-italic-face-not-drawn branch November 15, 2026 13:22
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.

1 participant