Skip to content

fix(pptx): say what a font-name mismatch costs, and what it does not - #1070

Merged
DemchaAV merged 2 commits into
developfrom
fix/pptx-bold-face-reweighted
Nov 15, 2026
Merged

DemchaAV merged 2 commits into
developfrom
fix/pptx-bold-face-reweighted

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Why

A PPTX deck can carry its fonts, and render.pptx.font.name.mismatch names a face whose program
states a family other than the typeface the deck declares. The line named two outcomes for that
condition. The second was wrong, and the deck it cited has another cause entirely.

The cited case: the OrangeOps CV preset declares Oswald and carries Oswald-Regular in
p:regular and Oswald-SemiBold in p:bold. Its bold paragraph comes out 10.40pt wider than the
page measured, which the line read as the viewer adding its own weight to an already-bold program.
It is not: that deck is not drawn from the carried programs at all.

Measured in PowerPoint 16, one deck per PowerPoint instance, a 45-character line at 20pt, with
Oswald in no Windows font folder, neither font registry key, and — the thing that turned out to
matter — present in Office's cloud-font cache. Every figure below is a line width, as
PDFTextStripper reports it; the 480.10pt this item was opened on is the same bold line read as a
right edge on a page whose text starts at 30pt.

The programs PowerPoint embedded in its own PDF export match the cached files
(%LOCALAPPDATA%\Microsoft\FontCache\4\CloudFonts\Oswald) glyph for glyph, and not the carried
pair:

drawn line advances in the subset PowerPoint embedded that is
the bold paragraph, 450.10 A=551 W=697 a=476, 22509 units over the line, id6 Oswald-Bold, weight 700 the cached Oswald Bold
the plain paragraph, 405.97 a=426, id6 Oswald-Regular the cached Oswald Regular (ours states a=409)
what the page laid out 439.70 bold and 405.02 plain, from the two carried files neither was used

Most of the 10.40pt is the weight and a little is the build: on the programs' own numbers the
cached Bold draws 450.18, its SemiBold 440.58 and the carried SemiBold 439.70, so 9.60 of it is
Bold against SemiBold and 0.88 is the cache holding another build of the family. A cloud-font cache
is not a font folder, which is why "the font is not installed" never established that a carried
face is what gets drawn.

Nothing in a deck reaches it. Each arm below changed one thing; seven of the ten drew the bold line
at 450.10, to the hundredth:

arm one factor bold line
A the two files as published 450.10
B the bold file recompiled, no value changed — the control on the tool 450.10
C its OS/2 usWeightClass 600 → 700 450.10
D its OS/2 fsSelection bold bit set 450.10
E its head.macStyle bold bit set 450.10
F its name id 1 rewritten to the declared Oswald 450.10
N all four of those at once, id 2 Bold 450.10
G the EOT container's own weight field 600 → 700 450.10
H the run's b="true" → b="false" 405.91 — the cached regular, so the flag only picks the element
L the family declared as the carried face states it, Oswald SemiBold 440.88, and the plain line 440.93 where the page laid out 405.02

The complement, which is what makes the rest a measurement rather than a story: under a declared
name the machine has no font for, the carried programs are drawn and the page's geometry holds —
439.86 against the page's 439.70, from the same two files, identified in the subset.

While confirming that, two arrangements of the condition the line does test turned out to cost
nothing, both under a declared name no local font answers to. A face in the bold element stating
another family was drawn from the carried program (439.86 against the page's 439.70). So was an
italic face of a family whose faces all state the same other name, in a deck declaring a name
of its own: 497.95 against the page's 497.68, where the machine's cached italic of that family
draws 493.49 — the two carried files are marked in one glyph by +400 units, so no other build of
them could pass for them. The loss the line was built on remains measured on one arrangement: a
family whose faces state different names, where the odd face is the one replaced by a
substitute.

What changed

  • The log line keeps firing on every slot and now names the condition and no outcome. A viewer may
    yet refuse a bold-slot face; the line is already in place if it does.
  • PptxEmbeddedFont.statedFamilyOf's javadoc says which arrangements were measured, that two of
    them cost nothing, and that every one of them needed a declared name no local font answers to —
    under a name that has one, this record decides nothing. The metadata javadoc no longer offers
    the Oswald deck as evidence about the container's fields: that deck could not have moved either
    way.
  • The limit is written where a caller meets it: the PPTX font-portability entry of the backend
    capability details and its log-key list, a new section of docs/font-coverage.md with the arms
    and the numbers, and a new symptom in docs/troubleshooting.md — the right family at the wrong
    weight — which says plainly that no field in the deck and no line in the log can reach it,
    because an export cannot know what the viewing machine has.
  • The CHANGELOG entry that carried the refuted outcome now says what replaced it, and this change
    has an entry of its own.
  • The details entry named the sweep by a class name a rename left behind (PptxUndrawnFaceWarningTest);
    it is PptxFontNameMismatchTest.
  • No behaviour changes and no deck's bytes change. Nothing new is refused, nothing new is warned
    about: there is no signal an export could key such a warning on.

Verification

./mvnw -B -ntp test -pl :graph-compose-render-pptx -am — 188 tests, none skipped, the same four
in PptxFontNameMismatchTest. The line's text changed and no test asserted the refuted phrase, so
nothing in the suite had to be rewritten to keep passing — which is also why this change adds no
test: the measured facts are a viewer's, and an export cannot observe them. What that leaves
unguarded is worth saying plainly: nothing pins that the line names no outcome, and no guard reads
the three documents that now carry these numbers, so a regression here would look exactly like the
state this PR found.

The documentation guards in qa: 74 tests over two runs, including
DocxCapabilityMatrixGuardTest (14 — the matrix cell and its details entry already carry the ⚠️
this entry needs), DocsBoldFaceGuardTest, DocumentationExamplesTest and
DocumentationSnippetCompileTest.

Both sabotages from the change that added the line, re-run against this tree, 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 the typographic family
(id 16) where the viewer matches on id 1 turns the named case red.

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

The full reactor gate on the final head: GATE PASS.

The line `render.pptx.font.name.mismatch` named two outcomes for a face whose
program states another family than the deck declares. The second was wrong. It
cited `Oswald-SemiBold`, which a preset here pairs under `Oswald`, as drawn and
then weighted again by the viewer — 480.10pt where that program draws 469.70pt.
That deck is not drawn from the carried programs at all: the subsets PowerPoint
16 wrote into its own PDF export are the Oswald Regular and Oswald Bold of
Office's cloud-font cache, glyph for glyph, and the extra 10.40pt is the
difference between that family's Bold (weight 700) and the SemiBold (600) the
page measured. Oswald is in no Windows font folder or font registry key on that
machine, so a face being "not installed" never established that the carried
program is what gets drawn.

Nothing a deck can say reaches it, measured one factor at a time and each to the
hundredth of a point: the container's weight field, the program's
`usWeightClass`, its `fsSelection` bold bit, its `head.macStyle` bold bit, its
own family record rewritten to the declared name, all four of those at once, and
the run's `b` flag, which only picks the slot. A control arm recompiled the file
without changing a value and drew the same, so none of that was the recompile.
Declaring the family as the carried face states it is worse rather than better:
that name is a local family too, and the plain paragraph then reaches 440.93pt
where the page measured 405.02pt.

The condition the line tests also costs nothing in two arrangements, each drawn
exactly as the page laid it out under a declared name the machine has no font
for: a face in the bold slot stating another family (439.86pt against 439.70pt),
and an italic face of a family whose faces all state the same other name
(497.95pt, from files marked to differ from any the machine holds). So the loss
was measured on one arrangement only — a family whose faces state different
names, where the odd face is the one replaced.

The line keeps firing on the same condition, for the cleared arrangements too: a
viewer may yet refuse a bold-slot face, and the line is already there if it does.
It now names the condition and no outcome. Its javadoc, and the javadoc of the
test class that pins it, say which arrangements were measured and that all of
them needed a declared name no local font answers to, since under a name that
has one the carried program decides nothing. No behaviour and no deck's bytes
change.

The limit itself is recorded where a caller will meet it: the PPTX
font-portability entry of the backend capability details, its row in the
capability matrix, a section of the font-coverage page with the arms and the
numbers, and a symptom in the troubleshooting page for a deck drawn in the right
family at the wrong weight. The CHANGELOG entry that carried the refuted outcome
says what replaced it, and the three sentences of it that stated the condition's
cost as universal now read as the measurements do. The details entry also named
the sweep by a class name that a rename left behind.
A review round of this change found the first commit stating three of its own
numbers more strongly than the arms support, and two places it had missed.

The two cleared arrangements are now named with the condition they were measured
under: a declared name no font on the measuring machine answers to. Without that
clause the second figure reads as if it came from the deck declaring a cached
family, which is the one case where the carried program decides nothing — and
that deck does not meet the condition at all, since both its faces state the name
it declares.

The decomposition of the gap did not add up: 9.60pt and 0.88pt against a measured
10.40pt. Those two come from the programs' own line sums, where the cached Bold
draws 450.18pt; PowerPoint drew that line at 450.10pt. The three places that
carry the split now say which basis each figure is on.

The capability details still offered the deck declaring a cached family as
evidence about the container's name fields, where the javadoc beside it no longer
does: that deck cannot answer either way, because the program it carries is not
what gets drawn. The same entry called the replaced face "refused" a sentence
before saying nothing is refused for it, in a document where a refusal is this
backend's own act.

The font-coverage page sent a caller to a measurement that does not say what the
cross-reference claimed: declaring the whole family under the odd face's own name
was measured costing more than it saves, while setting only that face in it was
not measured at all — and on the programs' own numbers it would land the bold run
0.88pt out rather than 10.40pt. The page also called a route "measured to work"
while adding a requirement to it; both forms of it were in fact measured, with
the files rewritten to state the declared name and with them left stating their
own, and the page now says so. It had dropped the recompile control that rules out
an inert tool, and that is back.

The troubleshooting page sent a reader to the next section on the strength of the
log line firing, which for a family whose faces all state its declared name it
does not: a cached family can be drawn whether or not the line fires, and the
page says that instead.

Three sentences of the entry this change corrects stated the condition's cost as
universal, and its id-16 paragraph still argued from the deck whose outcome was
retracted; both now read as the measurements do. The Asap premise cited the family
not being "installed", which is the test this change discredits — it names the
font folders, the registry keys and the cloud-font cache.

The measurement prose says "element" where it means the one a deck declares a face
under, which this backend keeps apart from the slot a family registers it in.
@DemchaAV
DemchaAV marked this pull request as ready for review November 15, 2026 15:25
@DemchaAV
DemchaAV merged commit 6e5e8d9 into develop Nov 15, 2026
13 checks passed
@DemchaAV
DemchaAV deleted the fix/pptx-bold-face-reweighted branch November 15, 2026 15:48
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