Skip to content

GraphCompose v2.5.2

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Nov 00:11

v2.5.2 — 2026-11-26

  • Side-by-side text on a simple canvas of shapes and paragraphs lands in Word where the PDF puts
    it.
  • A Mint Editorial CV with a header band now fits on two pages in Word, as in the PDF.
  • Large tables export to Word about 1.5× faster, and with less memory.
  • A PowerPoint deck in your own single-file font exports faster.
  • PowerPoint's warning about a font the deck does not carry now comes once per family.

No API changes: a drop-in upgrade from 2.5.1. The entries below give the detail.

Fixed

  • A DOCX canvas that places its text side by side or out of reading order sets it where the
    page does.

    • A canvas (addCanvas, CanvasLayerNode) was written as its contents: its drawings stood
      where it placed them, and its text one block under another from its corner. A canvas that
      places its text side by side or out of reading order came out with its text stacked at its
      left edge. On TwinOutputExample's 960 by 540pt page, which is one canvas, Word 16 set every
      one of its 43 lines, and LibreOffice every one it set, as much as 820pt across and 222pt down
      from where the page sets them. On MavenBannerPptxExample's first page the caption went to
      the second page and took the four pages after it one page later.
    • Such a canvas in the body's flow is now written over its page, as a block laid over the flow
      already is: its drawings stand where the page draws them, each paragraph in a text box where
      the page sets it, and the flow holds the canvas's room. Where the canvas opens a page, the
      room is a line of its own, whose height Word and LibreOffice keep at a page's top where they
      drop a paragraph's space above: owed as that space, the paragraph under a canvas moved to a
      new page stood 139.8pt high in both, and within 0.3pt held in the line. A canvas alone on its
      page — a cover, a page of a deck — holds its room in such a line too, which carries its text
      boxes there: with nothing else written on its page they were dropped, or carried by a page
      break's paragraph at the page's top, where Word set a box within that paragraph's line 7pt
      high. A page break right after the line goes in it, or its own paragraph would stand on the
      next page and break it again; where the next page is set against other margins, the section
      break that starts it takes that page break's place, as it takes the place of the one in a
      page break's own paragraph. Elsewhere the room is owed as space to what follows, and nothing
      is written where nothing follows. Measured by baseline against the
      engine's PDF in Word 16 and LibreOffice 26.8: TwinOutputExample's 41 lines that both
      editors break as the page does within 0.6pt, and the banner's first page within 0.7pt with
      its caption back on it and five pages in both. One paragraph of TwinOutputExample, set at
      12.3pt, is written at 12.5pt — a Word file holds a size to the half point — and breaks a word
      sooner in both.
    • A canvas whose blocks read down — each starting at or below the foot of the one before,
      however far across — stays in the flow and is written as its contents as before, where a
      reader of the flow reaches its text: a CV's name over its title is that, as in
      MintEditorial with a header band. It keeps each block as far down as it places it (see
      "A DOCX canvas whose text reads down keeps each block where the page sets it down"); how far
      across is still not carried, and the report names it.
    • Only a canvas holding nothing but drawing and plain paragraphs on one page is, as for a block
      laid over the flow: a link, a bookmark, an anchor, a picture, a table, a list, a spacer, a
      chart, a barcode, a row, a nested canvas or a transformed block it holds keeps it written as
      its contents, and so does a canvas spanning two pages, or in a table cell, a painted panel, a
      band, another overlay or a stack of one layer. The report names each as before.
    • Text in a text box stands outside the document's flow: each box is anchored in a paragraph
      near it and moves with that paragraph, but what is typed into it moves nothing round it, and
      a reader of the flow alone does not reach it. The report names each such paragraph.
  • A DOCX canvas whose text reads down keeps each block where the page sets it down.

    • A canvas written as its contents (addCanvas, CanvasLayerNode) wrote what it holds one
      block under another from its corner, and owed under the last the room its height left below
      that stack. Where it placed a block lower than the foot of the one before, the distance was
      lost, and where its corner stood higher than Word sets its first block — a canvas pulled up by
      a negative top margin — the room owed below was too large by that much. MintEditorial with a
      header band, a canvas pulled 48pt up to the page's top edge with its name 48pt down it and its
      title 3pt under the name, set its title 2.9pt high in Word 16 and 3.3pt high in LibreOffice
      26.8, its rule 3pt high, and owed 48pt more room under the masthead than the page holds: the
      row under it no longer fitted the first page, and the CV took three pages in both where the
      page takes two. The paired cover letter's lines stood 48pt low.
    • A canvas whose blocks read down — each starting at or below the foot of the one before — now
      sets each as far below the one before as it places it, the first as far below its corner,
      and owes the room it leaves under the foot of the last. A negative top margin's pull comes out
      of the space above its first block, so a table first stands where the page sets it too; on a
      page the canvas opens, the line holding its top edge holds that space. Measured by baseline against the
      engine's PDF: the banded MintEditorial CV is two pages in both editors, its 102 lines within
      0.24pt in Word 16 and 1.3pt in LibreOffice 26.8 — as the CV without a band measures — and its
      rule where the page draws it; the banded cover letter's lines, 48pt low, are within 0.18pt and
      1.3pt.
    • How far across it places them is still not carried: such a canvas writes its blocks at its
      left edge, and the report names one that places a block elsewhere. It also names a block placed
      higher than the foot of the one before, or than the canvas's corner, which Word sets at that
      foot or corner; a first block that a negative top margin pulls up further than it places it
      below the corner (for a paragraph first, further than the space owed above the canvas too),
      which Word sets up to that much lower; and, for a canvas pulled up past the page's margin that the layout moves to a new
      page, the space above its first block where a paragraph opens that page with it, which Word
      drops there. A table, a row or a panel first holds that space in a line of its own.
  • A DOCX paragraph in a family given up for a shared Word name reads the holder's line in whichever
    case it spells the name.

    • A family whose wordFamily() asks for a name another family already ships a face set under is
      given up, and its runs are set in the holder's faces — where a run spells the name in another
      case too: 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. Where the
      editor has a font of that name itself, its own font wins, as before.
    • The line each shipped face is set in was kept under the exact spelling, so such a run read no
      line, and its paragraph was held to an exact height where one spelling the name the holder's
      way could grow to a least one, as it does for two registrations of one face: Lato Regular at
      14pt wrote 336 atLeast for FoldShared and 336 exact for FOLDSHARED and foldshared.
    • The line is now kept under the name matched without case, the way DocxFontTable decides that
      two families share one. So a run naming a shipped name in another case reads that face's line
      — a given-up family's, or one that shipped nothing of its own — where the face fills the slot,
      and none where it leaves the slot empty. LibreOffice was not measured on this shape.
  • A PPTX font the deck does not carry is announced once, and by what the registered families carry under its name.

    • The render.pptx.font.substitution lines for a registered family were written per
      registration, so a family registered twice was announced twice; the module README promises one
      line per family per render. They are now written once per family name, after the last
      registration has been read, and the last registration of a name decides the line — the one
      whose viewer family the runs are written with and whose program the page was measured in.
    • Which line a family gets was decided by the family alone, so a deck carrying a program under
      the family's viewer name from another registered family could be told the opposite. A family
      registered without binary sources beside a binary one declaring its name with wordFamily(...)
      was told no program for "Brand" travels with the deck while one did. A family whose font only one of
      the backend's two readers accepts, sharing a viewer name with one that travels, was told it
      needs its font installed when it was registered first and that its text is drawn from the
      other program when it was registered second — for two byte-identical decks. A bundled family
      the render was told not to carry, drawn beside a registration declaring its name, was told the
      deck references it by name only.
    • Every such family, where the carrier is another registration, now gets the line that says its
      text is drawn from the program that travelled under the shared viewer family, whatever the reason it is not carried and in either
      order of registration; a face that was refused is still named, with the reason, by
      render.pptx.font.embed.skipped, once per registration. A family whose viewer name nothing
      else carries keeps a line of its own. Only the log changed: a deck rendered for each of these
      arrangements, in both orders where there are two registrations, is the same bytes before and
      after.
    • The carrier has to be another registered family. A registration declaring a bundled
      family's name, and not carried itself, is still told it needs its font installed when the
      bundled program travels under that name, because the bundled families are carried after the
      last slide and the registered families' lines are written before the first. A family name
      registered again without sources, after a registration of it that travelled, is likewise told
      only what its last registration lacks.
  • A PPTX font the deck carries nothing of is told so.

    • A registered or bundled family the deck could not carry was told "X" is not carried whole,
      which is worded for a deck holding part of the family. Every refusal a font can provoke —
      a face that cannot be read, licence bits that forbid embedding, a header the presentation
      could not read back, two of the family's faces reading back as one style slot, and for a
      registered family its viewer metrics — arrives before the presentation is handed a face, and
      leaves nothing of the family in the deck. Such a family is now told no face of it travels with the deck, and what its text needs. A family whose declared name another registered
      family carries a face under keeps the line saying its text is drawn from that program, whatever
      refused it.
    • not carried whole stays where something of the name is in the deck: an earlier registration
      of the same family name travelled and its last one did not, or the presentation refused a face
      it had been handed, which only POI's own part store can do. On every path a font can reach,
      only the log changes: what a deck carries is unchanged.

Performance

  • A PPTX deck reads a registered font's viewer metrics from each font file once. The deck it
    writes is the same bytes.

    • Before a slide is drawn, the export reads the ascent of each of a registered family's four
      faces through Font.createFont. It read each slot's file afresh, so a family registered from
      one file, which fills all four slots with it, was parsed four times. Each file is now read
      once, keyed by its source's description, as the font programs read beside it are.
    • Measured outside the build, logging quiet, a family registered from one file: the metrics read
      took Cousine (301 KB) 9.8 → 2.3 ms and Gothic A1 (2.2 MB) 26 → 5.9 ms; a one-page deck in
      that family, median of 400 exports in each of two alternating rounds, 51–54 → 43–45 ms and
      131 → 111–112 ms. A family registered from four files reads four files, as before.
    • Measured byte-identical: every part of six decks — a family from one, two and four files, two
      registered families, and a bundled font alone.
  • A large table's DOCX export no longer reads its rows quadratically, nor makes XMLBeans throw
    for every colour.
    The file it writes is the same bytes.

    • POI's XWPFTable.getRow(int) and getNumberOfRows() count the table's rows on every call, and
      the export read each row that way several times while writing it, so the reads grew with the
      square of the table's rows. The rows are now read from POI's own list of them, in the passes
      that write a table's rows.
    • A Word colour attribute (w:color, w:fill) holds either the word auto or three hex bytes.
      Given a colour as a hex string, XMLBeans tried it as the word first and threw and caught an
      XmlValueOutOfRangeException, stack trace included, for every colour that is not auto —
      four for each ruled cell. Every such attribute the export sets to a colour — on borders,
      shading, a run, the Normal style, a timeline rail — is now given its bytes, which XMLBeans
      writes as the same upper-case hex.
    • The passes that count the lines written at an exact height and fill the shaded spaces closing a
      paragraph asked each paragraph and run for a few of its children through an XPath of its own;
      they walk the children now.
    • JMH DocxExportJmhBenchmark, -prof gc, allocation per export, the mean of two runs:
      table1000 233 → 159 MB, report20 10.1 → 9.5 MB, small 1.87 → 1.68 MB, images20
      2.99 → 2.92 MB. Time was measured on a machine other builds were loading, so as pairs: run
      alternately, one fork of each build a round, table1000 was faster in three rounds of four
      (median 1,496 → 476 ms/op), and its thread CPU time per export in the quietest round went
      688 → 500 ms; the smaller shapes move within the noise.
    • Measured byte-identical: the 105 documents of the DOCX fidelity corpus, every part of each, with
      the same 1,718 report notes; and the benchmark's four documents, every part but the creation
      time in docProps/core.xml.
    • Measured again against the published 2.5.1 with a plain harness, not JMH, on a machine with
      other work running: the benchmark's table1000, report20 and small documents, each built
      and exported in a fresh session, logging quiet, the median of 25 runs, each timed from building
      the session to closing it, after 15 warm-ups, in two alternating rounds. table1000 took 722
      and 680 → 463 ms and allocated 232–233 → 155–157 MB on its thread; report20 allocated 10.3 →
      9.5–9.6 MB and small 1.91 → 1.71 MB, their time within the noise. The same three documents'
      PDF export did not move: table1000 took 59–63 ms before and 58–62 ms after, and allocated
      24–25 MB on both builds.

Internal

  • The PPTX backend's internal javadoc says what a render built with embedBundledFonts(false)
    is warned about.
    It said such a render must not be told to register what it declined. It is
    told: a bundled family it draws in that ships a binary and is not registered gets the name-only
    warning, which points at registerFontFamily, because a family registered with binary sources
    goes to the embedder whatever that flag says. (Where a registered family carries a face under
    the name its runs are written with, the line says instead that its text is drawn from that
    program; see "A PPTX font the deck does not carry is announced once" above.) A test now follows
    that advice on such a backend and finds the family carried and no longer reported.
    TemplateTestSupport.assertPdfUsesFont, which nothing called, is removed from the qa test
    sources.
  • PptxRenderEnvironment no longer carries the PPTX backend's font embedding. Embedding had
    grown into most of the class (1,426 lines), and now lives in package-private classes beside it:
    PptxDeckFonts (which families a render carries, the viewer family a run is written with, and
    the render.pptx.font.substitution lines), PptxFontEmbedder (reading a family's faces,
    refusing it whole, handing the programs to the presentation, with the embed.skipped lines that
    say why a face did not travel and the shared.family and name.mismatch lines about what it
    noticed on the way), PptxSlotLedger (which face holds each style slot of a declared viewer
    family) and the PptxFontFace enum the first two share. The environment keeps every public
    method; the font ones delegate. No behaviour changes: decks rendered with deterministic(...)
    are the same bytes, and the render log carries the same lines in the same order.
  • DocxFontTable is split in four. The class (868 lines, now 477) keeps the font table
    itself — which faces the document asks for, which family keeps a declared name and the refusal
    of the one that does not, and the parts and XML it writes — and three package-private classes
    beside it take the rest of what it held: DocxShippedLines (the line an editor
    sets each shipped face in, formerly DocxFontTable.ShippedLines), DocxFontFaces (a family's
    faces: the slot each fills, reading each one's file and terms, and the note on a face an editor
    will not draw) and DocxTypeface (the typeface a program states). The font lines are logged
    under the same category as before. No behaviour changes: the 105 documents of the DOCX fidelity
    corpus are the same bytes, with the same report notes. The shared-name cases of
    DocxFontTableTest moved to DocxSharedFontNameTest, and the helpers both use to
    DocxFontTableFixtures.
  • The render backends' CodeQL alerts are cleared. 23 of the 38 open in render-docx,
    render-pdf and render-pptx are cleared in code: a never-read local in the DOCX writer (its
    call, which owes the canvas's space, kept), a javadoc block moved back onto the method it
    describes, private overloads that dispatched on the argument's static type renamed
    (twipsOf(CTTblWidth), holdsText(DocumentNode), PdfTrackedFontView.widened(COSBase)),
    @Override on PdfFont, the tiled watermark's loop bounds made explicit (Java already widened
    the float position to compare it with the double canvas size; the bytecode is the same), an
    unused private parameter, and four test files — among them a PPTX test helper that took a
    filter argument it never used. The other 15 are left: type-test chains over the node kinds the
    DOCX writer handles (a kind it does not know takes its fallback) and over the sealed
    ShapeOutline permits, parseInt on text a pattern has already matched as hex, and tests parsing what
    the exporter wrote. No behaviour changes: the 105 documents of the DOCX fidelity corpus are the
    same bytes, with the same report notes.
  • The core module's CodeQL alerts are cleared. 21 of the 43 open in core are cleared in
    code: two never-read locals in LayoutCompiler, unused parameters of five private methods, a
    fallback in the row's weight split that tested n > 0 inside a loop over n, a string compared
    by reference where equals gives the same answer (the Arabic shaper returns the same string when
    it changes nothing), an unqualified size() in BoundedLruCache's
    eviction hook spelled this.size(), a Lombok @NonNull on StrokeColor whose check ran only
    after the argument was already dereferenced, @Override where FontBase, ImageBuilder and
    DividerBuilder override (the FontBase getters Lombok generated are now written out, so they
    carry it), and TocBuilder calling RowBuilder.spacing over the deprecated gap. The other 22
    are left: record-component @param tags that CodeQL matches against generated members,
    parameters of interface methods that implementations are handed (NodeDefinition, the beta
    node SPI, and the internal ResolvedLayoutPass), records whose lists are an immutable
    copy or shared on purpose, a type-test chain over the sealed ShapeOutline permits,
    parseInt over the constant table of SVG colour names, a test helper qa uses through the
    core test jar, tests parsing text a pattern has already matched, and four Lombok builders whose
    generated toString() prints a DocumentColor or DocumentPageNumbering, which have no
    toString of their own; giving them one is new public API and changes what every value
    holding one prints. No behaviour changes: the 105 documents of the DOCX fidelity corpus are
    the same bytes, with the same report notes.
  • The templates module's CodeQL alerts are cleared. 28 of the 48 open in templates are
    cleared in code. The CV, invoice and proposal presets and a receipt component made 24 calls of
    the deprecated RowBuilder.gap, which only passes the value on to spacing: 19 now call
    spacing, and 5 that followed a spacing(0) with gap(0) on the same row are dropped. A
    javadoc block that a removed method left in TerracottaRailWidgets is removed too. Two private
    methods lose a parameter they never read, along with the width MonogramSidebar computed only
    to pass to one of them. The other 20 are left: tests that pin a deprecated method on purpose
    (TextOrnaments.spacedUpper, the three-argument BrandTheme constructor and
    CvDocument.ofMainSections, each kept until a major release removes it), a record whose lists
    are an immutable copy, and parseDouble on the viewBox of the icons the Orange Ops CV preset
    packages, read only for a token checked against that set. No behaviour changes: the 105
    documents of the DOCX fidelity corpus are the same bytes, with the same report notes, and the
    qa layout snapshots and pixel baselines of the presets do not move.

Build

  • The post-release showcase restore in cut-release.ps1 passes its -- to git. PowerShell
    reads a bare -- in a call to one of its own functions as the end of that function's
    parameters and drops it, so Invoke-Git checkout -- web/showcase ran
    git checkout web/showcase. With no branch or tag of that name it restored the paths as meant;
    with a branch of that name it switches to it, with a tag it detaches at it, and either way the
    re-rendered previews stay in the tree. The call now passes '--' quoted, which arrives intact;
    it was the only call to a function of the script that passed a bare one.
    ReleaseScriptGitExitCodeGuardTest refuses a bare -- in any call to Invoke-Git, and a new
    step of release-script-check.yml, A pathspec separator reaches git, refuses one in a call
    to any function the script defines, and runs the restore in a repository holding a branch named
    web/showcase: the files come back and the branch stays where it was.
  • A pull request that changes the Maven the release smoke runs on now runs the staged smoke.
    The provenance steps of release-script-check.yml feed the check records written by hand, so
    they pin the format the check knows: the move to Maven 3.10, which records the staged
    repository as staged-<sha1> instead of staged, surfaced only on the 2.5.0 cut. The new
    release-smoke-staged.yml runs on a pull request that touches .mvn/, mvnw, mvnw.cmd or
    scripts/release-smoke/. It stages the published train of the version run.sh smokes by
    default — resolved from Central by the repository's own wrapper and copied out as jars, POMs and
    .sha1 files, the shape of the unzipped bundle — and runs run.sh --staged-repo against it on
    Linux, so the records the check reads are the ones that Maven writes. While a cut is between its
    release commit and Central the version is not published, and the job skips the smoke with a
    notice. A scenario must now pass against the published version run.sh names on every such
    pull request, not only at the cut.
  • The JMH benchmarks in benchmarks.jar run with quiet logging. Only the manual harness
    applied logback-benchmark.xml; a forked JMH JVM found no Logback configuration, fell back to
    Logback's default and printed every engine DEBUG line to the console — 32.8 MB of output for one
    CanonicalRender fork, 22.2 MB for the four DocxExport.docx shapes. Every JMH benchmark now
    extends QuietJmhBenchmark, whose static initializer applies the manual harness's quiet
    configuration and initializes Logback before the fork loads anything that logs, so Logback's
    start-up is outside every measured region; the same two runs print 6 KB and 19 KB. The logging
    was inside the measured region: CanonicalRender allocated 333 172 B/op with it and
    273 169 B/op without, each ColdStart shot 12.5–13.2 % less, and the table1000 shape of
    DocxExport.docx 4.8 % less; the other three shapes moved within their error. JMH results
    recorded before 2.5.2, the weekly benchmarks-jmh.yml series among them, are not comparable
    with later ones. -jvmArgsAppend "-Dgraphcompose.benchmark.logging=debug" keeps the engine's
    logging, as -Dgraphcompose.benchmark.logging=debug does for the manual harness.
    JmhQuietLoggingGuardTest reads META-INF/BenchmarkList, the list the JMH runner reads, adds
    the @State classes the benchmarks take and every @State class of the package, and fails for a
    class whose initialization leaves the engine's loggers at DEBUG.