Skip to content

fix(docx): read a shipped face's line in whichever case a run spells its name - #1089

Merged
DemchaAV merged 3 commits into
developfrom
fix/docx-shipped-line-any-case
Nov 26, 2026
Merged

DemchaAV merged 3 commits into
developfrom
fix/docx-shipped-line-any-case

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Why

A family whose wordFamily() asks for a name another family already ships a face set under is given
up whole (DocxFontTable.declaring, which compares names with equalsIgnoreCase because both
editors were measured to draw a run from a face set declared under its name in another case, in a
document declaring both spellings). Its runs are then set in the holder's faces, whichever case they
spell the name in — measured again here in Word 16 on the shape the refusal leaves, one element in
the holder's spelling: with ProbeShared declared for Lato, runs spelled PROBESHARED and
probeshared were drawn from the same embedded Lato subset as the holder's, 130.96pt wide with their
top at 37.50pt in all three spellings, where a control declaring IBM Plex Mono under its own name drew
176.47pt. LibreOffice was not measured: the local 26.8 drew none of the embedded faces in these
documents, the holder's included, and the 24.2 build CI runs is not available here. The exception that
stood before stands: where the editor has a font of that name itself, its own font wins.

DocxShippedLines kept each shipped face's line, and its file for the character-map check, under the
exact spelling. So a given-up family spelling the name in another case read no line. For two
registrations of one face, its paragraph was then held to an exact height where one spelling the name
the holder's way grew to a least one. Measured on two registrations of Lato Regular at 14pt, declared
FoldShared:

given-up family's wordFamily paragraph line before after
FoldShared 336 atLeast 336 atLeast
FOLDSHARED 336 exact 336 atLeast
foldshared 336 exact 336 atLeast

(The FoldShared row writes no font on its run, the document's default face being that name, so it
is read through the default; the other two through the run's own spelling.)

What changed

  • DocxShippedLines keys its three maps (lines, files, characters) with
    String.CASE_INSENSITIVE_ORDER, which folds a character the way equalsIgnoreCase does — the
    comparison DocxFontTable decides a shared name with — and does not depend on the default locale.
    One family is written per name so compared, so no two faces can meet over a key.
  • A run naming a shipped name in another case now reads that face's line — a given-up family's, or
    one that shipped nothing of its own. A given-up family's paragraphs read the holder's line where
    the holder filled the slot, in any case, and none where the holder left the slot empty: two answers
    decided by the slot, where the spelling used to decide as well.
  • DocxShippedLines javadoc, the capability details' DOCX font entry and the CHANGELOG say so,
    including the exception that stands: where the editor has a font of that name itself, its own font
    wins.

No public API changes. The 105-document corpus exports unchanged, part for part, with the same 1,718 notes: no
document in it spells a shipped name in another case.

Tests

  • New DocxSharedFontNameTest.aGivenUpFamilyReadsTheHoldersLineWhicheverCaseItSpellsTheNameIn: the
    table above. Before the change it failed with [336 atLeast, 336 exact, 336 exact].
  • New DocxGrownLinesTest.aWordListsMarkerSpellingItsFaceInAnotherCaseIsReadInThatFace: a list
    marker whose level spells LATO or lato over a shipped Lato reads the same reach as one
    spelling Lato — the line and the character map both, the other case asked first so the face's
    file is read under it.
  • aGivenUpFamilySpelledAnotherWayClaimsNoLineOfItsOwn, renamed
    aGivenUpFamilySpelledInAnotherCaseReadsTheHoldersLine, keeps its result (364 exact, Lato
    holder, IBM Plex Mono given up as CASESHARED): it now reads the holder's line, which that pair
    holds exact.
  • Sabotages, both caught: the line map keyed by exact spelling again (both new tests fail); the file
    map keyed by exact spelling again (the marker test fails, asking the other case first so the
    face's file is read under it). The character-map cache is not sabotaged separately.

…its name

A family given up because another family already ships a face set under
its wordFamily() is set in the holder's faces whichever case its runs
spell the name in: measured in Word 16 on a document declaring the name
once, runs spelled in upper and in lower case were drawn from the
holder's program at its width and on its line. DocxShippedLines kept
each face's line, and its file for the glyph check, under the exact
spelling, so such a run read no line and its paragraph was held exact
where the holder's spelling could grow to a least line: two
registrations of Lato Regular at 14pt wrote 336 atLeast for FoldShared
and 336 exact for FOLDSHARED and foldshared.

The three maps are now ordered with String.CASE_INSENSITIVE_ORDER, the
folding of the equalsIgnoreCase that DocxFontTable decides a shared name
with, independent of the default locale. A run naming a shipped name in
another case reads that face's line where the face fills the slot, and
none where it leaves the slot empty.

LibreOffice was not measured on this shape.
DocxShippedLines now names the exception the CHANGELOG and the
capability details give: where the editor has a font of the name
itself, its own font wins. DocxFontTable's account of where a given-up
family's runs are set says both editors where the runs spell the
holder's name, and Word 16 where they spell it in another case. The
marker test says the marker follows the same lookup and was not
measured itself, and the details name the pair whose every route writes
the measured height.
@DemchaAV
DemchaAV marked this pull request as ready for review November 25, 2026 23:56
@DemchaAV
DemchaAV merged commit 7335cd4 into develop Nov 26, 2026
13 checks passed
@DemchaAV
DemchaAV deleted the fix/docx-shipped-line-any-case branch November 26, 2026 00:35
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