kumiori 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/CHANGELOG.en.md +428 -1
  2. package/CHANGELOG.md +427 -0
  3. package/NOTICE +2 -0
  4. package/README.en.md +93 -32
  5. package/README.md +93 -32
  6. package/THIRD_PARTY_NOTICES.md +1292 -71
  7. package/dist-browser/NOTICE +2 -0
  8. package/dist-browser/THIRD_PARTY_NOTICES.md +1292 -71
  9. package/dist-browser/chunks/{UTIF-BA_P1T7D.js → UTIF-D5qoainF.js} +5 -2
  10. package/dist-browser/chunks/ccitt-7WmwG6OA.js +1640 -0
  11. package/dist-browser/chunks/cgm-DUIP-hbA.js +2103 -0
  12. package/dist-browser/chunks/el-monoton-BVsCvfmZ.js +684 -0
  13. package/dist-browser/chunks/{en-gb-c-j9Dxjw.js → en-gb-Cjtf0A6r.js} +21 -2
  14. package/dist-browser/chunks/{en-us-FyKZ4pMu.js → en-us-B_UiZPbu.js} +11 -2
  15. package/dist-browser/chunks/eps-_CPowVcQ.js +5237 -0
  16. package/dist-browser/chunks/epsInfo-BUAZ97F-.js +565 -0
  17. package/dist-browser/chunks/{export-contract-BUdFW0fL.js → export-contract-OHP-GNO0.js} +4 -1
  18. package/dist-browser/chunks/{la-Cbb7zL-J.js → la-7qtmi2aU.js} +21 -2
  19. package/dist-browser/chunks/load-BRpJTflg.js +16686 -0
  20. package/dist-browser/chunks/matrix-BcBTRcOc.js +48 -0
  21. package/dist-browser/chunks/metafile-BikFmcYd.js +1867 -0
  22. package/dist-browser/chunks/{pako-BWg-BM0p.js → pako-Dl02IHsa.js} +7 -4
  23. package/dist-browser/chunks/pixels-ByXzkjlj.js +714 -0
  24. package/dist-browser/chunks/{rolldown-runtime-DfEuXgQw.js → rolldown-runtime-Bra2mvh4.js} +3 -0
  25. package/dist-browser/chunks/ru-BMiVc5Ts.js +9694 -0
  26. package/dist-browser/chunks/sniff-B_ueafAB.js +8779 -0
  27. package/dist-browser/chunks/strokeOutline-DA-aSg5C.js +1107 -0
  28. package/dist-browser/chunks/uk-ChOFgYc8.js +6134 -0
  29. package/dist-browser/kumiori.js +42588 -41340
  30. package/dist-cli/NOTICE +2 -0
  31. package/dist-cli/THIRD_PARTY_NOTICES.md +1292 -71
  32. package/dist-cli/assets/cgm-CVN2h83E.js +3239 -0
  33. package/dist-cli/assets/drawioStencil-Bzai2moR.js +991 -0
  34. package/dist-cli/assets/eps-BK1bEizE.js +7496 -0
  35. package/dist-cli/assets/load-BwlOZ5Bc.js +39125 -0
  36. package/dist-cli/assets/metafile-DmYDB8sR.js +2522 -0
  37. package/dist-cli/cli.js +76289 -52220
  38. package/dist-lib/NOTICE +2 -0
  39. package/dist-lib/THIRD_PARTY_NOTICES.md +1292 -71
  40. package/dist-lib/api-DB-5PKHp.js +56488 -0
  41. package/dist-lib/cgm-CkwJobkQ.js +2103 -0
  42. package/dist-lib/eps-D9WVND82.js +5236 -0
  43. package/dist-lib/epsInfo-BUAZ97F-.js +565 -0
  44. package/dist-lib/index.js +13 -43701
  45. package/dist-lib/load-plWCtVUv.js +15328 -0
  46. package/dist-lib/metafile-BOfMQbwN.js +1867 -0
  47. package/dist-lib/node.js +89 -0
  48. package/dist-lib/pixels-ByXzkjlj.js +714 -0
  49. package/dist-lib/types/api.d.ts +100 -13
  50. package/dist-lib/types/arabicMarks.d.ts +16 -0
  51. package/dist-lib/types/areaResources.d.ts +20 -3
  52. package/dist-lib/types/areaTree.d.ts +5 -3
  53. package/dist-lib/types/arrayLoop.d.ts +13 -0
  54. package/dist-lib/types/assets.d.ts +84 -5
  55. package/dist-lib/types/base64.d.ts +14 -1
  56. package/dist-lib/types/canvasRenderer.d.ts +3 -3
  57. package/dist-lib/types/ccitt.d.ts +8 -0
  58. package/dist-lib/types/cff2Instancer.d.ts +45 -0
  59. package/dist-lib/types/cgm.d.ts +13 -2
  60. package/dist-lib/types/color.d.ts +9 -3
  61. package/dist-lib/types/colorGlyph.d.ts +442 -0
  62. package/dist-lib/types/colorGlyphCanvas.d.ts +31 -0
  63. package/dist-lib/types/colorGlyphPdf.d.ts +119 -0
  64. package/dist-lib/types/colorGlyphSvg.d.ts +7 -0
  65. package/dist-lib/types/compat.d.ts +27 -9
  66. package/dist-lib/types/counterStyle.d.ts +14 -2
  67. package/dist-lib/types/counterStylePredefined.d.ts +1 -1
  68. package/dist-lib/types/cssCascade.d.ts +80 -6
  69. package/dist-lib/types/cssColorFunctions.d.ts +51 -0
  70. package/dist-lib/types/cssGradient.d.ts +49 -0
  71. package/dist-lib/types/cssSelector.d.ts +75 -4
  72. package/dist-lib/types/cssText.d.ts +31 -5
  73. package/dist-lib/types/cssTransform.d.ts +25 -0
  74. package/dist-lib/types/cssUnsupported.d.ts +6 -2
  75. package/dist-lib/types/cssUrlScan.d.ts +12 -0
  76. package/dist-lib/types/documentResources.d.ts +7 -6
  77. package/dist-lib/types/drawio/base64.d.ts +6 -0
  78. package/dist-lib/types/drawio/drawio.d.ts +137 -0
  79. package/dist-lib/types/drawio/drawioCanvas.d.ts +156 -0
  80. package/dist-lib/types/drawio/drawioEdges.d.ts +89 -0
  81. package/dist-lib/types/drawio/drawioJs/archimate.d.ts +33 -0
  82. package/dist-lib/types/drawio/drawioJs/arrows.d.ts +37 -0
  83. package/dist-lib/types/drawio/drawioJs/aws3d.d.ts +18 -0
  84. package/dist-lib/types/drawio/drawioJs/basic.d.ts +29 -0
  85. package/dist-lib/types/drawio/drawioJs/bpmn.d.ts +35 -0
  86. package/dist-lib/types/drawio/drawioJs/edges.d.ts +19 -0
  87. package/dist-lib/types/drawio/drawioJs/electrical.d.ts +29 -0
  88. package/dist-lib/types/drawio/drawioJs/misc.d.ts +34 -0
  89. package/dist-lib/types/drawio/drawioJs/mockup.d.ts +27 -0
  90. package/dist-lib/types/drawio/drawioJs/mockupIos.d.ts +2 -0
  91. package/dist-lib/types/drawio/drawioJs/ui.d.ts +34 -0
  92. package/dist-lib/types/drawio/drawioShapes.d.ts +51 -0
  93. package/dist-lib/types/drawio/drawioShapesA.d.ts +23 -0
  94. package/dist-lib/types/drawio/drawioShapesB.d.ts +26 -0
  95. package/dist-lib/types/drawio/drawioSketch.d.ts +50 -0
  96. package/dist-lib/types/drawio/drawioStencil.d.ts +159 -0
  97. package/dist-lib/types/drawio/drawioTapered.d.ts +67 -0
  98. package/dist-lib/types/drawio/drawioText.d.ts +27 -0
  99. package/dist-lib/types/drawio/drawioXml.d.ts +40 -0
  100. package/dist-lib/types/drawio/index.d.ts +37 -0
  101. package/dist-lib/types/drawio/inflate.d.ts +12 -0
  102. package/dist-lib/types/drawio/load.d.ts +35 -0
  103. package/dist-lib/types/drawio/messages.d.ts +12 -0
  104. package/dist-lib/types/drawio/options.d.ts +44 -0
  105. package/dist-lib/types/drawio/prefixSums.d.ts +9 -0
  106. package/dist-lib/types/drawio/sniff.d.ts +16 -0
  107. package/dist-lib/types/eps.d.ts +28 -15
  108. package/dist-lib/types/epsInfo.d.ts +36 -0
  109. package/dist-lib/types/foContext.d.ts +18 -2
  110. package/dist-lib/types/foMathFallback.d.ts +11 -3
  111. package/dist-lib/types/foPageMaster.d.ts +6 -4
  112. package/dist-lib/types/fontInstancer.d.ts +56 -0
  113. package/dist-lib/types/fontLoader.d.ts +29 -0
  114. package/dist-lib/types/fontManager.d.ts +352 -10
  115. package/dist-lib/types/fontMapping.d.ts +67 -7
  116. package/dist-lib/types/fontSanity.d.ts +76 -0
  117. package/dist-lib/types/fontVariation.d.ts +45 -0
  118. package/dist-lib/types/fontkitCffFlex.d.ts +5 -0
  119. package/dist-lib/types/fontkitEmptyGlyph.d.ts +17 -0
  120. package/dist-lib/types/fontkitShaping.d.ts +135 -0
  121. package/dist-lib/types/footnotes.d.ts +9 -2
  122. package/dist-lib/types/geometry.d.ts +1 -1
  123. package/dist-lib/types/grapheme.d.ts +23 -0
  124. package/dist-lib/types/hebrewMarks.d.ts +30 -0
  125. package/dist-lib/types/htmlImport.d.ts +124 -7
  126. package/dist-lib/types/htmlPaged.d.ts +140 -17
  127. package/dist-lib/types/htmlParserStack.d.ts +26 -0
  128. package/dist-lib/types/htmlPrepare.d.ts +97 -8
  129. package/dist-lib/types/htmlSvg.d.ts +20 -3
  130. package/dist-lib/types/hyphenation.d.ts +14 -3
  131. package/dist-lib/types/imageFormats.d.ts +138 -0
  132. package/dist-lib/types/imageInfo.d.ts +12 -3
  133. package/dist-lib/types/imageLimits.d.ts +241 -0
  134. package/dist-lib/types/index.d.ts +12 -7
  135. package/dist-lib/types/indexCitation.d.ts +73 -0
  136. package/dist-lib/types/inflateFast.d.ts +12 -0
  137. package/dist-lib/types/inlineFlatten.d.ts +52 -5
  138. package/dist-lib/types/inlineLayout.d.ts +245 -15
  139. package/dist-lib/types/jis.d.ts +26 -11
  140. package/dist-lib/types/layoutEngine.d.ts +124 -7
  141. package/dist-lib/types/ligature.d.ts +29 -0
  142. package/dist-lib/types/lineBreak.d.ts +24 -0
  143. package/dist-lib/types/lineMetrics.d.ts +13 -4
  144. package/dist-lib/types/linearText.d.ts +69 -0
  145. package/dist-lib/types/linkPolicy.d.ts +80 -0
  146. package/dist-lib/types/lnode.d.ts +116 -32
  147. package/dist-lib/types/mathContent.d.ts +1 -1
  148. package/dist-lib/types/mathLayout.d.ts +14 -1
  149. package/dist-lib/types/measurer.d.ts +121 -5
  150. package/dist-lib/types/messages.d.ts +8 -2
  151. package/dist-lib/types/metafile.d.ts +7 -4
  152. package/dist-lib/types/node.d.ts +12 -0
  153. package/dist-lib/types/nodeFonts.d.ts +46 -0
  154. package/dist-lib/types/orthographicSyllable.d.ts +59 -0
  155. package/dist-lib/types/pageNumber.d.ts +7 -0
  156. package/dist-lib/types/paint.d.ts +29 -5
  157. package/dist-lib/types/paintEffect.d.ts +55 -0
  158. package/dist-lib/types/pdfCheck.d.ts +36 -0
  159. package/dist-lib/types/pdfLibPatches.d.ts +19 -1
  160. package/dist-lib/types/pdfRenderer.d.ts +50 -14
  161. package/dist-lib/types/pdfStandard.d.ts +78 -0
  162. package/dist-lib/types/pixels.d.ts +37 -3
  163. package/dist-lib/types/psCff.d.ts +10 -3
  164. package/dist-lib/types/psColorSpace.d.ts +1 -1
  165. package/dist-lib/types/psFilters.d.ts +19 -13
  166. package/dist-lib/types/psFonts.d.ts +2 -2
  167. package/dist-lib/types/psGraphics.d.ts +57 -7
  168. package/dist-lib/types/psInterp.d.ts +62 -2
  169. package/dist-lib/types/psOpsFont.d.ts +2 -2
  170. package/dist-lib/types/psOpsImage.d.ts +2 -2
  171. package/dist-lib/types/psOpsMatrix.d.ts +2 -2
  172. package/dist-lib/types/psOpsPath.d.ts +2 -2
  173. package/dist-lib/types/psOpsState.d.ts +2 -2
  174. package/dist-lib/types/psResources.d.ts +9 -1
  175. package/dist-lib/types/psShading.d.ts +6 -14
  176. package/dist-lib/types/resources.d.ts +116 -0
  177. package/dist-lib/types/sampleData.d.ts +3 -1
  178. package/dist-lib/types/sourceRef.d.ts +3 -3
  179. package/dist-lib/types/strokeOutline.d.ts +32 -0
  180. package/dist-lib/types/svg.d.ts +248 -11
  181. package/dist-lib/types/svgFilterRaster.d.ts +28 -0
  182. package/dist-lib/types/svgFilterSubregion.d.ts +46 -0
  183. package/dist-lib/types/tableBorders.d.ts +40 -5
  184. package/dist-lib/types/tableLimits.d.ts +29 -0
  185. package/dist-lib/types/tableMarkers.d.ts +64 -0
  186. package/dist-lib/types/textJustifyTrim.d.ts +12 -0
  187. package/dist-lib/types/types.d.ts +844 -29
  188. package/dist-lib/types/unicodeData.d.ts +9 -1
  189. package/dist-lib/types/webFont.d.ts +4 -0
  190. package/dist-lib/types/webp.d.ts +2 -2
  191. package/dist-lib/types/xslfoImport.d.ts +15 -7
  192. package/package.json +13 -5
  193. package/dist-cli/apple-touch-icon.png +0 -0
  194. package/dist-cli/favicon.ico +0 -0
  195. package/dist-cli/favicon.svg +0 -4
  196. package/dist-cli/kumiori-logo-on-dark.svg +0 -6
  197. package/dist-lib/index.js.map +0 -1
package/CHANGELOG.en.md CHANGED
@@ -4,6 +4,433 @@
4
4
 
5
5
  Version numbers follow [Semantic Versioning](https://semver.org/). During 0.x, incompatible changes may also be released in a minor version (such as 0.2.0).
6
6
 
7
+ ## 0.3.0 (2026-11-16)
8
+
9
+ A release that adds draw.io diagrams, plugins that add image formats, PDF/X-4 and more, and widens what SVG can draw. While in 0.x, it is a minor release because it includes fixes that change typesetting results.
10
+
11
+ - **draw.io diagrams**: draw.io (diagrams.net) diagram files (`.drawio`, `.dio`, including compressed pages) are read as images by default. A page is converted to SVG and placed in the PDF as shapes and text (usage: `docs/en/drawio.md`)
12
+ - The page to draw is selected after `#` in the image reference: `#page=N` (counted from 1), `#page-id=ID` or `#<page name>`. Without one, the first page is drawn; for a page that does not exist, the first page is drawn with a warning. `#` references that select the same page reuse the drawn diagram
13
+ - Shapes, edges and arrows are drawn by code ported from the public source code of draw.io and mxGraph: standard shapes, icon frames (AWS, GCP, Cisco and so on), shapes that draw.io draws in JavaScript (about 750), edge routing, line jumps, thick arrows, 34 edge end types, label placement per shape and curved text. Shadows (shapes, text and the whole diagram), the glass effect, gradients with end opacities, the sketch style (`sketch`, rough.js) and jiggled lines (`comic`)
14
+ - Shapes from shape libraries (`mxgraph.*`) and shapes embedded in diagrams (`stencil(…)`) are drawn. The libraries are not included in Kumiori; they are used only when passed with `drawio.stencils` (`--drawio-stencils` on the command line) or when fetching is allowed with `drawio.fetchStencils` (`--fetch-drawio-stencils`, `--drawio-stencils-url`) (draw.io's distributed `stencils.min.js` and library XML are read). The same applies to images from draw.io's distribution, such as the images inside SAP icons and clip art. On the command line, fetched files are saved in the font cache directory
15
+ - API: `TypesetOptions.drawio` (the type `DrawioOptions`: `stencils`, `fetchStencils`, `stencilsUrl` and `provideStencils`; `false` means draw.io diagrams are not read as images). `DRAWIO_MIME`, `isDrawio`, `createDrawioStencilRegistry` (creates the shape library registry `DrawioStencilRegistry` that `provideStencils` returns) and the types are exported. Command line: `--drawio-stencils`, `--fetch-drawio-stencils`, `--drawio-stencils-url` and `--no-drawio`. `--watch` also watches `.drawio` and `.dio` files
16
+ - Images given by URL are fetched under the same rules as the document's images (`resolveResource`, `fetchImages`). Text widths are measured with the fonts Kumiori draws with. When the API reuses the same `drawio` option across documents, an image fetched under one document's rules is not used for another document. Warnings are written in Japanese or English, following `lang` (`--lang` or the environment on the command line)
17
+ - The code that draws diagrams (including rough.js) is loaded only when a draw.io diagram appears (as for CGM, EPS, WMF and EMF; a separate file in the web app and the browser library). roughjs and pako were added as dependencies
18
+ - The shapes from draw.io's `shapes/` (`src/drawio/drawioJs/` and others) are ported from v24.7.5 (Apache License 2.0 only), before draw.io put a restriction of use on `shapes/` (`shapes/LICENSE`: use in Atlassian products; since v29.3.2), and follow the drawing of v24.7.5.
19
+ Shapes added after v24.7.5 are not included: `mxgraph.archimate4.*` (36 shapes), `mxgraph.c4.mobileDeviceContainer`, `mxgraph.bpmn.task2`, `data2`, `conversation2`, `mxgraph.atlassian2.icon` and `mxgraph.networks2.icon`. These shapes get only their text, with a warning that they are not drawn because they were added after v24.7.5 (not a warning that a shape library is missing, and nothing is fetched for them).
20
+ Style keys added later (keys that change colors, such as `strokeColor2`, `fillColor2` and `bodyColor`) are not read either
21
+ - The default version of the shape libraries and distributed images to fetch is also v24.7.5 (CC BY 4.0)
22
+ - The files ported from draw.io and mxGraph carry the copyright notices of the original files and a statement that they were changed (section 4 of the Apache License 2.0), and the chunks of the built JavaScript that include the draw.io code start with the copyright notices. The original files, their versions and notices are listed in section 13 of THIRD_PARTY_NOTICES.md. NOTICE also states that code was ported from draw.io and mxGraph
23
+ - Robustness against crafted diagrams: there are limits for inputs that exhaust time or memory from small files (XML close tags and skipped declarations, path moves, the length of `html=0` and placeholder labels and their total per diagram, the SVG length per diagram (16Mi characters, about 16.8 million), line-jump crossings, the inflated size of embedded shapes, cell coordinates and the diagram size (10 million px) and element nesting depth). Parts beyond a limit are not drawn and a warning is given (a single cell that exceeds the SVG length or the diagram size on its own is not drawn, and the rest of the diagram is). The number of hatch lines of sketch-style (`sketch=1`) fills is estimated from the size of the element drawn, also for shapes that a `style` value (`unitNum` of `rackCabinet`, `textSize` of button bars and so on) draws larger than their cell, and elements larger than 10 million px (width plus height) are drawn without the sketch style. Shapes that lay out `,`-separated items (button bars, menus, breadcrumbs, tab bars, pie charts and so on; eleven shapes) are drawn with work proportional to the number of items
24
+ - **Web app** (demo): a "draw.io の図" (draw.io diagrams) section was added to the settings. "draw.io の図を読む" (Read draw.io diagrams) turns reading diagrams on or off (on by default; the choice is remembered in the browser). When off, the code that draws diagrams is not loaded, and the open document's images are read again and the document is typeset again. Inside the section you can load draw.io shape library files (remembered in the browser), clear them, and choose to fetch them from draw.io only when a diagram needs them. Shape libraries (`stencils.min.js` or library XML) passed together with the opened files are used for that page session only. Diagrams referenced with a page after `#` (`figure.drawio#page=2`) are also redrawn when the settings change and when the diagram file is opened again on the same page
25
+ - **Plugins** (`plugins` in the API, `--plugin` and `--plugin-option` on the command line): plugins that add image formats can be passed (`KumioriPlugin`; the interface version `PLUGIN_API_VERSION` is 1). A format has a content check (`sniff`) and a loader (`load`, which returns SVG and a size), and Kumiori draws the result as an SVG image. `load` receives tools to measure text with the fonts that draw it, to fetch under the same rules as the document's images, to fetch URLs the user allowed through the plugin's options (`fetch`, with the time limit `fetchTimeoutMs`) and to report warnings, the language for warnings (`lang`) and the fragment of the image reference (after `#`; `fragment`, to select which diagram or page of a file to draw). When the same file is referenced with different fragments, it is loaded once per reference (each becomes its own image). A plugin runs with the same rights as Kumiori, so pass only ones you trust. The web app does not run programs supplied by users. The command's `--watch` also watches files with the extensions of plugin formats
26
+ - How the command's `--plugin` is resolved: specs starting with `./` or `../`, absolute paths and `file:` URLs are taken as file paths. Any other spec is first resolved as a package name, as `import()` does, from the current directory with the same conditions as `import()` (`import`, `node`, `default`) (including `@scope/name`, `name/sub` and ones ending in an extension, such as `kp/dist/plugin.js` or `chart.js`; an ESM package whose `exports` has only the `import` condition is loaded too). If it cannot be loaded as a package (no such package, and also when the package does not export that subpath in `exports` or its entry file is missing), the file of that name in the current directory is loaded (`--plugin myplugin.js`). Whenever it can be loaded as a package, the package is loaded (even when a file or directory of that name exists in the current directory), so write `./` to be sure of pointing to the file. When nothing is found, the error message says what was searched, in order
27
+ - When a plugin that cannot be loaded is given (also with `--watch`), the command prints only the error message and exits with code 1
28
+ - **PDF/X-4** (`pdfx: { version: 'X-4', profile }` in the API, `--pdfx x4 --output-profile <ICC>` on the command line): PDF/X-4 output is now available (PDF/X-3:2003 remains; X-3 is the default). X-4 requires an embedded output CMYK ICC profile (an error if it is missing or not CMYK), writes XMP metadata (`GTS_PDFXVersion`, dates, title, `Trapped`, IDs) consistent with the Info dictionary (ISO 32000-2 §14.3.2), keeps transparency as is, and writes PDF 1.6. The command-line options `--pdfx x3|x4`, `--output-profile` and `--output-condition` (the printing condition name; default JC200103) are added. Not checked against the text of the PDF/X standards (ISO 15930-6, -7)
29
+ - **Changes in PDF/X output** (both X-3 and X-4; non-PDF/X output is unchanged, and so are the positions of text, lines and images): only TrimBox is written on pages (no ArtBox). **Links, annotations and form fields on the pages are not written** (any that overlaps the area up to the bleed (BleedBox) even slightly is left out, and their number is reported in the warnings. The BleedBox encloses the whole artwork of the page, so practically all links on the pages are lost, both internal ones such as those of a table of contents and those to external URLs. 0.2.0 wrote them in PDF/X-3. Bookmarks are not annotations and are still written. Write PDFs for reading on screen without PDF/X). Without a title, Untitled is used. Following the recommendations of the GWG 2022-R1 submission specification, grey (R = G = B) text, lines and fills are written as K-only CMYK (grey images stay DeviceGray), and K 100% body text under 12pt (including text in the page margins) and lines and rules under 2pt get overprint (OP, op, OPM 1; ISO 32000-2 §8.6.7; text and lines inside images such as SVG and EPS do not). Of the GWG 2022-R1 requirements, differing trim sizes (R0004), spot colours (R0020) and image resolution (R0031; 149ppi or less is required, 224ppi or less recommended) are checked and reported in the warnings (the output is not changed)
30
+ - **SVG** (typesetting results change: SVG that previously could not be drawn and was rasterized or shown as a placeholder frame is now drawn as shapes):
31
+ - Selectors with combinators (descendant, child, next-sibling, subsequent-sibling), attributes and pseudo-classes in `<style>` now match (Selectors 4; the same matching as for HTML)
32
+ - text: `font-style` (upright glyphs are slanted if there is no italic face), per-character lists of `x`, `y`, `dx`, `dy` and `rotate`, `baseline-shift`, `dominant-baseline` and `alignment-baseline`, `word-spacing`, `paint-order`
33
+ - `objectBoundingBox` for `clipPathUnits` and `maskContentUnits`, `slice` in `preserveAspectRatio` of image, and images referring to external files (PNG and JPEG among the document's files; if missing, only that image is not drawn, with a warning)
34
+ - Gradients, opacity, clipping, blend modes and nested patterns in pattern contents; all 15 values of `mix-blend-mode`
35
+ - `systemLanguage` in switch and the conditional processing attributes, matched against the language where the image is placed (`lang`, `xml:lang`, `language`; the environment's language if none is given). Elements outside switch whose conditions are not met are not drawn either
36
+ - The filter approximation in Node (the CLI and the API) now also handles `feColorMatrix` and `feComponentTransfer` (changing the shapes' colors) and compositing with `feComposite` and `feBlend` (all 16 blend modes) (shadows exported by Figma are drawn too). The result of a filter is clipped to the filter region. When a filter primitive has a subregion (`x`, `y`, `width`, `height`; Filter Effects 1 §9.4), the primitive's result is clipped to that subregion (previously the subregion was ignored and drawn outside it too; a blurred result that must be clipped is computed in pixels)
37
+ - Elements with `opacity`, elements with children such as `g` with `mix-blend-mode`, and elements with `isolation: isolate` are drawn as a transparency group of their children (previously the opacity was applied to each child, so overlapping parts got darker and, for shapes with both fill and stroke, the fill showed through under the stroke). `visibility` is inherited, and children set back to `visible` are drawn (previously the children of a `hidden` element were not drawn at all)
38
+ - CSS syntax: `transform` with units (`rotate(45deg)` and so on), `transform`, `transform-origin` and `transform-box` in `style` and `<style>`, `var()` and `calc()`, basic shapes in `clip-path` (`circle()`, `inset()`, `polygon()`, `path()` and so on) with reference boxes, and `@media` in `<style>` (matched as a print medium)
39
+ - use draws elements of other files (`icons.svg#a`; a missing file is reported as a warning). Links of `a` become PDF links
40
+ - text: `letter-spacing`, `word-spacing` and `text-decoration` on tspan, `side` and `baseline-shift` on textPath, `font-weight` and `font-style` of `@font-face`, and vertical text (`writing-mode`, `text-orientation`; glyph orientation and vertical glyph forms are decided as for vertical body text)
41
+ - `mask-type: alpha`, the mask region and nested masks (previously only the inner one took effect), `context-fill` and `context-stroke`, and GIF, BMP and WebP in image
42
+ - text: `textLength` on tspan, `textLength` and `text-decoration` in vertical text, SVG 2 `inline-size` (automatic wrapping), and SVG fonts (glyphs of the `font` element)
43
+ - Node (the CLI and the API) computes filters that cannot be approximated with shapes (`feTurbulence`, `feMorphology`, `feDiffuseLighting`, `feSpecularLighting`, `feDisplacementMap`, `feConvolveMatrix`, `feImage`, `feTile`, `arithmetic` of `feComposite`, `in`, `out` and `atop` of `feComposite` that cannot be drawn with shapes (such as inner shadows), and so on) in pixels and places them as an image (as specified in Filter Effects 1; previously a placeholder frame)
44
+ - The content of foreignObject (HTML and MathML) is typeset with the same HTML layout as the body and drawn (backgrounds, borders, tables, images and math too; previously a placeholder frame). The rules of the SVG's `<style>` (including selectors such as `#id p` that use the ids and classes of the SVG ancestors) and the formatting inherited from the SVG ancestors (`font-family`, `font-size`, `font-weight`, `font-style`, `color`, `letter-spacing`, `word-spacing` and `visibility`) apply to the content (SVG 2 §23.2, CSS 2.1 §6.2). The body's default style sheet (`--style`, `style`) and the CSS files applied to the body (`--css`, CSS in `files` that the document does not reference) do not apply; the content is typeset with the browser default style sheet. When the typeset content draws nothing inside the foreignObject box (for example when it lies outside the box), a warning is given and only the text is approximated. When it is not typeset through the API (such as when calling `renderPdf` directly), only the text of the HTML is approximated
45
+ - SVG with a clipPath of many points applied to many shapes (such as maps) is drawn as shapes. Previously the clip outline was written again for each shape, exceeded the segment budget, and a placeholder frame was drawn. The same clip shared by consecutive shapes is now written once (ISO 32000-2 §8.4.2, §8.5.4)
46
+ - `svgLanguages` in the API and `--svg-lang` in the CLI: the languages to match SVG `systemLanguage` against (when the place of the SVG has no language)
47
+ - **Fonts**: When the document contains emoji not found in the symbol font (Noto Sans Symbols 2) either (faces such as 😀, flags, skin tone modifiers, etc.), the emoji font Noto Emoji (monochrome outline emoji; SIL Open Font License 1.1; about 870KB) is loaded. Previously no default font had emoji, so those characters were set as the missing-glyph box and the warning "no loaded font has a glyph for these characters" was given. **Typesetting results change** only for documents with such emoji (characters the symbol font has, such as ✈ and ❤, are set in the symbol font as before). For colour emoji, pass a font such as Noto Color Emoji, as before. `emoji` was added to `DEFAULT_FONTS`
48
+ - **`.minimum` and `.maximum` of XSL-FO `word-spacing`** (spec mode only): now read (they used to be reported as unsupported). In justified lines, word spaces are shrunk down to `.minimum` to fit a character or word, and are widened only up to `.maximum` (XSL 1.1 §7.17.8: “The minimum and maximum values specify the limits of the adjustment.”; the `<space>` datatype in §5.11). Compatibility mode still does not read them and reports a warning
49
+ - **Warnings raised while writing the PDF**: notices about glyphs that cannot be drawn, the limits for color glyphs, glyphs in the SVG table, form fields that cannot be made and so on are added to `result.warnings` after `result.toPdf()` (previously they only went to the console, or came after `warnings` was built). The notice for glyphs that cannot be drawn is given once per font. The warnings follow the `lang` used for typesetting. The web app lists them with the other warnings
50
+ - **Warnings**: warnings that stayed in Japanese with `lang: 'en'` (`--lang en` on the command line) are now written in English: three image warnings (a placeholder frame is drawn, part of the image cannot be drawn, the image is not found or cannot be read) and the reasons for placeholder frames of unreadable images; in the notices of unsupported CSS and XSL-FO, the reasons attached to items (`a value read only with --style ah`, `unit xx (length …)` and so on) and the separators of the list; the PDF/X warnings on transparency and the ICC profile; the overflow warnings of the layout (lines, boxes, floats, footnotes, table rows and so on that do not fit on the page); the separators of the list of characters without glyphs; the errors when reading EPUB; the error for too deeply nested transforms; the notes inside image formats (elements of CGM, WMF and EMF that cannot be drawn and their limits, and names of EPS features that cannot be drawn); the errors when reading Area Tree JSON (`parseAreaTree`); and errors in the content of fonts and images (CFF, WebP, PNG)
51
+ - **Reporting vulnerabilities**: added the procedure for reporting vulnerabilities privately (`SECURITY.md`, `SECURITY.en.md`), linked from the "Reporting vulnerabilities" section of the README
52
+ - **flex**: The width of an item (the estimate of its max-content width) now includes the spacing between ideographs and Latin letters or digits (`text-autospace`; CSS Text 4 §8.4). **Typesetting results change**: when a table-of-contents line lays out the entry title, the leader and the page number with flex, the last character of a title mixing Japanese and Latin text, such as “ecoモードの使い方”, is no longer pushed to the next line (previously the estimate lacked the spacing, so the laid-out line did not fit in the item's width)
53
+ - **flex**: The width of an item with no specified width (`flex-basis` and `width` are `auto` or a content-based sizing keyword) is now measured by laying out its content at typesetting time (Flexbox 1 §9.2, step 3 E; previously it was estimated at import by adding up character widths, and only items with a page-number citation were measured at typesetting time). If the line does not fit, the items are shrunk again at typesetting time by their `flex-shrink` ratios (§9.7; the min-content width used as the `min-width: auto` lower bound is also measured at typesetting time). **Typesetting results change**: when a table-of-contents line lays out the entry title, the leader and the page number with flex, the estimate was narrower than the laid-out line and the last word or character of the title was pushed to the next line in the following cases, which are now fixed: white space between elements (`<b>1.2</b> <b>Overview</b>`), the left and right margins, borders and padding of inline elements, the content of descendants' `::before` and `::after` (such as chapter numbers from counters), the item's own `::before` and `::after`, `word-spacing`, the width and margins of an `inline-block`, the space between a superscript and the next word, and `letter-spacing` on a child element. The same applies to lines with `justify-content: space-between` or `flex-wrap: wrap` and to `flex: auto` items. The width of an image set by `-ah-image-resolution` and of an item containing a table are now the laid-out sizes (previously the intrinsic size or the estimate was used, and the table overflowed the item). The content width (max-content and min-content) of a row flex container inside a box sized by its content (such as a flex item or a table cell) is measured as the sum of its items' content widths (Flexbox 1 §9.9.1)
54
+ - **flex**: In a column (`flex-direction: column`) container, items that are inline elements (such as `span`), runs of text directly in the container, and `::before` and `::after` are now blockified (Flexbox 1 §4, CSS Display 3 §2.7). **Typesetting results change**: previously the items were placed side by side on one line instead of being stacked
55
+ - **flex**: The estimate of an item's content width (used as a guide for splitting `flex-wrap` lines and for the box width of aligned items in a column container) now counts white space between elements, the left and right margins, borders and padding of inline boxes, the content of `::before` and `::after`, `word-spacing`, and the width of an `inline-block`. For the ways of writing table-of-contents titles that were examined, it matches the laid-out width within 0.02pt
56
+ - **flex**: Borders, padding and backgrounds of items made from inline elements (`span`, `a` and so on) are now applied only to the item's box (items are blockified; Flexbox 1 §4, CSS Display 3 §2.7). **Typesetting results change**: a `span` item with a border or padding no longer pushes its last character to the next line, even for short Japanese-only content, and its border is no longer drawn twice (previously the inline box of the content also got the same border and padding)
57
+ - **HTML white space**: White space at the edges of inline elements is no longer removed (CSS Text 3 §4.1.1, §4.1.2). **Typesetting results change**: previously “`word <b>bold </b>word`” became “boldword” and “`Over<b> B </b>view`” became “OverBview”, and white space at the edges of `::before` and `::after` of an empty element was also removed (such as the space after a chapter number “第1章 ” in a table of contents). This also affected entry titles mixing English and Japanese split into elements (`<b>eco </b>モード`). Spaces that meet across the boundaries of inline elements are collapsed to one, and spaces at the start and end of a line are removed. In Japanese text, whether a line break in the source becomes a space or is removed is also decided by the characters before and after it across the boundaries of inline elements, and a line break between Japanese characters is removed (CSS Text 3 §4.1.3, §1.5). A line break just inside a tag (`これは<b>\n強調\n</b>です`) gives “これは強調です” as in 0.2.0, and **typesetting results change**: a line break just outside a tag (`これは\n<b>強調</b>\nです`), which gave a space in 0.2.0, no longer gives one. If either side is not Japanese, the line break becomes a space as before. Forced line breaks, images, inline-blocks, ruby and block boundaries are not crossed
58
+ - **Blocks inside inline elements in HTML** (all styles; **typesetting results change**): the blocks inside `<span><p>…</p></span>`, `<a><div>…</div></a>` (card links and the like), `<b><div>`, `<span><ul>`, `<span><table>`, `<label><div>`, `display: block` elements inside inline elements and so on are now typeset (inline boxes containing block boxes, CSS 2.1 §9.2.1.1). The inline box is split before and after the block; the block is laid out as a block, and the inline content before and after it goes on the lines before and after. The inline element's text formatting (color, font, weight and so on) and its link also apply to the block inside, and no border or padding is drawn on the edges where the box is split. Previously the content of the inner block disappeared without a warning, and so did the bookmark targets of headings inside it (the labels of Mermaid 10+ flowcharts, `<span class="nodeLabel"><p>…</p></span>`, have this shape). A block that remains inside an inline box and cannot be placed is reported as a warning. Elements with `display: inline-flex` or `inline-grid` are inline-level boxes (Flexbox 1 §3, CSS Grid 1 §5.1), so block items inside them (buttons and links whose icon and label are written as `div`s, such as `<a style="display: inline-flex"><div>…</div><div>…</div></a>`) no longer split the line of the surrounding paragraph. Block items (and items that are inline elements containing blocks) are placed side by side in the line as unbreakable boxes (the same as `inline-block`; their width is the width of the content); previously the text of these items disappeared. In such a container, each run of text directly inside it also becomes one item in the same kind of box, and runs that are only white space (the line breaks and indentation between items and at the start and end of the container) are not rendered, whatever the value of `white-space` (Flexbox 1 §4, CSS Grid 1 §6). Items that are only inline elements are laid out in the line as before. In neither case is the element laid out as an inline flex or grid container, so the gap between items (`gap`), column direction (`flex-direction: column`), alignment (`align-items`, `justify-content`) and grid columns (`grid-template-columns`) have no effect (the items are aligned on the baseline of the line)
59
+ - **Control-character escapes in CSS `content` strings** (every HTML style; **typesetting results change**): escapes of control characters such as `\A` (line feed) and `\9` (tab) in the `content` of `::before` and `::after` became the letters “n” and “t” (`content: "X\A Y"` gave “XnY”; since 0.1.0). The computed value is now written as a CSS string (CSSOM §2.1 serialize a string; `"X\a Y"`). Strings in generated content are also now handled by `white-space` like the document's text (CSS 2.1 §12.2, CSS Text 3 §4.1): a line feed is a forced line break with `pre`, `pre-wrap`, `pre-line` and `break-spaces`, and with `normal` and `nowrap` it becomes a space or is removed by the same rule as line breaks in the document (removed between Japanese characters). A tab becomes a space with `normal`, and a CR (`\D`) is treated as a space. The `content` of page-margin boxes is handled the same way by the box's `white-space` (previously `\A` in a margin box always broke the line, whatever `white-space` was). As a result, a run of spaces in the `content` of a margin box now also collapses to one space when `white-space` is `normal` (the default; CSS Text 3 §4.1.1; previously margin boxes kept runs of spaces). **Typesetting results change**: the two spaces in `content: counter(page) " | " string(chapter)` become one. To keep the spaces, use U+00A0 (`\A0`) or U+3000, or write `white-space: pre` in the margin box. Other escapes such as `\"`, `\\`, `\2014` and `\000041 B` are unchanged. A “`\`” followed by a line break inside a string (the way to continue a string on the next line; CSS Syntax 3 §4.3.5) is now dropped without adding anything (previously the “`\`” and the line break remained; a CRLF counts as one line break). The white space dropped after a hex escape is now only CSS white space (space, tab, line breaks); previously a U+3000 or U+00A0 after `\25A0` was dropped too
60
+ - **HTML print colours when the same property is declared twice** (**typesetting results change**): within a rule, a later print-colour declaration now wins (CSS Cascade 4 §6.1). Previously, when an earlier declaration of the same property existed, a later `rgb-icc()`, `cmyk()` or `device-cmyk()` declaration was set aside and the earlier colour kept (`.r { color: #00f; color: rgb-icc(255,0,0,#CMYK,0,1,1,0) }` stayed blue even with `--style ah`). With `--style ah`, `rgb-icc()` and `cmyk()` are read as colours, so the later declaration wins; `device-cmyk()` (CSS Color 5 §12.1) wins in every style. In the other styles, `rgb-icc()` and `cmyk()` are still dropped as invalid values (and reported), so the earlier colour remains. Inside a `style` attribute, too, the later declaration of a property wins (previously an earlier print colour beat a later screen colour such as `color: #00f`). In *CSS Page Composition Primer* 4th edition (`--style ah`, with spot-colour values), the borders of the border samples (`.BorderSample`) change from RGB green to the spot colour (PANTONE 627 PC), as in the reference
61
+ - **Characters that get the spacing between Japanese and Latin text** (HTML with the default style sheet; **typesetting results change**): the `text-autospace` spacing is now inserted, as defined in CSS Text 4 §8.4.1, between Japanese characters and characters of the Unicode general categories L and M (besides Latin, also Greek, Cyrillic, Arabic, Hebrew, Indic and Thai letters, even a single letter) and Nd digits (including Arabic and Indic digits). Before, only Latin letters, digits and words of two or more Greek or Cyrillic letters got it. It is not inserted next to characters with East Asian Width W or F (Hangul, fullwidth letters and digits), symbols, punctuation, or characters set upright in vertical text (`text-orientation: upright`). The class of a character is that of the base character of its grapheme cluster. Between Japanese characters and right-to-left characters, the space goes at the visual boundary after reordering (§8.4.2). The compatibility settings (`--style ah`, `vivliostyle`, `weasyprint`) and `axf:text-autospace` in XSL-FO are unchanged (the samples cannot confirm the behaviour; the 4th edition of the CSS page layout book has no place where Japanese characters and Greek or other letters are adjacent in running text).
62
+ - **Position of page-margin boxes with a specified height or width** (HTML with all styles; **typesetting results change**): as in CSS Paged Media 3 §5.3.3, a top or bottom box with a specified height and a left or right box (and a corner box) with a specified width are placed against the page area, because in the over-constrained case the margin on the page-edge side is treated as auto (with both margins auto, the box is centred). Before, the box was positioned by vertical-align, centred by default. vertical-align now only aligns the content inside the box (§6.3). A specified `height` or `width` is the content size, and borders and padding are added to it (with `box-sizing: border-box`, it includes them). Found by comparison with the WeasyPrint samples (WeasyPrint 65.1 also follows §5.3.3).
63
+ - **Propagation of break-avoiding values** (HTML; **typesetting results change**): the avoid values (`avoid`, `avoid-page`, `avoid-column`) of `break-before` on the first child of a box and of `break-after` on its last child are now propagated to the breaks before and after the parent box, as forced breaks already were (CSS Fragmentation 3 §3.1.1; followed through nested children). Previously only forced breaks (`page` etc.) were propagated and avoid values were only seen between adjacent siblings, so a page break could occur between a section and the paragraph before it in `<section><h2 style="break-before: avoid">`. When a forced break applies at the same point, the forced break wins (§4.3; the avoid value is not propagated, and the box's own avoid value is dropped). `avoid-column` stops before the multi-column container (§3.1.1). The same applies where a list is set as a table (the values of an item's first and last children are combined with the item's row and with the list's edges) and to lists without markers (set as a sequence of ordinary blocks). Values are not yet propagated to flex and grid containers or from table rows. XSL-FO keeps are unchanged. The output of the 4th edition of *CSS Page Composition Primer* (`--style ah`) and of the four conformance documents does not change (if `break-before` of `.TOC li.TocLevel1 > ul` in its table of contents is reset to `auto` in a user style sheet, the page used to break between the 「第5章」 line and 5.1; now the `avoid-page` of `li.TocLevel2:first-child` propagates and 「第5章」 moves to the next page)
64
+ - **Placement of collapsed table borders of different widths** (every XSL-FO mode, and HTML tables with `border-collapse: collapse`; **typesetting results change**): on a side where the table itself has no border and the cells hold the table's outer border, lines of different widths (5pt and 15pt, for example) are now centered on the same grid line (the table edge). Previously the thinner lines were aligned with the outer edge of the thickest line on that side, so the thinner lines and the contents of their cells stuck out beyond the grid line (into the margin). Inner lines in the XSL-FO compatibility mode (`--compat antenna`, where the following cell holds the line) are also centered when widths differ along the same line (previously the thinner lines were aligned with the edge of the following cell's box). Cell contents are placed half of the cell's own line width inside the grid line. This follows CSS 2.1 §17.6.2 (borders are centered on the grid lines between the cells), XSL 1.1 §6.7.10 and §7.28.3; the Antenna House sample (`table-border-conflict-resolution-1` in the sample FO collection) also centers them. Cell backgrounds are painted from the outer edge of the shifted line. The Area Tree version is now 3 (sides whose `collapse.paintWidth` is smaller than `width` were added; version 1 and 2 trees are still read). In the sample FO collection four samples change (`table-border-conflict-resolution-1`, `table-omit-header-footer-1`, `table-within-page-1`, `axf-form-field-event-1`); in the conformance documents only the page with the `border-collapse` example in the HTML and CSS volume changes (page 93 in Japanese, 97 in English). The column widths of `table-layout="fixed"` tables without column specifications are fixed by the next entry
65
+ - **Column widths of collapsed-border tables with fixed layout and no column specifications** (every XSL-FO mode, and HTML tables with `table-layout: fixed` and `border-collapse: collapse` under `--style ah` (Antenna House compatibility); **typesetting results change**): columns without a specified width now share the table width so that their widths excluding the borders of the first row's cells (the content and padding widths) are equal. Previously the column boxes, including the halves of the borders that stick out of the table, were divided equally, so columns with thick borders had narrower contents, and the outer columns were narrower by the width of the thick borders. This follows CSS 2.1 §17.5.2.1 (referenced by `table-layout="fixed"` in XSL 1.1 §7.28.16): "any remaining columns equally divide the remaining horizontal table space (minus borders or cell spacing)". The fixed layout looks only at the cells of the first row, so the borders excluded are those of the first row's cells. The Antenna House sample (`table-border-conflict-resolution-1` in the sample FO collection; a 5-column table whose first-row borders are 5, 10, 5, 5 and 15pt) also gives all five columns the same content width (about 86.4pt). In that sample the text of the 15pt cell no longer wraps onto two lines, and the output has two pages like the sample. In the sample FO collection five samples change in the specification mode and nine in the compatibility mode (`--compat antenna`) (each is closer to the sample, or the same to within 0.01%). The conformance documents (all four) do not change. With the other HTML styles (`kumiori`, `browser`, `browser-margin`, `vivliostyle` and `weasyprint`) the column boxes are still divided equally, as before (reading "borders or cell spacing" in the same sentence as the table's borders and the cell spacing; browsers (Chromium) also divide the column boxes equally)
66
+ - **Specified widths of the edge columns of collapsed-border tables** (every XSL-FO mode, and HTML tables with `table-layout: fixed` and `border-collapse: collapse`; **typesetting results change**): a specified column width (`column-width`, or `width` on `col`) is now the distance between the grid lines for the columns at the edges of the table as well. Previously, in the specification mode the first and last columns were narrower by half of the outer border that sticks out (or wider by the inner half of the table's border when the table holds the outer border), and in the compatibility mode (`--compat antenna`) the last column was narrower by the width of the outer line (inner columns also shifted when the inner lines had different widths). The table width is the distance between the outer grid lines (row-width in CSS 2.1 §17.6.2), so the specified column widths add up to the table width. The Antenna House sample (`axf-form-field-event-1` in the sample FO collection: four columns of 30, 30, 30 and 40mm) also makes the distance between the grid lines equal to the specified width, for the edge columns and the last column too. Automatic-layout tables, whose column widths are measured from their contents, do not change. In the sample FO collection ten samples change in the specification mode and nine in the compatibility mode (in the compatibility mode the difference of `table-spanned-1` from the sample falls from 0.39% to 0.02%, and the right edge line of `table-within-page-1` is now at the same position as in the sample). In the conformance documents, table lines and text move by about a pixel on two pages of the XSL-FO volume (pages 43 and 71 in Japanese, 46 and 74 in English) and one page of the HTML and CSS volume (page 94 in Japanese, 97 in English). The CSS-Print book does not change
67
+ - **Fixed column widths without column specifications in separated-border tables** (XSL-FO tables with `border-collapse="separate"` in every mode, and HTML tables with `table-layout: fixed` and `border-collapse: separate` under `--style ah` (Antenna House compatibility); **typesetting results change**): columns without a specified width now share the width so that their widths excluding the borders of the first row's cells are equal, as for collapsed-border tables (see "Column widths of collapsed-border tables with fixed layout and no column specifications" above; CSS 2.1 §17.5.2.1). Previously the cell boxes, including their borders, were divided equally. With the other HTML styles the cell boxes are still divided equally, as before (as in browsers (Chromium)). The sample FO collection, the conformance documents and the CSS-Print book have no such tables and do not change
68
+ - **XSL-FO orthogonal `fo:block-container` without an inline-direction size** (all modes; **typesetting results change**): a container whose writing mode is orthogonal to its parent's (such as `writing-mode="tb-rl"` inside horizontal body text) and that has no `inline-progression-dimension` (the height for vertical text) used the body width as its line length, so the box exceeded the page height, was pushed to the next page and overflowed at the bottom, cutting off characters. XSL 1.1 §6.5.3 says this size may not be auto and does not define how to lay it out (auto in §7.15.7 is "determined by the formatter taking all other constraints into account"), so, as for orthogonal blocks (E-16 in BACKLOG), the line length is now the remaining page height (the page height from the next page on), lines are stacked up to the parent's width, and lines that do not fit continue on the next page. A box that fits on one page fills the parent's width, as before. A bordered (border or padding) container rotated by 90° or 270° with no size specified was laid out as a single box whose lines, stacked beyond the body width in its local block direction, overflowed the box; it is now stacked up to the body width and continued on the next page, like a container without borders (the borders at the breaks follow `conditionality`, as for block fragments)
69
+ - **Word spaces in justified lines in the XSL-FO spec mode (`--compat spec`, `compat: 'spec'`, the default)** (**typesetting results change**): Latin word spaces are no longer compressed to pull a character or word into the line in justified lines either (the non-final lines of a paragraph with `text-align="justify"`, and lines set with `text-align-last="justify"`). Spaces never become narrower than their natural width; the word that used to fit by compression goes to the next line, and the line is filled by widening the word spaces (previously spaces could be compressed to 1/3 to take one more word). In XSL 1.1 §7.17.8, a word space for `word-spacing="normal"` or a length has `.minimum = .optimum` (no room to shrink). This continues the change in 0.2.0 that stopped compressing word spaces in lines that are not justified. Some paragraphs gain a line, so page breaks may move (the English XSL-FO conformance guide goes from 102 to 104 pages). Pulling in by compressing the space of punctuation (commas, brackets), compressing the quarter-em space between Japanese and Latin text (in documents with `axf:text-autospace`), compatibility mode (`--compat antenna`) and HTML are unchanged. Paragraphs with `inter-word` in `axf:text-justify-trim` still compress word spaces
70
+ - **XSL-FO footnote separators** (every mode; **typesetting results change**): when there is an `fo:static-content` with `flow-name="xsl-footnote-separator"`, its content is always formatted and placed at the start of the footnote area. In XSL 1.1 §6.12.1.3 the separator is the areas returned by formatting this static-content, and there is no default separator rule. Changes from 0.2.0:
71
+ - Separators whose border is written with `border-after-style`, `border-bottom-style`, `border-style` and so on, and separators made only of space (`padding-before`, an `fo:block-container` with a height, etc.), are formatted as written. Previously they were taken as having no content, and Kumiori's default separator rule (a solid line 1/3 of the body width) was used instead, with the note “replaced by the default separator rule”
72
+ - When the content is empty (no text, `fo:leader`, image, background, border or space; for example only an empty block), nothing is drawn and no space is taken (the same as when there is no such static-content). Previously the default separator rule was used here too
73
+ - The `space-before` of the first block of the separator (and of the first block inside a block that has no border or padding on its before side) is set to 0, because it begins the footnote reference area (XSL 1.1 §4.3.1; `space-before.conditionality="retain"` and space coming from `margin-top` and the like are kept). **Even for a separator with content, a `space-before` written at its start now makes the footnote area lower by that amount and moves the separator** (how much body text fits can change too). Previously that space was kept above the separator
74
+ - **Indent inheritance in XSL-FO** (spec mode only; **typesetting results change**): start-indent and end-indent are inherited into table cells and into list item labels and bodies as XSL 1.1 specifies (§5.3.2, §7.11.7, §7.11.8). (1) Blocks without indents inside a cell also inherit the indent of the table (and values written on the row groups, rows and cells), and are indented by that amount from the cell's content edge (previously they were placed at the cell's edge). (2) Labels and bodies are not reference areas (§6.8.4, §6.8.5), so a start-indent written as a length inside them is measured from the edge of the same reference area as the list (previously from the start edge of the body). (3) `from-parent()` and `inherited-property-value()` in start-indent and end-indent are read (§5.10.4; previously they were ignored with a warning). (4) The indent inherited into a block-container that has only margin-left or margin-right also includes the value inherited from outside (§5.3.2; previously only the margin, border and padding). Compatibility mode (`--compat antenna`) is unchanged. In both modes, when the start-indent of a nested list's label lies beyond the position of `label-end()`, the label no longer becomes 0 wide with its characters split vertically (the label ends provisional-label-separation before the start of the body). The sample for checking this is `samples/check/fo/indent-inheritance-1.fo`
75
+ - **Tolerance when balancing columns** (HTML and XSL-FO multi-column layouts; **typesetting results change**): the column height is now raised to make "the first column the longest and later columns shorter" only when a later column is at least 1em (of the multi-column box) longer than the one before it (it used to be raised whenever the difference exceeded 0.5pt). A difference under 1em is treated as equal height and left as is. In graphics-cgm-1 of the Antenna House sample FO collection, the two-column comparison of images (the image box in the second column is 1.24pt taller) no longer pulls the heading into the first column and matches the reference, so the document has 2 pages like the reference instead of 3. CSS-Print 4th edition and the other multi-column samples do not change
76
+ - **Whether a line fits on the page, in AH Formatter compatibility** (HTML `--style ah` and XSL-FO `--compat antenna`; **typesetting results change**): a line is now placed on the page even if its bottom exceeds the bottom of the body minus the footnotes by up to 0.05pt (previously only calculation error, up to 0.01pt). This matches the sample PDF (on page 75 of CSS-Print 4th edition, a figure caption that exceeds it by about 0.03pt is placed on that page; Kumiori moved it to the next page). In CSS-Print only pages 75 and 76 change (both closer to the sample). None of the 151 XSL-FO samples changes
77
+ - **Multi-column floats in multi-column boxes with a line grid** (HTML; **typesetting results change**): the contents of a `float: multicol top` box inside a multi-column box whose `-ah-baseline-grid` is `new` or `root` now form a line grid area like table cells, with no half-leading before the first line or after the last (with `new`, em boxes are stacked). The body text of the columns below the float sits on the line grid drawn from the top of the multi-column box's content (previously the grid was redrawn from the bottom of the float). This matches AH Formatter's samples (the multi-column float box in 9.3.6 of CSS-Print 4th edition is now 22pt instead of 30pt, as in the sample). Spanning only some of the columns is not supported yet (E-21 in `docs/BACKLOG.md`)
78
+ - **Captions of tables with a line grid** (HTML; **typesetting results change**): captions of tables whose `-ah-baseline-grid` is `new` or `root` now form a line grid area like the cells, with no half-leading before the first line or after the last (with `new`, em boxes are stacked). This matches AH Formatter's samples (in CSS-Print 4th edition, captions of tables with `table { line-height: 21q; -ah-baseline-grid: new }` have no half-leading above or below; in 10.2 the caption and the table were each 3.2pt too low)
79
+ - **Page breaks after headings with `--style ah`** (HTML; **typesetting results change**): `h1, h2, h3, h4, h5, h6 { page-break-after: avoid }` from the `@media print` block of CSS 2.1 Appendix D is added to the default style sheet. Headings without a page-break rule in the author CSS are no longer left alone at the bottom of a page; they move to the next page with the following paragraph (in the "はじめに" section of CSS-Print 4th edition, the heading "Antenna House CSS Formatter" was left at the bottom of page 3; the sample has it at the top of page 4). The other two rules of that block (a page break before `h1`, and no page break before lists) are not added because the sample is not typeset that way
80
+ - **Antenna House compatible squeezing** (`--style ah` only; **typesetting results change**): when a line would fit by squeezing more than the per-line limit (half an em), it is now still squeezed in if the amount to squeeze is no more than the space the line would be left with if the overflowing part were pushed to the next line (the smaller adjustment is chosen). Previously lines needing more than half an em were always pushed out, so the vertical example in 17.9 of *CSS Page Composition Primer* 4th edition (`hanging-punctuation: first`) was set as “『行人』/『こゝろ』” (the sample squeezes a full em: “『行人』『こ/ゝろ』”). In the sample PDF, among the lines that would fit by squeezing more than half an em (232 places whose line starts match the sample), 17 of the 22 the sample squeezed and 205 of the 210 it pushed out follow this rule. Places in the whole book where lines differ from the sample: 575 → 482 (1227 → 1158 when the examples use the same fonts as the sample). Spec mode, the other styles and XSL-FO compatibility mode (`--compat antenna`) are unchanged
81
+ - **Light and dark shades of 3D borders in spot colours** (HTML with `--style ah` and XSL-FO, when spot-colour values (`--spot-colors`) are given; **typesetting results change**): for `groove`, `ridge`, `inset` and `outset` borders drawn in a spot colour (`rgb-icc(r, g, b, #Separation, 'name')`), the light and dark shades are now made from the alternate RGB the author wrote in `rgb-icc()`. Previously they were made from the spot colour's alternate CMYK converted to RGB, which came out darker than the reference. The shades are now the same as for the border without spot-colour values (drawn in that RGB colour). How the shades are made (half-way to white for the light side, a third of the way to black for the dark side) and painting them in RGB are unchanged (CSS Backgrounds 3 §3.2 leaves the colours of 3D borders to the implementation). A spot colour without an alternate RGB (`rgb-icc(#Separation, 'name')`) still uses its alternate CMYK. In *CSS Page Composition Primer* 4th edition (`--style ah`, with spot-colour values), the shades of the border samples (`.BorderSample`) on page 26 become (0, 41, 17) and (128, 158, 140), against the reference's RGB (0, 40, 16) and (128, 158, 140) (previously (2, 20, 12) and (129, 143, 137))
82
+ - **Reading CGM character sets** (every mode; **typesetting results change**): when CHARACTER CODING ANNOUNCER is basic 8-bit and CHARACTER SET INDEX selects a 96-character set (such as the right half of ISO 8859-1), the characters 0x20–0x7E were read as characters of the 96-character set (right-half characters). They are now read as characters of the 94-character set (ISO 646 and so on), and the 96-character set is used for 0xA0–0xFF (in the 8-bit code of ISO/IEC 2022 a 96-character set can only be placed in the right half; WebCGM 2.1 T.16.14 and T.14.5). The text in the table of the WebCGM test BIGCGM01 (the Antenna House sample graphics-cgm-1), which was garbled like “ÃÇÍïðåî”, now reads “CGMopen” as in the sample
83
+ - **Soft hyphens in SVG text** (every mode; **typesetting results change**): soft hyphens (U+00AD) and other characters that are not drawn (Default_Ignorable_Code_Point) in SVG text (including SVG made from CGM) are not drawn and are no longer passed to the font's layout. Previously, with fonts whose soft hyphen shares the hyphen's glyph (Arimo, Noto Serif JP and others), drawing a soft hyphen first polluted the font's glyph memo (fontkit), so later “-” in the same font became a zero-width space glyph, vanished and overlapped the following characters (PDF)
84
+ - **Bundle size and what is loaded at start** (no change to the typeset result): the CGM, EPS (the PostScript interpreter), WMF and EMF processing is now loaded only when a document contains such an image. In the web app (`npm run build`) and the browser library (`kumiori/browser`) it is in separate files (`cgm-….js`, `eps-….js`, `metafile-….js`) that are not loaded for documents without these images. The JavaScript loaded at start went from about 3,649KB to about 3,367KB for the browser library (about 1,203KB to about 1,126KB gzipped; in this release, with the other changes, about 3,414KB, about 1,138KB gzipped), from about 2,815KB to about 2,609KB for the web app, and from about 2,199KB to about 1,917KB for the entry of `npm run build:lib`. How you use Kumiori (the `typeset` API, the command and the web app) does not change: CGM, EPS, WMF and EMF are read as before, with nothing to add. The per-document time budget for EPS is also unchanged. In the npm package, the library JavaScript grew because the draw.io processing is now built in, but the source maps of the library (`dist-lib`; the `.js.map` files, 9 files and about 10.6MB, which contained the full source) are no longer included. The package went from 170 files and a tarball of about 5.6MB (about 18.6MB unpacked) in 0.2.0 to 228 files and about 4.5MB (about 16.0MB unpacked) (with the source maps it would have been 236 files and about 7.2MB (about 26.4MB unpacked)). The distributed JavaScript is not squeezed onto fewer lines and keeps the names of class methods (only the names of functions, variables and parameters are shortened), so the location of an error can be found from the `dist-lib` JavaScript lines and method names in the stack trace. The source can be viewed at the tag of that version on GitHub
85
+ - **Memory** (no change to the typeset result): the memo of line-breaking results (reused when the same paragraph is laid out again at the same width: column balancing, keep-with-next trials, measuring table cells) now has a size limit and drops the oldest entries. Previously the atoms, lines and line positions of every paragraph in the document were kept until layout finished. Memory still live when layout finishes (after GC): plain text 1MB 657MB → 486MB, a 1MB table (100,000 cells) 1458MB → 592MB. Maximum resident set size: text 934MB → 837MB, table 1971MB → 1671MB (layout time unchanged). The limit is `LayoutOptions.lineMemoAtoms` (default 50,000). The layout counters (`LayoutEngine.stats`) gain the largest memo size (`lineMemoPeak`) and the number of reuses (`lineMemoHits`)
86
+ - **Speed and memory** (no change to the typeset result): lighter parsing, cascade and import for HTML with many elements nested beyond the nesting limit (128 levels). (1) The computed-value table of each element keeps only the values that differ from the parent or from the initial value (previously every element held all ~200 properties). (2) Descendant-combinator matching remembers the answers for ancestors more than 16 levels up. (3) The ancestor walk for `text-align: inside`/`outside` (`--style ah`) remembers its answers. (4) The lists of open elements in the HTML parser used on Node (htmlparser2, used by linkedom) are replaced with a container whose additions and removals at the front are cheap (previously the work grew with the square of the depth). If htmlparser2 uses these lists in ways the container does not cover (for example after a version change), it is left as is. htmlparser2 is now also a direct dependency (`^10.1.0`, the same range as linkedom), so that the patched copy is the one linkedom uses. `<b><i><a><font>` × 30,000 (474KB): 24.3 s / 1.8GB → 14.1 s / 1.2GB; `<h1><button>` × 50,000 (600KB): 39.3 s / 1.8GB → 20.0 s / 1.2GB (Node's maximum resident set size)
87
+ - **Parsing cost**: the remaining twelve regular expressions applied to input whose cost was quadratic or worse in the input length now take linear time, with the same results. HTML: the `::first-letter` letter (a run of newlines with no letter), trimming spaces when measuring line widths (a long run of spaces in the middle), splitting `string-set` at commas (a run of commas), spaces around newlines (a run of spaces without a newline), and the resolution of `image-resolution` (`-ah-image-resolution`) (close to cubic for a long run of digits). The SVG table of fonts (a document with many unclosed `<` or `<svg`, and an unclosed run after a palette color `var(--colorN, …)`; the latter took more than two minutes for 20,000 characters). The DOCTYPE of `fo:instream-foreign-object` and of MathML files in XSL-FO (a run of spaces in an unclosed declaration). Each took 0.3 to 0.5 seconds for about 20,000 characters. When expanding internal entities of XML (XSL-FO and so on), finding the internal subset of the DOCTYPE (a run of unclosed `<!DOCTYPE a`; 4.3 seconds for 220,000 characters) and skipping comments and CDATA sections (a run of unclosed `<!--` or `<![CDATA[`; 0.9 seconds for 80,000 characters)
88
+ - **Collapsed table borders**: cells that span columns (`colspan`, `number-columns-spanned`) are now handled as ranges rather than one grid slot per column, both when collapsing borders (`border-collapse: collapse`) and when placing cells on the table grid. The work is proportional to the number of cells and the rows they span, not to the number of columns they span. A table of 150 rows × 150 cells with `colspan="1000"` (564 KB, 150,000 columns) now takes 7.9 s instead of 12.6 s to typeset (local measurement; the rest is typesetting the 22,500 cells themselves). The typeset result is unchanged
89
+ - **Large images**: images at the pixel limits (100 million pixels per image, and the per-document totals) are now typeset faster without changing the result (the limits themselves are unchanged). In local measurements, putting a 100-megapixel RLE BMP (about 800 KB) into a PDF went from 16 s to 3 s, a 64-megapixel CGM TILE from 17 s to 5 s, and an EPS drawing three 25-megapixel images from 14 s to 2 s. (1) zlib decompression now uses table-driven code lookup and writes into byte arrays (checking PNG pixel data, CGM TILE, font tables and so on). (2) 8-bit PNGs with alpha are decompressed by Kumiori itself when put into a PDF, producing the same RGB and alpha images as pdf-lib. (3) Opaque images that Kumiori decodes (GIF, BMP, TIFF, WebP, images in EPS and so on) are now encoded as RGB PNGs and put into the PDF without decompression (the image streams in the PDF change, but the pixels are the same). (4) Faster copying and checksums for uncompressed PNGs (CRC-32 and Adler-32), base64 decoding of data: URIs (using built-in conversion), and pixel conversion of DeviceGray and DeviceRGB PostScript images
90
+ - **Fonts**: Damaged fonts no longer make the whole document fail (the remaining two kinds of tables that could only be found unreadable while typesetting). (1) A font whose layout tables (such as GPOS) have a reference to nothing only for particular character sequences (shaping the registration sample still works): only those sequences are shaped again without the layout tables (cmap glyphs, hmtx advances; shaping stays on for the font, so other sequences are set as before). Previously the characters of those sequences silently disappeared from the PDF, and where the text is encoded for the PDF the whole document failed. (2) A glyph whose data cannot be read (for example in a font whose loca offsets are shifted): it becomes a glyph without an outline in the PDF subset font (advance from hmtx), instead of failing the whole PDF. Both are reported once per font in the result's warnings. Results for valid fonts do not change
91
+ - **Robustness against broken or crafted input**: Fixed the remaining places where a name such as `constructor`, `__proto__` or `toString` written in the input picked something from Object.prototype out of a table looked up by name (a follow-up to the 0.2.0 fix). An SVG element name (`<svg><constructor/></svg>`) made the whole document fail with a `TypeError`. MathML `linethickness="constructor"` made the fraction rule thickness NaN, and `lspace="__proto__"` and the like made spacing NaN. `@constructor { … }` inside `@page` was treated as a margin box and not reported as an unknown name. `axf:column-rule-width="constructor"` made the column rule width not a number. The tables for `target-counter()` counter names, the values of `font-variant-numeric`, `-ligatures` and `-east-asian`, position keywords (`background-position`, `transform-origin`, `at` in gradients), system colour names, `font-size` and `font-stretch` keywords (CSS and XSL-FO) and MathML `mathsize` also no longer have a prototype. Typesetting results of valid documents do not change
92
+ - **Security and robustness against crafted input** (limits and their grounds are in the source comments; beyond a limit only that image, declaration or glyph is left out, or it is drawn up to that point with a warning, and the rest of the document is typeset):
93
+ - Node command: with `--no-outside-files`, files inside the input directory whose real path is outside it (symbolic links pointing outside) are not used (a link `a.png → ../secret/s.png` placed in the directory got the outside image drawn into the PDF). When a loaded plugin never finishes, the command reports an error and exits with code 1
94
+ - Rasterized SVG filters (Node): for `feMorphology`, the window maximum and minimum are computed with constant work per pixel, however large the `radius`. `feTurbulence` `numOctaves` is computed up to 24 (later octaves do not change 8-bit colors). For `feGaussianBlur`, the work is bounded by the image size, however large the `stdDeviation`. Named results (`result`) that are not referenced later are not kept, and when many results are waiting to be referenced, the resolution is lowered. Each SVG has a computation budget: filters beyond it are computed at a lower resolution, and once it runs out the SVG is treated as unsupported (a placeholder frame and a warning; SVGs with many filtered elements, nested patterns or masks, chains of feImage)
95
+ - SVG: the length of `var()` substitution is limited (2 MiB per value, 16 MiB per SVG; the same idea as on the HTML side). `calc()` is evaluated in time linear in the length of the value, nested at most 32 levels. Attribute selectors in `<style>` are looked up through an index, and selector matching is capped at 500,000 matches. SVG font ligatures are looked up with a trie (up to 64 characters), and glyph outlines count toward the path segment limit. Nested foreignObject elements are not typeset again. An SVG is reused across languages that give the same `systemLanguage` result. Writing an SVG text with very many characters no longer fails in PDF output. SVG links are capped at 5,000 per page
96
+ - Results from image formats (plugins and draw.io diagrams) are checked: a finite size up to 10 million px, a limit on the SVG length, a load time limit (150 s by default), and at most 64 distinct `#` references per file
97
+ - CSS: matching a selector with many descendant (whitespace) or subsequent-sibling (`~`) combinators (60 chained `div`s, for example) tried every choice of non-matching ancestors and took over 30 seconds. A selector whose combinators are all descendant or all subsequent-sibling combinators is now matched in time linear in the number of elements, remembering one number per element (how many compound selectors, from the left, can be matched in order by its ancestors or preceding siblings); a selector of 20,000 `i`s chained with `~` against 20,000 `<i>` elements (240KB) takes 2 seconds. A selector mixing kinds of combinators (`a ~ b c`, for example) memoizes intermediate results, taking time proportional to the number of compound selectors times the number of elements; one with more than 64 compound selectors is not matched against any element and is reported in a warning (real stylesheets have no selectors that long). Apart from selectors over that limit, the rules that apply are unchanged
98
+ - **Development** (typesetting results do not change):
99
+ - Added `npm run ci:local` (`scripts/ci-local.mjs`), which runs the CI steps locally. It runs the steps of the build, node-min and e2e jobs of CI (`.github/workflows/ci.yml`) and of the web app build for GitHub Pages (`.github/workflows/pages.yml`; the pages job) in order and lists the result of each step. With `--worktree`, the current commit is checked out to a temporary place and tested there
100
+ - Chromium for the integration tests: `npm run e2e` (`playwright.config.ts`) now also uses the Chromium executable that the environment variable `KUMIORI_CHROMIUM` points at, like the comparison scripts (the reading is shared in `scripts/chromium.mjs`). This lets the tests run without a temporary config where the Playwright version and the installed Chromium do not match. Without it, the Chromium Playwright downloaded is used as before
101
+
102
+ ## 0.2.0 (2026-11-12)
103
+
104
+ A release that adds flex features, WOFF/WOFF2, an API for loading referenced files, and more. While in 0.x, it is a minor release because it includes fixes that change typesetting results.
105
+
106
+ - **flex** (Flexbox 1; the CLI and the default layout path):
107
+ - Shrinking (`flex-shrink`, the automatic minimum size of `min-width: auto`), the growth limit (stop at `max-width` and share the rest), growing when the sum of `flex-grow` is below 1
108
+ - Reversed directions (`row-reverse`, `column-reverse`, `wrap-reverse`), containers with `direction: rtl`, vertical-writing containers
109
+ - Alignment: `baseline` and `last baseline`, cross-axis `margin: auto`, `start`, `end`, `left`, `right`, `safe` and `unsafe` for `justify-content`, `align-content` for wrapping containers
110
+ - Column direction: `row-gap`, `flex-basis`, `flex-shrink`, `flex-wrap` (wrapping into columns), growing in containers with a definite height
111
+ - `order` also applies to `::before`, `::after` and children of `display: contents`; text directly inside a container becomes an anonymous item
112
+ - Percentages in `gap`, `min-content` and `fit-content` for `flex-basis`, items with `visibility: collapse` (struts)
113
+ - **CSS**:
114
+ - Supports `visibility` (`hidden`, `collapse`) and `aspect-ratio`
115
+ - The horizontal margins of boxes with a definite width follow CSS 2.1 §10.3.3 (in a containing block with `direction: rtl`, boxes are placed from the right edge; a single `auto` margin takes the remaining space at layout time)
116
+ - Collapsing of the bottom margin of the last child of a box with `min-height` follows CSS 2.1 §8.3.1
117
+ - Sizes of boxes whose writing mode is orthogonal to the parent's (vertical writing inside horizontal, and horizontal inside vertical) now follow CSS Writing Modes 3 §7.3. **This changes typesetting results**: a vertical-writing float with a specified height wraps its lines at that height and is placed at the edge (before, long text ran on without wrapping and overlapped the body text). A vertical-writing item in a flex row takes its specified width (before, it shrank to the width of its lines), and without a specified width takes the width of its lines. A box with no specified size in its line direction (`height` for vertical writing) is fit-content (the length of the content, up to the available length), also inside table cells and absolutely positioned boxes. `max-height` and `min-height` act as the upper and lower limits of the line length
118
+ - A vertical-writing absolutely positioned box with no specified height (its size in the line direction) takes the length of its content (shrink-to-fit, CSS 2.1 §10.3.7; before, it extended to the bottom of the page). Fixed the `width` (cross size) of items in a vertical-writing flex container being dropped
119
+ - For a `display: block` image with both `width` and `max-width`, the wrapping box now has the width of the image
120
+ - Named pages: no first page is created for boxes outside the flow alone (absolutely positioned, floats, etc.) (CSS Page 3 §8.1)
121
+ - Properties that have no effect in print (`cursor`, `transition-*`, etc.) are no longer reported as unsupported CSS
122
+ - `box-decoration-break: clone` (CSS Fragmentation 3 §5.4) is supported. Each fragment of a box broken across pages or columns, and each fragment of an inline box broken across lines (the border and background of a `span`), is wrapped again with its border and padding (vertical writing too; `-webkit-box-decoration-break` is also read). Results with the initial value `slice` are unchanged
123
+ - Content-based sizes (CSS Sizing 3 §3.2): `min-content`, `max-content` and `fit-content` for `width`, `min-width` and `max-width` (`height`, `min-height`, `max-height` in vertical writing), and `fit-content(<length>)` (CSS Sizing 4 §3.2), are supported on block boxes and their floats, absolutely positioned boxes and inline-blocks (a keyword `width` on an item of a row flex container is read as that keyword of `flex-basis`). For the block axis, a keyword `height` behaves as auto. Keyword sizes on flex and grid containers and on tables are not supported and are reported in a warning. **A `fieldset` no longer becomes narrower than the min-content width of its content**, as the default HTML style sheet (`min-inline-size: min-content`) says
124
+ - `initial-letter` (CSS Inline 3 §7; drop caps): the `::first-letter` character is sized by a number of lines and sunk (`initial-letter: 3`, `3 2`, `3 raise`, `initial-letter-align: alphabetic | ideographic | leading`). Its size and position are decided from the `line-height` of the paragraph and the cap height or em box of the font. CJK text (`lang` of `ja`, `zh`, `ko`) is aligned by the em box. Vertical writing is supported. Declarations on boxes other than `::first-letter`, `initial-letter-align: hanging | border-box` and `initial-letter-wrap` are not supported
125
+ - `empty-cells: hide` (CSS 2.1 §17.6.1.1): borders and backgrounds of empty cells are not drawn in tables with separated borders; a row whose cells are all empty gets zero height
126
+ - Percentage values of `vertical-align` (CSS 2.1 §10.8.1): an inline box is raised or lowered by that percentage of its own `line-height`
127
+ - `text-align: justify-all` (CSS Text 3 §6.1): the last line is justified as well
128
+ - XSL-FO: when both of two nested boxes specify `.conditionality="retain"` for their borders and padding, the outer fragment now encloses the trailing border and padding of the inner fragment (it used to be shorter by that amount)
129
+ - Ruby placement: supports `ruby-position` (`under` places ruby below the base, to the left in vertical writing; combinations with `alternate`), `ruby-align` (`start`, `center`, `space-between`, `space-around`), `ruby-overhang` (an explicit `auto` lets ruby overhang adjacent kana and punctuation) and `ruby-merge: merge` (group ruby). The side and overhang of ruby without these properties are unchanged
130
+ - The default distribution of ruby characters is now the initial value `space-around` of `ruby-align` (CSS Ruby 1 §4.3). **The default arrangement of Latin and bopomofo ruby changes**: it is centered over the base without space between its letters (previously every letter was spaced out). Japanese (kanji and kana) ruby and base text are unchanged. Ruby in XSL-FO is unchanged
131
+ - Supports `font-variant-east-asian` (`jis78`, `jis83`, `jis90`, `jis04`, `simplified`, `traditional`, `full-width`, `proportional-width`, `ruby`; glyph forms and widths are selected through the font's OpenType features, and the values are also read from the `font-variant` shorthand)
132
+ - Supports the line style of underlines, overlines and line-throughs (`double`, `dotted`, `dashed` and `wavy` for `text-decoration-style`), their thickness (`text-decoration-thickness`) and the underline offset (`text-underline-offset`); the `text-decoration` shorthand accepts the line style and thickness. The underline of an `abbr` with a `title` is now dotted, as in browsers (it was solid)
133
+ - Supports the color (`text-emphasis-color`) and side (`text-emphasis-position`: `under` in horizontal writing, `left` in vertical writing) of emphasis marks; the `text-emphasis` shorthand accepts a color
134
+ - `fill`, `stroke`, `color` and related properties (`stroke-width`, `fill-opacity`, `stroke-opacity`, `opacity`, `fill-rule`, line caps, joins and dashes) in the document's CSS now apply to an `<svg>` written directly in the document. `currentColor` takes the `color` inherited from outside the `<svg>` (`svg { fill: currentColor }` with `.icon { color: red }` colours the icon). SVG images also honour the `color` attribute with `currentColor`, and the alpha of `rgba()` colours
135
+ - Support for the color functions `hwb()`, `lab()`, `lch()`, `oklab()`, `oklch()`, `color()` (CSS Color 4) and `color-mix()` (CSS Color 5). Output is sRGB; colors outside the sRGB gamut are brought into gamut by reducing chroma while keeping lightness and hue (CSS Color 4 §14.2). Until now, declarations using these colors were dropped (the color fell back to the initial or inherited value)
136
+ - Supports transforms (the 2D functions `translate()`, `scale()`, `rotate()`, `skew()`, `matrix()` and lists of them for `transform`; `transform-origin`, `transform-box`; `translate`, `rotate`, `scale`) and opacity (`opacity`: the box and its content become translucent as a whole; PDF output uses a transparency group). Both take effect only when painting and do not change layout (positions, sizes, page breaks). 3D transforms are reported as unsupported
137
+ - Supports multiple backgrounds (comma-separated layers of `background-image` and `background`, with per-layer position, size and repetition) and `background-clip` / `background-origin` (`border-box`, `padding-box`, `content-box`; also applied to the area the background color is painted in). `background-attachment: fixed` and `background-clip: text` are reported as unsupported
138
+ - Supports `none` and `scale-down` for `object-fit`, `object-position` (the position of an image inside its box) and `list-style-image` (image markers for lists)
139
+ - Hyphenation limits (CSS Text 4 §6.3): supports `hyphenate-character` (the string shown at the end of the line, also for lines broken at a soft hyphen), `hyphenate-limit-chars` (minimum characters in the word and before and after the break), `hyphenate-limit-lines` (maximum number of successive hyphenated lines), `hyphenate-limit-last: always` (no hyphenation before the last line of a paragraph) and `hyphenate-limit-zone`. `column`, `page` and `spread` of `hyphenate-limit-last` are not supported (reported as a warning)
140
+ - Background images are painted under the border with the initial value of `background-clip` (`border-box`) (CSS Backgrounds 3 §2.7). **The rendered result changes**: in HTML, the background image or gradient of a box with a border is now painted under the border as well. With dashed, dotted or double borders, or transparent or translucent borders, the background image shows through the gaps in the lines (a repeated image is tiled from the top left of the padding box under the border as well; the position of a non-repeated image does not change). With opaque solid borders nothing changes, since the border hides it. To paint only inside the border as before, specify `background-clip: padding-box`. XSL-FO backgrounds are unchanged (XSL 1.1 §4.9.4)
141
+ - Transparent and translucent border colors (HTML). **The rendered result changes**: a border with `border-color: transparent` used to be drawn as a black line and is no longer drawn (it still takes up its width). A border with a translucent color (`rgba()` and so on) is blended over the background beneath it with that opacity, instead of being drawn in an opaque color mixed with white (PDF output uses a transparency group; PDF/X-3 issues a warning)
142
+ - CSS gradient backgrounds (`linear-gradient()`, `radial-gradient()` and their `repeating-` forms) are now also drawn on screen (Canvas: `renderPage` and the app view). **Previously they were drawn only in the PDF and were missing on screen** (the PDF output is unchanged)
143
+ - Line decorations (underlines etc.) and atomic inlines (CSS Text Decoration 3 §2). **The rendered result changes**: a link with `display: inline-block` used to get two underlines (one under its text and one at the bottom of the box); it now gets only the one under its text. Images and inline-block boxes inside an underlined element are themselves no longer decorated (the line under an image inside a link disappears), and the lines of ancestors are not propagated to the contents of inline-blocks and inline-tables (the text before and after is still decorated, as in browsers). XSL-FO output is unchanged
144
+ - The width of a box sized to its contents (`inline-block`, floats, absolutely positioned boxes, etc.) that inherits an indent (`text-indent`) now includes the indent (CSS Text 3 §8.1). **The layout result changes**: previously the box was too narrow by the indent, so its first line wrapped or its text stuck out of the box (the default style indents paragraphs by one character, so an `inline-block` inside a paragraph was affected). Now the box is wider by the indent and the contents fit on one line. To avoid indenting inside the box, specify `text-indent: 0` on it
145
+ - `margin` on inline images (`img`; all four sides; CSS 2.1 §8.3 and §10.8). **The layout result changes**: previously the `margin` of an inline image was not read, so the image sat tight against the neighbouring text or images (the `margin` of block and floated images already worked). Now the left and right margins add space before and after, and the top and bottom margins count toward the line height (the `hspace` and `vspace` attributes too). For an inline image with a border, padding or background color, only the left and right margins apply (top and bottom are reported in a warning)
146
+ - List items, table rows and forced breaks inside them (CSS Fragmentation 3 §2.1, §3.1 and §4.3). **The layout result changes**: `break-before` and `break-after` (`page` and so on) now take effect on blocks inside an `li`, on the `li` of a nested list, and on blocks inside a table cell (the item or row is split at that point; previously they were ignored). `left`, `right`, `recto` and `verso` on an `li` in the middle of a list or a `tr` in the middle of a table insert a blank page until the parity matches (previously they only started a new page). `column` on such an `li` or `tr` inside a multi-column context takes effect. `page` on such an `li` or `tr` in a document whose pages are set in columns starts a new page, not the next column. `break-before: column` and `break-after: column` outside a multi-column context have no effect (previously they started a new page even where there were no columns). In XSL-FO too, `break-before` and `break-after` on a block inside a table cell or a list item body split the row at that point (XSL 1.1 §4.8; previously ignored)
147
+ - Containing blocks of absolutely positioned boxes (CSS 2.1 §10.1, CSS Position 3 §2.1). **The layout result changes**: a `position: absolute` box inside a table, table cell, list item or vertical-writing box with `position: relative` (or `transform`) is placed relative to the padding box of that box. When a table or list item lies between the box and its reference block, that block is still the reference (previously the body region of the page was used in all these cases, and the position was far off). The `position: relative` offset of a block in vertical writing is now applied in physical directions (`left` horizontally, `top` vertically). An element within a line (`span`, `inline-block`) with `position: relative` is also a reference (the rectangle around its padding boxes). A `position: absolute` box inside an inline element is no longer dropped. An absolutely positioned box in the middle of the text of a paragraph no longer splits the line. The `position: relative` offset (`top`, `left` and so on) of elements within a line (`span`, `inline-block`, `img`) now takes effect (CSS 2.1 §9.4.3; previously ignored)
148
+ - Percentages for `top`, `bottom` and `height` of absolutely positioned boxes (CSS 2.1 §10.5, CSS Position 3 §3.1). **The layout result changes**: `top: 50%`, `top: 100%` (the drop-down pattern), `bottom: 10%`, `inset: 10%` and `height: 50%` are read as fractions of the height of the padding box of the containing block (when the height of that box depends on its content, the height after layout; with no positioned ancestor, and for `position: fixed`, the height of the page content area; also for absolutely positioned `::before` and `::after`). Before, percentages for `top` and `bottom` were treated as absent (the box appeared at the top of the reference box or where it was found), and percentages for `height` were taken from the content height of the parent
149
+ - Positions of absolutely positioned boxes. **The layout result changes**: an absolutely positioned box in the middle of a line of a paragraph whose `left` and `right` (and `top` and `bottom`) are `auto` is placed where it was found in the line (the static position; CSS 2.1 §10.3.7, §10.6.4). Before, it was placed at the start of the first line of the paragraph and overlapped the preceding text. Boxes found inside table cells are handled the same way. An absolutely positioned box inside a flex or grid container (horizontal writing) with `position: relative` (or `transform`) is placed relative to the padding box of the container (CSS Flexbox 1 §4.1, CSS Grid 1 §9.1; before, the body region was the reference). A `position: static` flex or grid container whose height depends on its content lets the reference pass through to an outer containing box. The `position: relative` offsets (`left`, `top`, etc.) of list items (`li`) and table cells (`td`, `th`) now take effect (CSS 2.1 §9.4.3; a list item moves together with its marker, and row heights and the positions of other cells do not change; before, they had no effect)
150
+ - Tables with `writing-mode` (CSS Writing Modes 3 §2.1, CSS 2.1 §17). **The layout result changes**: a table (`table`, `display: table`) with `writing-mode: vertical-rl` or `vertical-lr` in a horizontal document is laid out vertically (rows run from right to left and the cells in a row from top to bottom; previously the `writing-mode` of the table was ignored and it was laid out horizontally). The same applies to a `horizontal-tb` table in a vertical document. The size of a table with separated borders (`border-spacing`) whose writing mode differs from its parent now includes the cell spacing
151
+ - Anonymous table rows and cells (CSS 2.1 §17.2.1). **The layout result changes**: content that is not a table part (text or other elements) directly inside a table (`display: table`, `inline-table`) or a row (`table-row`) is wrapped in an anonymous row and an anonymous cell (previously it was dropped, for example the text of `<span style="display: inline-table">text</span>`)
152
+ - `text-indent` on tables (CSS Text 3 §8.1 and the HTML default style sheet). **The layout result changes**: `text-indent` specified on a table now applies to the lines in its cells (previously ignored). `text-indent` from outside a table (`body`, `div` and so on) does not enter the table (`table { text-indent: initial }`; previously the outer indent applied to the lines in cells; this matches browsers)
153
+ - Outlines (`outline`, `outline-width`, `outline-style`, `outline-color`, `outline-offset`; CSS UI 4 §3) are supported. A line that takes up no space is drawn outside the border box (rounded on boxes with rounded corners; an inline element that breaks across lines and a block that breaks across pages are enclosed fragment by fragment). They were previously reported as unsupported CSS
154
+ - The clipping rectangle (`clip: rect(…)`; CSS 2.1 §11.1.2) is supported. **Results change for absolutely positioned boxes with `clip`**: the background, border and content of the box are drawn clipped to the rectangle. A box with the screen-reader-only idiom (`clip: rect(0 0 0 0)`) is not drawn. Previously `clip` was reported as unsupported CSS and the box was drawn without clipping
155
+ - Tab size (`tab-size`; CSS Text 3 §4.2) is supported. **Results change for tab characters inside `pre` and the like**: a tab character (U+0009) inside `white-space: pre`, `pre-wrap` or `break-spaces` now advances to the next tab stop (every 8 spaces from the content edge of the block; changeable with `tab-size`) (CSS Text 3 §4.1.2). Previously the tab character was drawn as the missing-glyph mark (□)
156
+ - For an `<svg>` written inline in the document, `stop-color`, `stop-opacity`, `text-anchor`, `clip-rule`, `marker` (`marker-start`, `marker-mid`, `marker-end`) and `vector-effect` now also take effect from the document's CSS (like `fill`, `stroke` and so on). Properties that apply only to SVG elements (`paint-order`, `cx`, `r` and so on) are no longer reported when the document has no `<svg>` (no element they apply to exists; with an `<svg>` they are reported as "unsupported (SVG elements)"; previously they were "unknown properties"). The rendering hints (`shape-rendering`, `text-rendering`) are not reported
157
+ - **Links and bookmarks**: `<a href>` on blocks, flex containers and tables makes the whole box a link; relative-reference links (GoToR for PDFs, Launch for other files; Launch is not written by default, see "Security" below); `h1` to `h6` become bookmarks with every default style (CSS GCPM 3 Appendix B). Added an option that writes relative-reference links as a URI action with the reference as written (`/S /URI /URI (x.pdf)`; `%xx` is not decoded): `links: { relative: 'uri' }` in the API and `--link-relative uri` on the command line (the default stays `'file'`). Such links also work in PDF viewers inside browsers, which do not handle GoToR and Launch. Relative non-PDF files are then written without `launch` (absolute paths and `//host/…` only with `launch: true`). For file names with non-ASCII characters (GoToR, Launch), `F` of the file specification dictionary is now the UTF-8 bytes of the same name instead of a name with `_` substituted (`UF` remains the Unicode name)
158
+ - **Tables**: in tables with `border-collapse: collapse`, the border between a table header or footer repeated at a page break and the adjacent row is chosen again from the borders on both sides (XSL 1.1 §6.7.10, CSS 2.1 §17.6.2.1)
159
+ - **Fonts**: reads WOFF and WOFF2 (including font collections) (`--font`, `fonts`, `@font-face`); fonts referenced by `@font-face` over `http(s):` are also fetched (only those whose `unicode-range` overlaps the characters of the document)
160
+ - **Variable fonts** (OpenType Font Variations, with TrueType outlines or CFF2 outlines): typeset with the shape (instance) for each combination of axis values. **Results change for documents that use variable fonts**: previously they were typeset as a single weight with the default instance; bold was synthesized by thickening the outlines and `font-stretch` scaled the glyphs
161
+ - `font-weight` → weight axis (wght; no synthetic bold), `font-stretch` / `font-width` → width axis (wdth; glyphs are not scaled), `font-style` `italic` / `oblique <angle>` → ital / slnt axis (if present), `font-optical-sizing` → optical size axis (opsz; the font size in px for HTML, in pt for XSL-FO), `font-variation-settings` (any axis). The precedence follows CSS Fonts 4 §7.2
162
+ - `@font-face` ranges `font-weight: 100 900`, `font-stretch: 75% 125%`, `font-style: oblique 0deg 10deg`, and the `font-variation-settings` and `font-named-instance` descriptors. A variable font without a `font-weight` descriptor also gets its weight axis set (for variable fonts whose default instance is not weight 400, the regular-weight glyphs change too)
163
+ - Variable fonts given with `--font`, `fonts` or alongside an XSL-FO document use the full range of their axes. For XSL-FO, the family name of a variable font is now nameID 16 of the name table (the name covering all weights and widths)
164
+ - In the PDF, each combination of axis values in use is embedded as a static font (advances from HVAR, kerning and mark positions from GPOS, font-wide metrics from MVAR, and glyph substitutions from FeatureVariations are those of the instance). On screen, the instance is registered with the browser as a static font and drawn with it
165
+ - Area Tree: `fontFamily` of a glyph that uses an instance carries a mark for the axis values other than weight (`{;wdth=75}`). Instance entries in `resources.fonts` gain `variation` and `sourceSha256`. `TextStyle` gains `fontVariationSettings`, `fontOpticalSizing`, `fontOpticalSizeUnit` and `fontObliqueAngle`
166
+ - Variable fonts with CFF2 outlines (variable OTF fonts) are also typeset with the shape for each combination of axis values. In the PDF they are rebuilt and embedded as static CFF fonts, including the default instance (previously the font embedded in the PDF was broken: text was displayed with a substitute font and could not be extracted). The shapes do not change, but the hints are not carried over. Non-variable fonts with CFF2 outlines can be embedded in the same way
167
+ - Fixed a nested `font-stretch` that returns to 100% (normal) keeping the width inherited from the parent
168
+ - **Font lists** (HTML `font-family`): for each character (for combining sequences and emoji sequences, the whole sequence), the list is tried in order and the first font that has the character is used (CSS Fonts 4 §5.2, §5.3). The typeset result changes for lists where a generic name or the name of a default font comes before a loaded font (`--font`, `fonts`, `@font-face`), such as `"Noto Serif JP", "Noto Emoji", serif`, and for lists with two or more loaded fonts (spaces, digits and symbols that an earlier font has are no longer typeset with a later loaded font; the third and later fonts are also tried in order; Japanese characters are typeset with the font of the generic name)
169
+ - **Fonts with colored glyphs** (color emoji and so on): glyphs in the OpenType COLR/CPAL (versions 0 and 1; gradients, transformations, compositing), CBDT/CBLC, sbix and SVG tables are typeset in color. In the PDF they are written as a Type 3 font (the extracted text is the original emoji; each glyph is defined once in the document). The same shapes can be drawn on screen (Canvas). `font-palette` and `@font-palette-values` (`base-palette`, `override-colors`) select the palette. A character followed by U+FE0F is set in a color font, and one followed by U+FE0E in a font without colored glyphs. `fontPalette` was added to `GlyphArea` in the Area Tree (present only when the palette is not the default). **Until now, using a COLR font (Noto Color Emoji, Twemoji) crashed while writing the PDF, and CBDT fonts without outline tables could not be typeset**
170
+ - **Glyph shapes of OpenType fonts with CFF outlines (.otf)** (wherever glyphs are drawn from their outlines: outline drawing on the screen (Canvas), math, SVG text, colored glyphs. Body fonts embedded in the PDF were already correct, because the glyphs of the font are embedded as they are. Results with the default fonts (TrueType outlines) do not change):
171
+ - In Japanese, Chinese and Korean fonts (CID-keyed; the .otf of Noto Sans JP, Source Han Serif and so on), some characters were drawn with a completely different shape or could not be drawn (the first glyph of each group of glyphs inside the font; in the Noto Sans JP .otf, 29 characters such as ":", "・", "※", "±", "■" and "ゝ"). This is fixed. Punctuation spacing and line breaking do not change
172
+ - Glyphs that use the shallow-curve operators (Type 2 `hflex` and `hflex1`; fonts converted from Type 1, the mathematical monospace letters of the STIX Two Math .otf, and so on) had part of their outline shifted vertically by a few units, leaving a small step at a corner. This is fixed. The glyph bounding box is corrected too, so **in math that uses these glyphs, the height and depth of characters may change by a few units**
173
+ - **PDF**: in ToUnicode, ligature characters (U+FB01 etc.) map to the original character sequences (fi etc.), so text extraction and search find words such as "confiance"
174
+ - **API**:
175
+ - `resolveResource(url)`: asks for files referenced by the document or CSS that are not in `files`
176
+ - `fetchStyles`: fetches CSS referenced by the document over `http(s):` (including `@import` targets; default `true`)
177
+ - `kumiori/node`: `createFontLoader` (the same default-font loading and cache as the CLI), `createFileResolver` (reads `file:` references), `defaultFontCacheDir`, `looksLikeFont`
178
+ - Images returned by `resolveResource` are now used even when the URL has no extension (`<img src="https://example.com/img?id=1">`, and likewise `background-image`, `list-style-image`, `content: url()` and XSL-FO `external-graphic`). The image is recognized from the leading bytes of the content. **Previously, for a URL without an extension the returned content was not used and the image was fetched again from the network** (or was unreadable with `fetchImages: false`). Whether to fetch from the network (`fetchImages`) is decided as before
179
+ - `pageSize`: changes the default paper for HTML (the paper of a document that does not specify `size` in `@page`; it was fixed to A4). Written like the CSS `size` property (`"A5"`, `"A5 landscape"`, `"148mm 210mm"`; CSS Paged Media 3 §7.1). A `@page { size }` in the document wins, and `width`, `height` and `orientation` in `@media` are evaluated against this paper. Without it the paper is A4 as before
180
+ - `genericFonts` and the CLI `--generic-font`: the Latin font of the monospace generic family (`monospace`; Cousine by default) and the Japanese fonts of the generic families (`serif-cjk`, `sans-serif-cjk`; Noto Serif JP and Noto Sans JP by default) can also be replaced (CSS Fonts 4 §2.1.3; Japanese text in monospace uses the `sans-serif-cjk` font in HTML and the `serif-cjk` font in XSL-FO). Unknown names in `genericFonts` are now an error (they used to be treated as `sans-serif`)
181
+ - **CLI**: reads references given as `file:` URLs; `--no-fetch-styles` disables fetching CSS; `--page-size <size>` changes the default paper for HTML (`A5`, `"A5 landscape"`, `148mm,210mm`; the same as `pageSize` in the API)
182
+ - **Page number references inside flex items**: the box of a flex item that contains `target-counter(…, page)` (such as the `::after` of a table-of-contents line) now fits the digits of the number as typeset. It used to be one digit wide, so with `word-break: break-word`, `overflow-wrap: anywhere` and the like a two-digit number broke into "1 / 0" and the table of contents grew longer
183
+ - **`createFileResolver`** (`kumiori/node`): `root` accepts a list of directories. Containment is checked on the real paths after resolving symbolic links (a link inside the root could be used to read a file outside it; the checks for another drive on Windows and for file names starting with `..` are also fixed)
184
+ - **Security** (protection when typesetting documents written by others):
185
+ - Link actions in the PDF are limited to safe ones. By default only destinations inside the document, URLs with the schemes `http`, `https`, `mailto` and `tel`, and relative references to PDFs (GoToR) are written. Other schemes (`javascript:`, `data:`, `file:` and so on), actions that open a relative non-PDF file (Launch, including `.html`), absolute paths to PDFs and `//host/…` are typeset as plain text without an action and reported in a warning. To get the previous behavior, use `links: { schemes: ['*'], launch: true }` in the API or `--link-schemes '*' --link-launch` on the command line. Schemes are read the way browsers do, after removing leading and trailing control characters and tabs and newlines anywhere (`java<TAB>script:` is dropped too). The same applies to links, bookmarks and form submit targets in XSL-FO
186
+ - A file attachment annotation (`axf:annotation-file-attachment` in XSL-FO) now attaches only files passed in `files` (for the command, files in the input directory). Resources collected by following references (`file:` files returned by `resolveResource`, CSS and fonts fetched from the network) are never attached. An attachment copies the bytes of a file into the PDF as they are, so when collected resources could be attached too, a document written by someone else could, with the default settings, copy files of the machine that typesets it (`file:///etc/passwd`) or responses from the internal network (`http://169.254.169.254/…`) into the output PDF, by making another reference (`<link>`, `url()`; even one written inside an XML comment is picked up) collect them
187
+ - Parentheses in PDF strings are escaped: the name after `#` in a link to a relative PDF (GoToR) and the name of an attached file were written into literal strings as they were, so a `)` could close the string and add entries (`/S /JavaScript /JS (…)` and so on) to the action dictionary, bypassing the link restriction above. For file names the same was possible with characters whose low 8 bits are a parenthesis (U+0128, U+0129). A file name with non-ASCII characters (`資料.pdf`) is now written as a file specification dictionary (ISO 32000-2 §7.11.3, with the Unicode name in `UF`), and the name of a named destination as UTF-8 bytes (before, only the low 8 bits of each character were written, and links to PDFs with Japanese names could not be opened)
188
+ - Node command: control characters in warnings and error messages (escape sequences and line breaks written in the document) are printed in a visible form such as `\x1b`, so that a document written by someone else cannot rewrite the screen or the title of the terminal of the person who typesets it, or forge report lines
189
+ - The allow function passed to `fetchImages` / `fetchStyles` is also asked about redirect targets. On Node, redirects are followed one hop at a time and no request is sent to a target that is not allowed (up to 20 hops). A redirect from `https:` to `http:` is not followed even with the default (`true`). In browsers the request does reach the redirect target, and the response is discarded if the target is not allowed (browsers do not expose the target beforehand)
190
+ - Size limits for CSS (16 MB), fonts (128 MB) and images (256 MB) fetched from the network; reading stops as soon as the limit is exceeded
191
+ - Limits on EPUB decompression (256 MB per entry: skipped with a warning beyond it; 1 GB in total and 65,535 entries: an error beyond them)
192
+ - `root` of `createFileResolver` is checked on real paths (see the item above)
193
+ - GitHub Actions: the token of the CI workflow is read-only, and the permissions to deploy to Pages and to publish to npm are given only to the jobs that deploy and publish. Publishing now takes the tarball built by the checking job and publishes it from a job that installs no dependencies and runs no scripts
194
+ - GitHub Actions: the actions used by the workflows are now pinned to commit SHAs instead of tags (`@v6` and so on); tags can be moved later, and this keeps a workflow that holds publishing rights from running different code. Dependabot (`.github/dependabot.yml`) opens PRs for updates
195
+ - Node command: `--no-outside-files` stops reading files outside the input directory that the document points at with `file:` URLs or `../` (for documents written by others; by default they are still read)
196
+ - Network images are fetched up to 8 at a time, and fetching the images of a document has an overall time limit (10 times the limit of a single fetch, 5 minutes by default). They used to be fetched one at a time, so a document listing unresponsive URLs kept fetching for as long as it liked. Fetched images are registered in document order (which image a bare file name resolves to no longer depends on response speed)
197
+ - A Content Security Policy for the browser app (`index.html`; only the site's own scripts run). Dependabot now also watches the npm dependencies
198
+ - **Supported Node versions**: `engines` is now `^20.19.0 || >=22.12.0` (0.1.1 had `>=20`; the runtime dependencies require 20.19.0 or later, and Node 22.0 to 22.11 cannot load ES modules with `require()` and are excluded). CI now also runs type checking and the unit tests on the minimum, Node 20.19.0
199
+ - **Robustness against broken or crafted input** (input that used to hang or crash the process now makes only that image or declaration unreadable; the limits and their rationale are in the source comments):
200
+ - Layout: fixed a hang when a paragraph beside a narrow float gap directly follows a table with `border-collapse: collapse` and an outer border. As a consequence, a box moved below a float (`clear` etc.) right after such a table is now placed exactly at the bottom edge of the float (it used to overlap it by half the border width; CSS 2.1 §9.5.2)
201
+ - XSL-FO: `fo:retrieve-marker` and `fo:marker` inside `fo:marker` are skipped and reported (XSL 1.1 §6.13.5, §6.13.6); an FO document whose elements nest 250 levels or deeper fails with a clear error
202
+ - Math: no crash on extreme `scriptlevel` (math-depth is clamped to ±100; MathML Core 4.5), long `mtext`, very many children or deep nesting (up to 300 levels)
203
+ - HTML and CSS: no crash on `attr()` without arguments, cyclic or exploding `@import`, multiply nested `var()`, huge `colspan`, `rowspan` and `<col span>` (the HTML limits of 1000 and 65534), huge `repeat()` (up to 10000 columns), or overlong counter representations (the fallback style is used beyond 1000 characters; CSS Counter Styles 3 §2). Elements nested deeper than 128 levels are read as following siblings of their ancestor at level 128, with a warning. An `@import` dropped because too much CSS was imported is also reported as a warning. An image URL that could not be fetched is tried only once (the image list of the import report no longer contains duplicates)
204
+ - SVG: no hang on path data with numbers after `Z`, multiplicative expansion of `use`, marker, pattern and mask (up to the number of elements + 500,000 visits), or a long `<style>`
205
+ - WMF, EMF and CGM: point counts, character counts and color table sizes are bounded by the record length; the images of one document may total up to 64 million pixels
206
+ - WMF, EMF and CGM: the total number of pixels that may be turned into images is now also bounded by the file size (260 thousand pixels + 1,024 pixels per byte of the file; the overall limit of 64 million pixels is unchanged). A file of a few hundred bytes using run-length codes (RLE DIBs, run-length cell arrays, tile arrays) could produce a 64-million-pixel image (over a minute and 1.7 GB of memory). **A small file holding an image sparser than 1,024 pixels per byte (for example a large, almost blank scanned image) no longer has that image drawn** (the rest of the document is typeset; a file larger than about 61 KB may use the full 64 million pixels as before)
207
+ - CGM, WMF and EMF: patterns (CGM PATTERN TABLE and geometric patterns, WMF/EMF pattern and hatch brushes) no longer write out the whole pattern definition every time they are used; identical contents share one definition (for CGM, each use is a pattern that references the content pattern by href and only gives its placement; SVG 2 §14.3.4). A CGM of about 27 KB using a 4,096-cell pattern 2,000 times used to fail with an over-long SVG string (about 8 seconds); it now takes 0.6 seconds and produces 520 thousand characters. When the cells of a CGM pattern are written as rectangles, each cell counts as 16 pixels towards the pixel limit. The drawings do not change
208
+ - GIF: the number of pixels is now also bounded by the file size (1 million pixels plus 4,096 pixels per byte of the file, up to 100 million). GIF dimensions are 16-bit, so a 34-byte file could specify 10000 × 10000 pixels, taking 12 seconds and 2.1 GB of resident memory to typeset. GIFs over the limit are not read; a placeholder frame is drawn with a warning. LZW codes are at most 12 bits and one code stands for at most 4,096 pixels (GIF89a, Appendix F), so legitimate GIFs (at most about 2,730 pixels per byte) stay within the limit
209
+ - WebP, JPEG and CCITT: the number of pixels is now also bounded by the data size (1 million pixels plus, per byte, 2,048 pixels for VP8, 32,768 pixels for VP8L and the canvas of animated WebP, 1,024 pixels for JPEG, 2,048 pixels for one-dimensional CCITT coding and 131,072 pixels for two-dimensional coding; with two-dimensional coding the number of rows is at most the number of data bits). A file of a few dozen to a hundred-odd bytes with only large dimensions created a 100-million-pixel array, taking 11 to 19 seconds and 2.1 to 2.6 GB to typeset (a 50-byte VP8: 18.9 seconds and 2.6 GB). The VP8, JPEG and one-dimensional CCITT values exceed the most pixels one byte can represent in the standard coding (the fixed probabilities of RFC 6386 §11.2 and §11.4, the Huffman code lengths of T.81, the code tables of T.4). **A large lossless WebP that is entirely (or mostly) one colour, and a blank CCITT image wider than 16,384 pixels, are not drawn when they exceed the limit** (the zero-bit codes of VP8L and the one-bit white rows of T.6 have no density limit in the standards). Images over the limit are drawn as a placeholder frame with a warning. For CCITT TIFFs the same limit is also checked before falling back to utif when the built-in decoder cannot read the image
210
+ - PNG (Node): the number of pixels (up to 100 million) and the decompressed scanline size (up to 1,032 times the IDAT data, the deflate limit of RFC 1951) are checked before pdf-lib's `embedPng` decompresses the image. A 65-byte PNG with only large dimensions took 9 seconds and 1.3 GB. A PNG over the limit is drawn as a placeholder frame with a warning (images inside SVG and colour glyph images are not drawn)
211
+ - WOFF and WOFF2: the unpacked font may be up to 128 MB, and no more than 100 times the file size + 1 MB (WOFF 1.0 tables are additionally limited to the deflate ratio of 1,032). The tables were unpacked to the 32-bit lengths in the directory, so a 300 KB WOFF took 5.6 seconds and 2 GB, and a 558-byte WOFF2 took 3.3 seconds and 1.7 GB and stopped the document from being typeset. Fonts over the limit are reported as unreadable fonts. zlib decompression (`inflateBytes`) now collects its output in a byte array instead of an array of numbers (which used 8 bytes of heap per byte)
212
+ - TIFF: the per-image pixel limit (100 million pixels) now also applies to PackBits, LZW, Deflate and other TIFFs (a 124-byte TIFF with only large dimensions used 1.6 GB of memory, and larger dimensions allocated correspondingly more). **A TIFF of more than 100 million pixels is treated as an image that cannot be drawn**
213
+ - BMP: RLE8 and RLE4 BMPs are now drawn in Node as well (they used to be drawn as a placeholder frame; the same expansion as metafile DIBs; pixels left unspecified get colour table entry 0). The number of pixels is also bounded by the file size (1 million pixels plus 1,024 pixels per byte)
214
+ - Inputs found in the pre-release audit that used up time or memory with a file of tens to hundreds of bytes now end as an unreadable image or a PostScript error (the rest of the document is typeset in every case):
215
+ - EPS (PostScript): `Width` and `Height` of an image must be integers (the reals 2.4e10 × 0.001 passed the pixel limit). A dash array has at most 1,024 elements, clips nest at most 1,000 deep, an array of functions has at most 32 functions, and at most 200,000 ranges are added to a CMap (`limitcheck` beyond these). The sample array of a sampled function, the array of `matrix`, the glyph count of CFF fonts and the ranges added by `usecmap` are charged to the VM, memory and work accounts. The amount of filter output counts as work (a decompression bomb of stacked Flate filters is now stopped by the time limit even while input is skipped without executing any operator). An EPS whose bounding box (`%%BoundingBox`) is not a number or not finite is not read as EPS (the whole document failed to become a PDF)
216
+ - TIFF: the chain of IFDs is checked before it is handed to utif (loops of next-IFD offsets, at most 256 IFDs, entry values inside the file). Strip and tile lengths are clamped to what remains in the file and `RowsPerStrip` to the image height. LZW is replaced by Kumiori's own decoder, which stops at the end of the data (data without an EOI code never stopped). CCITT tiles are read only up to the number that covers the image
217
+ - PNG: a PNG whose `IHDR` is not the first chunk, of length 13, and the only one is not read (pdf-lib sizes its arrays from the last `IHDR`). An animated PNG whose frame (`fcTL`) extends outside the image, or whose frames total more than 100 million pixels, is not read. For a PNG that is decoded before embedding (with alpha, a palette, or 1 to 4 bits), the pixel data is first checked to decompress to the end (with corrupt data the decompression in pdf-lib never stopped; a corrupt PNG is not drawn)
218
+ - BMP: a bit count other than 1, 4, 8, 16, 24 or 32 is not read (0 passed the file size check)
219
+ - CGM: control points, knots and weights of NON-UNIFORM (RATIONAL) B-SPLINE are read only as far as the element's parameters go, and the element is not drawn when they fall short
220
+ - A long path in SVG or EPS (hundreds of thousands of points) made PDF output fail with "Maximum call stack size exceeded", and the whole document did not become a PDF; fixed
221
+ - Fonts: when `@font-face` points at a font collection (a TTC or a WOFF2 collection), only the first font is extracted (all of them used to be extracted and the first one used). A font whose tables overlap is not read, and the fonts extracted from a collection total at most 1 GB (a 3 KB WOFF2 whose tables all point at the same place used 3 GB). An exception while writing a subset font into the PDF (a font with broken glyf, loca or head) became an `uncaughtException` of the process instead of a rejection of `toPdf()`; fixed. When a variable font with broken tables cannot be instantiated, the document no longer fails as a whole; the default instance is used with a warning
222
+ - Scanning a document or CSS for image names took time quadratic in the length of a long run without delimiters (the base64 of a `data:` URL); fixed (**this also happened with ordinary documents**: an HTML file of about 700 KB with a font embedded as `data:` took more than a minute)
223
+ - Math (MathML in HTML): the work was cubic in the number of sibling elements; fixed (an expression of 6 KB with 300 pairs of `<mo>` and `<mi>` took 31 seconds, now 2)
224
+ - SVG: a repeating or reflecting gradient (`spreadMethod`) lays out at most 100,000 stops in total (beyond that it is not repeated)
225
+ - HTML, CSS and XSL-FO: names such as `constructor`, `__proto__` and `toString` written as a property, a value or an attribute value (`p { constructor: 1 }`, `<ol type="constructor">`, `@page { size: constructor }`, `color(constructor …)`, `mathvariant="constructor"`, `border-top-width="constructor"` in FO) picked functions of Object.prototype out of constant tables, and the whole document failed with a `TypeError`; fixed (they are reported as unknown names). A non-finite colour component such as `rgb(1e999,0,0)` in XSL-FO made PDF output fail; fixed
226
+ - CSS: the selectors of nested rules expand to at most 10,000 (a 316-byte style sheet with selector lists nested 5 deep used up the heap; a rule beyond the limit is not read). A dotted `@layer` name is examined 32 levels deep (a name of 5,000 levels took more than a minute). A leader (`leader()`, `fo:leader`) lays out at most 20,000 glyphs (tiny fonts or extremely long lines; beyond that no glyphs are laid out)
227
+ - The margin computation of quirks mode (HTML without a DOCTYPE) was quadratic in the number of sibling elements; fixed (**this also happened with ordinary documents**: 20,000 paragraphs, 160 KB, took over 50 seconds, now 5). A line with more than 120,000 glyphs (a long unbreakable word, for example) failed with "Maximum call stack size exceeded" and the document could not be typeset; fixed
228
+ - Second round of the pre-release audit (the remaining inputs; limits and their grounds are in the source comments; beyond a limit only that image, declaration or glyph is skipped, or it is drawn up to that point with a warning, and the rest of the document is typeset):
229
+ - EPS (PostScript): small EPS files no longer exhaust time and memory through pattern stroke outlines, image copies inside patterns, large numbers of drawing operations, long strings, CMap entries or repeated `pathbbox`. Limits on drawing work (200,000), DeviceN components (32), string tokens (64 MB) and **the total EPS execution time per document (60 s)**. Image copies in tiling patterns share a single PNG encoding
230
+ - WMF, EMF and CGM: the length of the generated SVG is capped in proportion to the file size (2 MB + 128 characters per byte; the samples use at most 19 per byte). Tiny records (region paints, clip changes, gradient triangles, COPY SEGMENT) made the SVG grow repeatedly (a 20 KB WMF took 72 s and 2.4 GB). The work of clip-region and clip-path operations is bounded, and CGM tiles and cell arrays are decoded straight into pixels. Progressive JPEG skips blocks without coefficients and limits the total block visits (a JPEG that visits a block more than 64 times is not read). Faster BMP decoding
231
+ - Fonts: limits on reading and processing broken or crafted fonts (GSUB/GPOS counts, exponentially nested composite glyphs and CFF/CFF2 subroutines, gvar tuples, lookup calls, COLR layers, SVG documents, and the number of variable-font instances and name records). Unreadable fonts are reported and skipped; tables or glyphs over the limits are left out. The tables used for layout are read at registration, so a font that would throw while typesetting is treated as unreadable (a CFF font fontkit cannot read no longer makes the whole document fail; a fallback font is used). A document asking for more than 64 instances of one variable font uses the instance with the nearest axis values. Notices about unreadable `@font-face` fonts now go into the result's `warnings`
232
+ - CSS: the results of `:has()` and `:nth-child(… of S)` are memoized, rules are also indexed by ancestor names, and custom property tables are no longer copied per element. Removed quadratic regular expressions for numbers, `!important`, `url()`, `@import` and `@font-face`, and capped rule nesting at 64 levels. Internal entity expansion checks its limit while substituting. Words longer than 128 characters are not hyphenated
233
+ - Layout: a document-wide budget for generated content (`content`, `counter()`, `string-set`); over-long `@counter-style` symbols and XSL-FO `format` strings are ignored. Page-invariant static content, margin boxes and `position: fixed` boxes are reused, and lines below the page are not drawn. Less work for long unbreakable lines, floats, change bars, repeated table headers, huge `rowspan` and dotted borders. **A string `text-emphasis` mark uses only its first grapheme cluster** (CSS Text Decoration 4 §3.1; the whole string used to be attached to each character). Characters after the first 32 of a grapheme cluster are laid out one by one
234
+ - SVG and MathML: images that reuse large shapes many times via `use`, `clip-path`, `mask`, `pattern` or `marker`, and images nested more than 250 levels deep, are treated as unsupported (a placeholder box and a warning). `<style>` rules are matched through an index. Fixed quadratic layout time for formulas with many children; a single formula draws at most 20,000 glyphs
235
+ - EPUB (browser app only): corrupt, encrypted and ZIP64 entries are skipped with a warning, and the total chapter text is capped at 2^27 characters
236
+ - CGM, WMF and EMF: elements that could not be read, and images not drawn because of the total pixel limit, are now reported as typesetting warnings (`画像 … の一部を描けません: …`; the CGM warnings used to be discarded, and WMF and EMF did not produce any)
237
+ - JPEG, TIFF and CCITT: bounded number of scans (up to 500), number of IFD values, and search cost of two-dimensional rows
238
+ - EPS (PostScript): limits on VM usage (512 MB; VMerror beyond it), the total number of path points (5 million; limitcheck beyond it), the amount a filter buffers (16 MB), image mask dimensions, the per-pixel cost of mesh shadings, `resourceforall` template matching, `search`, and the length given to `StartData`
239
+ - Layout: in deeply nested documents (tables inside tables, nested inline-blocks, floats, absolutely positioned boxes, multi-column containers and rotated containers) the layout cost no longer grows exponentially with depth (values obtained by measuring and trial layout are remembered and reused within one layout run; the result of the layout does not change). Nested tables in XSL-FO used to take 35 seconds at 12 levels and now take under a second at 60 levels
240
+ - **Layout: bounded the layout effort for deeply nested mixes of content-sized boxes (inline-container, inline-block, float, table, absolutely positioned and rotated containers) and for nested multi-column containers whose content overflows the page** (crafted input can no longer use up the time). Once one layout run (each re-run for page-number references counts separately) has made 100,000 layout passes, the remaining boxes are laid out at the available width without measuring their content, and multi-column containers nested deeper than 4 levels are laid out as a single column, with a warning. Documents below these limits are unchanged (the largest of the manuals and samples uses about 20,000 passes and nests multi-column containers one level deep). A 120-level mixed XSL-FO nesting that took minutes now takes about 5 seconds, and 10 nested overflowing multi-column containers take about 2 seconds instead of 80
241
+ - Painting and walking the Area Tree no longer exhaust the stack on deep nesting (recursion was removed). Rotated areas may nest up to 300 levels. Serializing a tree that is too deep raises `AreaTreeFormatError`
242
+ - EPS (PostScript): a limit on the total memory used by one EPS (512 MB; VMerror beyond it; arrays and dictionaries are counted with weights close to their real size), and a limit on the length of the generated SVG (128 MB; beyond it the drawing so far is kept and limitcheck is reported)
243
+ - Output: `renderPage` no longer throws on a page that uses a font whose no-break space (U+00A0) glyph cannot be read; one broken data URI or `@font-face` URL no longer makes the whole `typeset` call fail; the CLI skips unreadable directories below the input directory
244
+ - **Fixes for incorrect results** (found in the full review; each changes the result only for documents written the way described):
245
+ - Layout: content disappeared from a multi-column container without a specified height when it contained a forced column break; footnote bodies in tables and containers disappeared after the trial layout for column balancing; footnotes inside a block with a writing mode orthogonal to its parent, a rotated container or an inline-container disappeared; `break-before`, `break-after` and `keep-together` had no effect on orthogonal blocks and tables (XSL 1.1 §7.20); a long footnote on a multi-column page is now split and continued on the next page (§6.12.3); the id and the left and right borders of a multi-column container that spans pages; the number of columns of a table without column definitions (columns filled by rowSpan, the table footer; CSS 2.1 §17.5)
246
+ - HTML: list numbering no longer restarts when comments, `display: none` items or other children sit between list items; counters on table rows and row groups (a counter reset in a cell no longer leaks out of the table) and the ids of `tr` and `tbody`; bookmarks and `string-set` on the second and later list items and on table rows, cells and captions; no space is inserted between lines of single CJK characters; numbers outside the range of a counter style (`<ol start="0" type="i">` etc.) are written in decimal (CSS Counter Styles 3 §2); percent-encoded `#fragment`s; prefixed attributes in an `<svg>` in the document; a titled `rel="alternate stylesheet"` is not applied (CSSOM 1 §6.2; also in EPUB chapters); `break-before`, `break-after` and `break-inside` on list items (CSS Fragmentation 3 §3.1)
247
+ - EPUB: the attributes of `html` and `body` of each chapter are kept (vertical writing via `<html class="vrtl">` etc.); `container.xml` with single quotes; the leading newline of `pre`
248
+ - CSS: presentational attributes are weaker than rules inside `@layer` (CSS Cascade 5 §6.5); custom properties and counters with non-ASCII names (`var(--色)`, `counter(章)`); lists of relative selectors in `:has()` (`:has(> li, > p)`) and their scope (Selectors 4 §4.5); an unreadable `background` shorthand, invalid color components, an invalid `var()` (CSS Variables 1 §3.1) and cyclic variables make the declaration invalid; `@page` `margin` with nested parentheses in `calc()`; gradients with a single color stop; number syntax such as `font-weight: 550.5`, `line-height: +1.5`, `font: 550.5 12px serif` and `columns: +3`; `@supports` answers false for properties and values that are not interpreted (`position: sticky`, 3D `transform` etc.; CSS Conditional 3 §6.1); `size` in an `@page` inside an `@media` that depends on the paper size (width, height, orientation etc.) is ignored (CSS Paged Media 3 §7.1); non-ASCII names in `@page` (`var(--余白)`, `@page 表紙`, `string(題)`, `running(柱)`)
249
+ - CSS: a print colour `device-cmyk()` (CSS Color 5 §12.1) in a border or background shorthand (`border`, `border-top` and the other sides, `column-rule`, `background`) made the whole declaration invalid, so the border disappeared (the width and style of `border: 2px solid device-cmyk(1 0 0 0)`, the image of `background`). It is now accepted as the colour. With `--style ah`, `cmyk()` and `rgb-icc()` are accepted the same way (with other styles they still make the declaration invalid and are reported in the warnings)
250
+ - Line layout: a variation selector (IVS, SVS) forms one unit with its base character, and the glyph of the variation sequence is taken from the font (the non-default UVS table of cmap Format 14 of OpenType is also consulted; in PDF and in outline drawing on Canvas); `word-break: break-all` no longer breaks before a combining mark; the unit of text is now the grapheme cluster (the extended grapheme cluster of UAX #29, Unicode 18.0.0): a base character with combining marks (e + U+0301, か + U+3099) and emoji sequences (skin tone modifiers, ZWJ sequences, flags, keycaps, tag sequences) are one character, shaped as a whole with a single font (the font's GSUB and GPOS place the marks on the base; CSS Fonts 4 §5.3), and no line break (including `overflow-wrap: anywhere`), letter spacing or justification space falls inside them; inter-script spacing is also inserted between Latin letters and ideographs in Extension B and later, 〇 and 〆 (CSS Text 4 §8.4.1)
251
+ - Line layout: with hanging punctuation (`hanging-punctuation: allow-end`; CSS Text 3 §8.2), the punctuation at the end of a line whose end side is shortened by a float overlapped the float box. On such lines the punctuation no longer hangs; it is squeezed or moved to the next line (lines with a float only on the start side, and lines without floats, hang as before)
252
+ - Thai, Devanagari (Hindi and others) and Korean: Devanagari, which could not be typeset (fontkit's shaping failed), now works; the glyphs of Thai SARA AM and tone marks and Thai pair kerning follow the font. Thai text without spaces wraps at the word boundaries of a dictionary (the runtime's `Intl.Segmenter`; word boundaries can differ between runtimes). The space between Hangul words takes the width the font chooses by context. In PDF, characters whose glyphs do not correspond one to one to their characters carry the original characters (ActualText) for text extraction. Fonts for these scripts are not among the default fonts and must be specified
253
+ - Indic scripts (Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Sinhala): conjuncts are now one unit of text also in the scripts that the default rules of UAX #29 do not cover (those without Indic_Conjunct_Break): Gurmukhi, Kannada, Tamil (க்ஷ, ஸ்ரீ) and Sinhala (virama + ZWJ), as a tailoring for aksaras (UAX #29 §3, CSS Text 3 §1.4; before, Kannada ನ್ನ and the like came out as separate letters with a visible virama). Malayalam "consonant + virama" and Sinhala කෝ or "virama + ZWJ" sequences, which could not be typeset (fontkit's shaping failed), now work; the Sinhala repaya, the form of Bengali ে and ো inside a word (not the word-initial form) and vowel signs after a letter with nukta (a dotted circle could appear) follow the font. Kerning between units (syllables; the font's kern and dist) is applied to Indic scripts too. **Line widths and glyphs of these scripts change.** Fonts for these scripts are not among the default fonts and must be specified
254
+ - Lao, Khmer, Burmese (Myanmar script), Tibetan and Mongolian script: Khmer (mark positioning crashed), Myanmar (pre-base vowels, medials, kinzi and stacks stayed in logical order) and Mongolian script (nothing could be typeset with Noto Sans Mongolian) now work; the glyphs of Lao SARA AM and tone marks, the required ligatures of Khmer and pair kerning follow the font. A Myanmar syllable, and a Lao pre-base vowel with its consonant, form one typographic character unit (CSS Text 3 §1.4). Mongolian words join in vertical text too (`vertical-lr`, `vertical-rl`), and the vowel separator (MVS) and NNBSP are kept inside the word. In PDF, these units also carry their original characters (ActualText)
255
+ - Ligatures: a sequence listed in the font's ligature table (GSUB of OpenType) becomes one glyph whatever its length and kind of characters (fonts that replace words with icons: `favorite`, `arrow_back`, `3d_rotation` and so on in Material Icons; before, only two to four Latin letters). Discretionary and historical ligatures (`dlig`, `hlig`) and required ligatures (`rlig`) are also applied to sequences. With `letter-spacing`, ligatures enabled explicitly (`font-feature-settings: "liga" 1` and so on) are still formed, and the spacing is added after the ligature (CSS Text 3 §7.2, Fonts 4 §7.2). Horizontal writing only (no ligatures in vertical writing)
256
+ - XSL-FO: `fo:page-number-citation` and `-last` that refer to the id of an `fo:page-sequence` or `fo:flow` (the usual way to write "page N of M") are resolved; inherited properties on `fo:page-sequence` (`text-transform`, `font-family` etc.) reach its children; `start-indent` and `end-indent` inside table cells (a cell is a reference area; §5.3.2); the base of percentages in a vertical or rotated body; text properties on `fo:footnote`, `fo:footnote-body` and `fo:page-number`; one-value and vertical-keyword-first `background-position`; the components of `keep-*`; `rule-style="none"` with `leader-pattern="dots"`; an empty `number-columns-spanned`; when no math font is available, bottom alignment of a formula that consists of a single `mtable` is applied in compatibility mode only; the `external-destination` of `fo:bookmark` is written as an action of the PDF bookmark (URI, GoToR, Launch)
257
+ - Math: characters stretched by assembling parts (large parentheses, radicals, horizontal braces) no longer come out larger than the target (the maximum overlap of parts is determined by the connector lengths at the joining ends, as defined by the OpenType MATH table; the wording of MathML Core §5.3.1 has it the other way round)
258
+ - Images: SVG paths with packed arc flags (`a1 1 0 01.71.29`; SVG 2 §9.3.9); the first frame of an animated WebP is drawn; the size of a CGM (64-bit real and 32-bit integer precisions); an EMF with a reversed frame
259
+ - EPS (PostScript): the polarity of `imagemask` (stencils were inverted) and of the mask of ImageType 3 images (painted and transparent areas were swapped; PLRM §4.10.6); the form of `SubFileDecode` with EODCount and EODString in a dictionary (§3.13.3); filter errors become PostScript errors (what was drawn before the error is kept); the path after `gsave … show grestore`; `currentgstate`, `rectfill` and `rectstroke`
260
+ - EPS (PostScript): rectangles whose width and height have different signs (`rectfill`, `rectstroke`, `rectclip`) are also drawn counterclockwise (rectangles of different orientation overlapping in one `rectfill` used to leave a hole in the overlap; PLRM §4.6.5); `resourceforall` no longer passes an instance defined both locally and globally twice, and passes keys that are neither names nor strings as they are; the status from `resourcestatus` of an instance defined by `defineresource` is 0 (§8.2); `ASCII85Decode` raises ioerror when `~` is not followed by `>` (§3.13.3)
261
+ - XSL-FO: when several page masters use the same `fo:static-content`, the import report (the numbers of blocks and tables, unsupported properties) no longer counts it once per master
262
+ - References and fonts: style sheets and images that differ only in the query (`css2?family=A` and `css2?family=B`) are each read as separate resources; `&amp;` in `href` is decoded before fetching; non-ASCII text and `;charset=` parameters in non-base64 data URIs; characters from character references and CSS strings count for `unicode-range` filtering; font files with the same name in different directories are told apart from the location of the CSS containing `@font-face`; the message language returns to the original one after overlapping calls with different `lang`; spaces in `--css "a.css, b.css"`
263
+ - CLI: files referenced by relative references of the document or the CSS that point outside the input's directory (`url(../fx/a.ttf)` of an `@font-face` in `sub/a.html` etc.) were not read, and the default font was used without a warning. They are now read, like `file:` URLs (as when a browser opens a local HTML file; RFC 3986 §5.2). Relative references in CSS files that point above the input's directory also resolve to the right file. When none of the files in the `src` of an `@font-face` is found, the warning "font file of @font-face not found" is reported (CSS Fonts 4 §4.3; the CLI and the API)
264
+ - Line layout (results change): words of joining scripts such as Arabic are now broken between letters with `word-break: break-all`, and inside a word longer than the line with `overflow-wrap: anywhere` or `break-word` (in XSL-FO, on a line with no other break opportunity) (CSS Text 3 §5.1, §5.5). They used to be kept whole, so in a narrow box a word longer than the line overflowed far to the end side (left) of the right-to-left line and disappeared off the page. The letters at the break keep the joined forms (initial, medial, final) they have when the word is not broken (the note in §5.1; the pieces are passed to the font with a zero width joiner on the joining side; the lam-alef ligature is not split)
265
+ - Layout (results change): the fragments (column rows) of a multi-column container that spans pages now also get the background image, rounded corners, shadow (`box-shadow`) and diagonal borders (previously only the background color, borders and padding, so no fragment had the background image, rounded corners or shadow). For boxes split across pages or columns, with `box-decoration-break: slice` (the default) the corners on the side of the break are no longer rounded (CSS Fragmentation 3 §5.4: as if drawn unbroken and then sliced; previously all four corners of each fragment were rounded). With `clone`, each fragment is still rounded
266
+ - Line layout (results change): the background of an inline box with a background color (`span`, `fo:inline` and so on, without borders or padding) is now also painted where it contains an `inline-block` or an image (CSS 2.1 §9.2.2, §14.2, CSS Backgrounds 3 §3.7; the painted height is the content area of the enclosing box). Previously only the text was painted, leaving a gap at the `inline-block`
267
+ - CSS: `bleed: auto` (the initial value) in `@page` is 6pt when `marks` includes `crop`, and 0 otherwise (CSS Paged Media 3 §7.3). Previously `auto` was dropped, so the bleed was 0 and the BleedBox of a PDF with `marks: crop` equaled the TrimBox. **Documents that set `marks: crop` in `@page` without `bleed` now get a 6pt bleed** (when `@page` has neither `bleed` nor `marks`, the bleed set by options such as `--print` is used, as before)
268
+ - CSS: `trim-all` of `text-spacing-trim` (brackets, middle dots, full stops and commas set half width regardless of position) and `space-first` (full width at the start of the first line of a paragraph and of lines after a forced break, half width at the start of other lines) are typeset as in CSS Text 4 §8.5 (they used to be the same as `normal`). Combinations of keywords that set the start of the line, adjacent punctuation and the end of the line separately (`trim-start trim-end`, `space-start trim-adjacent` and so on; the grammar of the Editor's Draft; omitted positions take `trim-start trim-adjacent allow-end`) are read, also inside the `text-spacing` shorthand. `-ah-punctuation-trim: all` also sets them half width
269
+ - CSS: the color function `light-dark()` (CSS Color 5 §7) is read. It takes the second color when the color scheme of the element (`color-scheme`, or else `<meta name="color-scheme">`) supports only dark, and the first color otherwise (as this is print, the user preference is taken to be light; CSS Color Adjust 1 §2.3). `none` components in the modern syntax of `rgb()` and `hsl()` (CSS Color 4 §4.4; 0 when the color is used, a missing component inside `color-mix()`) are also read. Previously, declarations with these were dropped as unreadable
270
+ - CSS: specifications that were dropped without notice are now reported in the unsupported-CSS warning: `page-orientation` in `@page` (CSS Paged Media 3 §7.1.2), `@page :nth()` (CSS GCPM 3 §3), `target-counters()` (CSS Content 3 §6.2; also in the `content` of margin boxes), `@namespace` (CSS Namespaces 3 §2), `last` of `hanging-punctuation` (CSS Text 3 §8.2.1), and `shape-outside`, `shape-margin` and `shape-image-threshold` (CSS Shapes 1 §6; previously reported as unknown properties). The typeset result does not change
271
+ - **Distribution**:
272
+ - `require('kumiori')` and `require('kumiori/node')` work (the `exports` condition is now `default`; without a flag this needs Node 20.19.0 or later, or 22.12.0 or later)
273
+ - The type declarations work for consumers whose `moduleResolution` is `NodeNext` or `Node16` (relative specifiers in the declarations now end in `.js`; they used to cause errors or silently fall back to any)
274
+ - The output of the Node CLI (`dist-cli`) no longer contains the contents of `public/` meant for the web app (favicons etc.)
275
+ - **`@supports`**: answers false for declarations whose value cannot be read (`display: foo`, `color: notacolor`, `width: 10` and so on) (CSS Conditional 3 §6.1). Unsupported properties and values answer false as described under "Fixes for incorrect results" above
276
+ - **Antenna House extension values (results change)**: **Antenna House extension values written on unprefixed names (standard properties) are now read only with a compatibility setting (`--style ah` for HTML, `--compat antenna` for XSL-FO). Without one, the declaration or attribute is ignored as an invalid value, as the specifications say, and reported in a warning as "a value interpreted only with --style ah (--compat antenna)".** Until now they were read with every setting
277
+ - HTML: **the `float` values `top`, `bottom`, `start`, `end`, `inside`, `outside`, `center`, `alternate`, `multicol`, `sidenote` and so on (the CSS values are `left`, `right`, `none`, `inline-start`, `inline-end` and `footnote`), the unit `gr` as in `width: 2gr`, and the colors `cmyk()` and `rgb-icc()` (CMYK, grayscale and spot colors; the CSS function is `device-cmyk()`)**. With the default style the box is no longer floated or moved to the top or bottom of the page, and the color is no longer CMYK or a spot color; the result is the same as if the declaration were not written (an earlier or weaker declaration, if any, takes effect). **Using spot colors (`--spot-colors`) in HTML now requires `--style ah`**
278
+ - HTML: values written on the prefixed **`-ah-float`** (newly read; the values are the same as the `float` extension values) and **`inside` and `outside` of `-ah-text-align`** (until now only with `--style ah`) are read with every style
279
+ - XSL-FO: **the border styles `dot-dash`, `dot-dot-dash` and `wave` (`border-style`, `border-<side>-style` and shorthands such as `border`), and a number for `force-page-count`**. With the default `--compat spec` such a border is not drawn and a numeric `force-page-count` has no effect. Line styles written on `axf:` properties (such as `axf:diagonal-border`) are read in both modes
280
+ - XSL-FO: **a shorthand with an extension line style, such as `border="1pt dot-dash red"`, used to make the whole border disappear silently in both modes; this is fixed** (`--compat antenna` draws the border, `--compat spec` reports a warning). A line style that is neither kind (such as `border-style="zigzag"`) is reported in a warning in both modes (it was sometimes drawn like a solid line)
281
+ - The answers of `@supports` and the `supports()` of `@import` follow: `float: top`, `width: 3gr`, `color: cmyk(…)`, the border styles `dot-dash`, `dot-dot-dash` and `wave`, `counter(page physical)` and so on are true only with `--style ah` and false with the other styles (CSS Conditional 3 §6.1; the border styles and `counter(page physical)` used to answer true with every style, although these values have only ever been read with `--style ah`). Forms that are not used for layout even with `--style ah` (`counter(c reverse)` and so on) and unknown words (`float: zzz`) are false with every style
282
+ - `--style ah`: a `content` that writes `physical` or `reverse` on a counter other than `page`, such as `counter(c reverse)`, is ignored as an invalid declaration (it was accepted and produced nothing). `counter(page reverse)` is reported as unsupported
283
+ - **Declarations with invalid values (results change)**: **for about 50 properties whose value check was loose, a declaration whose value does not match the value definition of the specification is now ignored as an invalid declaration** (an earlier declaration in the same rule, a declaration of a weaker rule, or the inherited value takes effect; CSS 2.1 §4.2). `@supports` answers that it is not supported. Until now such a value was accepted and typeset as the initial value, or, for some values, read with another meaning (`flex-wrap: zzz` as wrapping, `flex-grow: -5` as a negative growth factor, `overflow: zzz` like hidden, and so on)
284
+ - Covered: `align-content`, `align-items`, `align-self`, `justify-content`, `flex`, `flex-direction`, `flex-wrap`, `flex-flow`, `flex-grow`, `flex-shrink`, `font-family`, `font-style`, `font-stretch` (`font-width`), `font-kerning`, `font-variant-caps`, `font-variant-ligatures`, `font-variant-numeric`, `font-variant-position`, `line-break`, `word-break`, `overflow-wrap` (`word-wrap`), `overflow`, `overflow-x`, `overflow-y`, `object-fit`, `vertical-align`, `border-radius` and the corner radii (negative values), `border-spacing` (negative values, percentages), `aspect-ratio`, `caption-side`, `columns`, `counter-reset`, `counter-increment`, `counter-set`, `list-style`, `list-style-type`, `quotes`, `page`, `text-decoration`, `text-decoration-line`, `text-emphasis-style`, `text-combine-upright`, `text-orientation`, `unicode-bidi`, `text-autospace`, `text-spacing-trim`, `text-spacing`, `hanging-punctuation`, `ruby-position`, `ruby-align`, `ruby-merge`, `ruby-overhang`, `alignment-baseline`, `bookmark-level`, `bookmark-state`, and the logical border styles (`border-block-style`, `border-inline-style` and so on)
285
+ - When a shorthand has a word that fits no component, or a second word of the same component (`text-decoration: underline zzz`, `flex: 1 2 3 4`, `columns: 2 3`, `list-style: disc circle`), the whole declaration is ignored (the word used to be skipped, or overwritten by the later word)
286
+ - `text-autospace: none` (an Antenna House form that is not a value of CSS Text 4) is read only with `--style ah` and reported in a warning with the other styles (it had no effect with the default style before either, but it cancelled an earlier declaration)
287
+ - **Ruby written with `fo:inline-container` in XSL-FO (results change)**: **a “small-text `fo:block` + body-text `fo:block`” pair inside `fo:inline-container` is typeset as ruby only with `--compat antenna`. With the default `--compat spec` it is typeset as an inline box as the specification says (the two blocks are stacked and the baseline of the line of the first block is aligned to the baseline of the surrounding line; XSL 1.1 §6.6.8), so the small text sits on the same line as the surrounding text and the body text becomes the line below**. This pattern is how documents written for AH Formatter express ruby; XSL-FO has no ruby element. Use `--compat antenna` to have it typeset as ruby
288
+ - **Warnings for unsupported CSS**: `text-decoration-skip-ink`, `text-wrap-mode` and `text-wrap-style` are reported as unsupported properties rather than unknown properties (also added to chapter 16 of the Conformance Guide)
289
+ - **Development**: `scripts/compare-pdf.mjs --html` works with the current web app again (it opens the settings drawer before selecting). The tests no longer depend on the machine's locale, on fonts installed on the machine, or on execution time. Font fetching for the tests is done in one place and is safe under parallel runs
290
+ - **Documents**: corrected the line count and test count in the README, the step numbers in the release procedure, and statements in the Conformance Guides, plans and other documents that disagreed with the implementation or between the Japanese and English versions
291
+ - **Publishing**: the PDFs of the Conformance Guides (four volumes, Japanese and English) are attached to the GitHub release of each version; the "Typesetting" row of the colophon shows the Kumiori version used to typeset them
292
+ - **Third-party notices**:
293
+ - Added notices for code bundled in the @pdf-lib/fontkit distribution (Brotli decoding, base64-js, buffer, etc.) (section 1.1.1)
294
+ - Hyphenation patterns: added the upstream (hyph-utf8) notices of the Russian, Ukrainian and Modern Greek patterns (section 1.4; the Russian patterns are under the LPPL). The files that bundle hyphenation patterns (the per-language chunks of the browser distribution and the web app) now start with the copyright and license notice of each pattern set (the full MIT permission notice; for the Russian patterns, a statement that the file is a modified version, the nature of the changes, where to obtain the original, and that the original authors do not support it)
295
+ - Added the grapheme cluster properties (auxiliary/GraphemeBreakProperty.txt and Indic_Conjunct_Break of DerivedCoreProperties.txt) to the Unicode character data (section 6)
296
+ - Added notices for the rules copied from CSS GCPM 3 Appendix B (section 10)
297
+ - Added notices for `src/cssColorFunctions.ts`, which copies the sample code for color conversion of CSS Color 4 (color space matrices, transfer functions, the conversion formulas of HSL, HWB, Lab, LCH, Oklab and OkLCh, and so on) (section 11)
298
+ - Every output JS file starts with a comment giving the Kumiori version, its license and where `THIRD_PARTY_NOTICES.md` is (for loading a single file from a CDN)
299
+ - The README of the Conformance Guides states the fonts embedded in their PDFs and the fonts' licenses
300
+ - **Line positions inside a line grid (`-ah-baseline-grid`)**: **Results change for documents that use `-ah-baseline-grid`.** (1) Inside a line grid, the line after a line of small glyphs (such as a chapter number; same line height) used to be moved down by one extra grid step (one line pitch); this is fixed (a chapter title could overlap the following section heading). (2) A line of large glyphs, or one containing large glyphs, is moved down to the grid line where the em box of its glyphs fits below the previous line (it could be off the grid or overlap the previous line). (3) At the end of the box that created the line grid (the element with `new` or `root`), no half-leading follows the last line (the box becomes shorter by the half-leading below its last line: (line-height − font size) ÷ 2 for a one-line heading, and the content after the heading moves up by that amount). The baseline positions (on the grid) of lines not covered by (1) and (2) are unchanged
301
+ - **`attr()`** (CSS Values 5 §7.7): `attr()` is now replaced with the attribute value in the values of properties other than `content`, `string-set` and `bookmark-label` (extension properties excluded). Typed forms (`attr(data-n number)`, `attr(data-w px)`, `attr(data-n type(<number>))` and so on) can be used as numbers and lengths, including inside `calc()`. An `attr()` without a type is a string, so a declaration such as `margin-top: calc(attr(data-n) * 20mm)` is invalid and is ignored with a warning (it had no effect before either, but there was no warning). Only with the AH Formatter compatible style (`--style ah`), an `attr()` without a type inside a math expression is read as a number when the attribute value is a number (**with `--style ah`, margins and sizes written this way now take effect**)
302
+ - **Multi-column boxes (`column-count`) inside list items that continue across pages**: when a multi-column box inside a list item (`li`) started low on a page and continued onto following pages, each continuation page only received about as much column height as had been left on the first page, producing a run of pages with a few lines each. Fixed (**affected documents get fewer pages**; continuation pages now use the full page height for the columns)
303
+ - **Line pitch in the XSL-FO compatibility mode (`--compat antenna`, `compat: 'antenna'`)**: **Results change for XSL-FO documents typeset in compatibility mode.** Lines that mix Japanese and Latin text used to get a line pitch slightly larger than `line-height` (for 10pt body text with `line-height="1.6"`, 16.22pt instead of 16pt on mixed lines only: about 1.35% of the pitch, so a page of 40 such lines ran about 8pt longer). Japanese-only, Latin-only and mixed lines now all get exactly the `line-height` pitch. In addition, the baseline of Latin-only lines used to sit slightly higher than that of Japanese lines (0.22pt at 10pt); it is now at the same position (in a table row, a Japanese cell and a digits-only cell share a baseline). Glyphs are positioned in the line using the vertical extents of the first font of the block's font specification (the Japanese font for `serif` and `sans-serif` in a Japanese document). Lines containing glyphs larger than the block's, lines with ruby, superscripts or subscripts, the handling of glyphs whose font is changed with `fo:inline`, spec mode (`--compat spec`, the default) and HTML+CSS are unchanged
304
+ - **Line breaking in the XSL-FO compatibility mode (`--compat antenna`, `compat: 'antenna'`)**: **Results change for XSL-FO documents typeset in compatibility mode.** Latin word spaces and the quarter-em space between Japanese and Latin text are no longer compressed to pull a character or word into the line (regardless of the paragraph's alignment; justified paragraphs, `text-align="justify"`, included). They never become narrower than their natural width, and the one character or word that used to fit by compression goes to the next line (a Latin word is hyphenated where it can be). This matches the output of AH Formatter; lines used to take one more character (or word). Some paragraphs gain a line, so page breaks may move. Pulling in by compressing the space of punctuation (commas, brackets), spec mode (`--compat spec`, the default) and HTML are unchanged
305
+ - **Line breaking in the XSL-FO spec mode (`--compat spec`, `compat: 'spec'`; the default)**: **Results change for XSL-FO documents typeset in spec mode.** In lines that are not set justified (lines of paragraphs with `text-align` `start`, `end`, `center`, `left`, `right`, `inside` or `outside`, and the last line and lines ending in a line feed of a justified paragraph, `text-align="justify"`), Latin word spaces are no longer compressed to pull a character or word into the line. Spaces keep their natural width, and the one character or word that used to fit by compression goes to the next line (spaces used to be compressed down to 1/3 so that a line took one more character or word; a single space in a Japanese line was enough for this to happen). This follows XSL 1.1 §7.17.8 (for `word-spacing="normal"` the word space has no room to shrink) and §7.16.9 (inline content may be stretched only for `justify`). Some paragraphs gain a line, so page breaks may move. Compression of word spaces in lines that are set justified, pulling in by compressing the space of punctuation (commas, brackets), compatibility mode and HTML are unchanged
306
+ - **XSL-FO properties** (now read and passed to the typesetter, regardless of `--compat`):
307
+ - the shorthands `font`, `background`, `page-break-before`, `page-break-after`, `page-break-inside` and `size`, and the size limits `min-height`, `min-width` and `max-width` (also `max-height` on table rows), are now read (XSL 1.1 §7.31, §7.15). They used to be ignored, so page breaks such as `page-break-before="always"` had no effect
308
+ - `clear` on `fo:block` (`start`, `end`, `both`, `left`, `right`) is now read, and the block starts below the earlier `fo:float` on that side (XSL 1.1 §7.19.1)
309
+ - the contents of `fo:folio-prefix` and `fo:folio-suffix` are now placed before and after page numbers (`fo:page-number`, `fo:page-number-citation`, `fo:page-number-citation-last`), for per-chapter folios such as “A-12” (XSL 1.1 §6.6.13, §6.6.14)
310
+ - indexes can now be typeset (XSL 1.1 §6.10, §7.24): the pages of elements with `index-key` (and `index-class`) and of `fo:index-range-begin`…`fo:index-range-end` ranges are collected, and the list of page numbers is typeset at `fo:index-page-citation-list`. Supports removal of duplicate pages, ranges of three or more consecutive pages, `merge-sequential-page-numbers`, `merge-ranges-across-index-key-references` and `merge-pages-across-index-key-references`, the separators (`fo:index-page-citation-list-separator`, `-range-separator`), prefix and suffix (`fo:index-page-number-prefix`, `-suffix`) and links (`page-number-treatment="link"`). Page numbers use the `format`, `fo:folio-prefix` and `fo:folio-suffix` of the cited page. When the index adds pages, the document is typeset again until it settles (with a warning if it does not)
311
+ - `font-variant="small-caps"` and `word-spacing` (a length added to inter-word spaces) are now read (XSL 1.1 §7.9.8, §7.17.8)
312
+ - `auto`, `0deg` (all glyphs upright) and `90deg` (all glyphs rotated sideways) of `glyph-orientation-vertical` are now read (XSL 1.1 §7.29.3). 180 and 270 degrees, and values other than 0 degrees of `glyph-orientation-horizontal`, are not read and are reported
313
+ - `relative-position="relative"` (an `fo:block` in horizontal writing is drawn shifted), `hidden` and `collapse` of `visibility` (the space is kept but nothing is drawn) and a negative `z-index` on an absolutely positioned `fo:block-container` (drawn behind the body text) are now read (XSL 1.1 §7.13.5, §7.30.17, §7.30.18)
314
+ - The kinds of `break-before` and `break-after` (`odd-page`, `even-page`, `page`, `column`) on `fo:table-row` and `fo:list-item` are kept, as for `fo:block` (XSL 1.1 §7.20.1, §7.20.2). **The layout result changes**: `odd-page` and `even-page` on a row or item start it on an odd or even page, inserting a blank page when needed (before, every kind only moved it to the next column or page). In a multi-column region, `page` moves to the next page instead of the next column
315
+ - Digit grouping of page numbers (`grouping-separator` and `grouping-size` on `fo:page-sequence`) is read (XSL 1.1 §7.26.2, §7.26.3; "1,234"). The values of `letter-value` are accepted (§7.26.4)
316
+ - Table-of-contents lines: `last-line-end-indent` is read (XSL 1.1 §7.16.3), so wrapped lines can stop short of `end-indent` while only the last line, with the page number, runs to the edge (`text-align-last="justify"` + `end-indent` + a negative `last-line-end-indent`). `reference-area` and `page` of `leader-alignment` are read (§7.22.1): the cycles of a dotted leader are aligned to a grid from the edge of the body region (column, table cell) or of the page
317
+ - `fo:initial-property-set` is read (XSL 1.1 §6.6.4): the font properties, `color`, `letter-spacing`, `word-spacing`, `text-decoration` and `background-color` are applied to the first line of an `fo:block` only. `text-transform`, `font-variant`, `line-height`, borders, `padding` and the like are not read and are reported
318
+ - Change bars (`fo:change-bar-begin`, `fo:change-bar-end`) are read (XSL 1.1 §6.13.2, §6.13.3): a bar is drawn beside the lines from the begin to the end (nested and overlapping ranges, multiple columns, vertical writing). `change-bar-color`, `change-bar-offset`, `change-bar-placement` (`start`, `end`, `left`, `right`, `inside`, `outside`, `alternate`), `change-bar-style`, `change-bar-width`
319
+ - `fo:retrieve-table-marker` is read (XSL 1.1 §6.13.7): the table header and footer show the content of an `fo:marker` found in the part of that table on the page (column) — "carried forward" and "subtotal" in ledgers, "(continued)" in tables. All values of `retrieve-position-within-table` and `retrieve-boundary-within-table`. When the retrieved content changes the height of the header or footer, the number of rows that fit on the page changes too. The form written as a child of `fo:table` is not supported (reported)
320
+ - Supports the hyphenation properties `hyphenation-character`, `hyphenation-push-character-count`, `hyphenation-remain-character-count` and `hyphenation-ladder-count`. `country` is used together with `language` to select the hyphenation rules (`language="en" country="GB"` selects British rules; **documents that were hyphenated with American rules because country was ignored now break differently**). `column` and `page` of `hyphenation-keep` are not supported (reported as a warning)
321
+ - **The character at the end of a hyphenated line is now U+2010 in spec mode (`--compat spec`, the default)** (the initial value of `hyphenation-character` in XSL 1.1 §7.10.5; it was U+002D). The width of the character differs, so line breaks in documents with `hyphenate="true"` can change. The compatibility mode (`--compat antenna`) and HTML keep U+002D. Write `hyphenation-character="-"` to get U+002D
322
+ - **Chinese (Traditional) punctuation**: punctuation drawn in the centre of the character frame (`、。,.` in Traditional Chinese fonts) is no longer trimmed by half an em and overlapped by the next character (`。」`, `,」`, `、)` and so on). Whether full stops, commas and colons (`:;`) are trimmed as closing punctuation or as middle dots is now decided from where the font draws the glyph (CSS Text 4 §8.5.3; colons at the lower left in Simplified Chinese fonts are closing punctuation). Results with Japanese fonts do not change
323
+ - **Vertical punctuation (Traditional Chinese fonts)**: when a font has `vert` but does not substitute the comma or full stop, the default (centred) glyph is used as is (it is not replaced by the Unicode vertical form, which sits at the upper right)
324
+ - **Default emphasis mark position for Chinese**: with no position specified, emphasis marks in Chinese (`lang` is `zh`) go below the characters (to the right in vertical text) (the default style sheet in CSS Text Decoration 3, Appendix B: `:root:lang(zh), [lang|=zh] { text-emphasis-position: under right; }`)
325
+ - **`<html lang>`**: the `lang` of `html` is now inherited by `body` and its descendants as the language of the text (HTML Standard §3.2.6.2; until now only `lang` inside `body` was used). In documents that only have `<html lang="ja">` or `<html lang="zh-…">`, the Japanese- and Chinese-only rules of `line-break: normal` (also the initial value `auto`) and `loose` now apply (a break is allowed before `〜` and `゠`, and so on; CSS Text 3 §5.2). **Results change**: in such documents the position before `〜` becomes a line break opportunity and a place where justification may add space. The hyphenation language of `hyphens: auto` also follows the `lang` of `html` (documents in languages other than English and Latin are no longer hyphenated with the English rules). With `--style ah`, the choice of the line's baseline (whether the document is CJK) also follows the `lang` of `html`
326
+ - **Chinese quotation marks for `quotes: auto`** (the `q` element and so on): Simplified Chinese (`zh`, `zh-Hans`, `zh-CN` and so on) uses `“ ” ‘ ’`. Traditional Chinese (`zh-Hant`, `zh-TW`, `zh-HK`, `zh-MO`) keeps `「 」 『 』` (the CLDR quotation marks that CSS Content 3 §4.1 refers to)
327
+ - **Latin-script text (Vietnamese), Greek and Cyrillic**: decomposed sequences (NFD, such as `e` + U+0323 + U+0302 or polytonic Greek) of Latin, Greek and Cyrillic letters are set with the precomposed character when the font has it (same appearance and width as the precomposed form; CSS Fonts 4 §5.3). Latin Extended Additional (U+1E00–1EFF: `ế`, `ệ`, `ṃ` and so on) is set in the same Latin font as the rest of the word and takes part in Japanese–Latin spacing and pair kerning. Greek and Cyrillic pairs are kerned with the font's kern data
328
+ - **Right-to-left scripts (Arabic, Hebrew)**: Arabic combining marks are stacked in the order of UTR #53 (a fatha sits above a shadda). The zero-width non-joiner (U+200C) inside a word has no width, and stand-alone invisible characters such as LRM, RLM and WJ have no width (they used to take the width of a space). Arabic in vertical text is joined and set sideways as a word (CSS Writing Modes 3 §5.1.1). Text can be extracted from the PDF in reading order (ActualText per word or cluster; fixes swapped or wrong characters). In the Canvas outline renderer, marks of right-to-left clusters are placed correctly. With the Hebrew letters of Tinos, vowel points and cantillation marks now avoid each other (the fixes for the font's contextual rules also apply to right-to-left scripts)
329
+ - **Greek and Cyrillic in Japanese documents**: with a generic or default font (a pair of a Japanese font and a Latin font), a word of two or more Greek or Cyrillic letters (`Россия`, `Ελλάδα`, `αβγ`, `Санкт-Петербург`) is set in the Latin font like a Latin word, and Japanese–Latin spacing is inserted between it and Japanese characters (before, letters the Japanese font has were set in the Japanese font and only the others in the Latin font, mixing fonts within one word). A single letter (`α`線, `Ω`, `β`-カロテン, `μ`m) stays in the Japanese font as before. **Results change** for words of two or more Greek or Cyrillic letters that were set in the Japanese font. Not changed with Antenna House compatibility (`--style ah`, `--compat antenna`)
330
+ - **Hyphenation**: added rules for Russian (`ru`), Ukrainian (`uk`) and Modern Greek (`el`, monotonic spelling) (`hyphens: auto`, `hyphenate="true"`; in text of these languages, words in Cyrillic or Greek letters are broken). The rules are loaded only when a document that uses them is opened
331
+ - **Hebrew (Tinos, Arimo and similar fonts)**: a dagesh or a shin/sin dot written after a vowel point now forms the glyph combined with the consonant (the points are passed to the font in the same order as HarfBuzz). The reordering of Arabic and Hebrew combining marks applies only to what is passed to the font; text extracted from the PDF keeps the original order
332
+ - **Documents (supported languages and scripts)**: added the section "Supported languages and scripts" (section 5.6 of the XSL-FO 1.1 volume, section 5.8 of the HTML and CSS volume) to the Conformance Guides (the four volumes, Japanese and English). For each language and script, a table gives whether the default fonts can set it or a font must be specified (and the fonts it was checked with), how lines wrap, vertical writing and the main limitations (it also names the scripts that have not been checked and the languages that have hyphenation rules; variable fonts and color emoji fonts can be used as described in the "Variable fonts" and "Fonts with colored glyphs" items above). The value table of section 5.4 of the XSL-FO volume now lists the same languages with hyphenation rules as the text (Russian, Ukrainian and Modern Greek were missing). The "Other scripts" item of the README now mentions Chinese, Vietnamese, Greek and Cyrillic and points to this table
333
+ - **Documents (font samples)**: added typeset samples to the font sections of the Conformance Guide (the four volumes, Japanese and English). Samples for each language and script (Article 1 of the Universal Declaration of Human Rights set in the fonts for Japanese, Chinese, Korean, Latin, Greek and Cyrillic, Hebrew, Arabic, the Indic scripts, Thai and other Southeast Asian scripts, Tibetan and Mongolian), emoji samples (color emoji, skin tone and ZWJ sequences, flags and keycaps, switching with U+FE0F and U+FE0E, monochrome emoji, vertical text, `font-palette`) and variable font samples (weight, width, slant and optical size, `font-variation-settings`, the ranges of `@font-face` and `font-named-instance`). The sample fonts (Noto fonts, Nabla, Anybody and Roboto Flex; SIL Open Font License 1.1) are not in the repository: `npm run docs:conformance` fetches them from the Google Fonts server (network access is required; the list is in `scripts/conformance-fonts.mjs`)
334
+ - **Height of the background, border and link area of inline boxes (`span` and so on)** (HTML): now the ascent above and the descent below the baseline of the element's first available font (the hhea ascent and descent) (CSS 2.1 §10.6.1, CSS Inline 3 §6.4). **The rendered result changes**: it used to be the font size (1em) high. With the default fonts (Latin Tinos / Arimo paired with the Japanese fonts) it is about 1.11em (0.01em more above, 0.10em more below), with the monospace font (Cousine) 1.13em, and with fonts that are tall above and below (Myanmar, Tibetan and so on) it covers the whole of the characters. Documents that specify only a Japanese font through `@font-face` keep the character frame (1em) and do not change (for fonts whose OS/2 typo ascender and descender span 1em, those values are used; Chromium uses the hhea values, which gives about 1.44em for Noto Serif JP and Noto Sans JP). The frame of a `span` that contains an image, ruby or superscript encloses the height of that element's text, not the whole line. Line heights and character positions do not change. `fo:inline` in XSL-FO does not change
335
+ - **Side of ruby and emphasis marks in vertical writing (`writing-mode: vertical-lr`)** (HTML): ruby (`ruby-position` unspecified or `over`) and emphasis marks (`text-emphasis-position` unspecified or `right`) are placed to the right of the text (CSS Writing Modes 3 §6.4: the over side of a line is the right in vertical-lr too; CSS Ruby 1 §4.1, CSS Text Decoration 4 §3.4). `under` and `left` go to the left. **Results change for vertical-lr documents**: they used to go on the opposite side (ruby and emphasis marks on the left, `ruby-position: under` on the right), and emphasis marks could not be put on the right. Horizontal writing, vertical-rl and XSL-FO do not change
336
+ - **Line spacing for ruby on the under side (`ruby-position: under`)** (HTML): when `line-height` is too small to hold the ruby, the missing amount is added on the side that has the ruby (below the line; on the left in vertical writing) rather than above the line (CSS Ruby 1 §3.6). With ruby on both sides it is split above and below in proportion to their thickness. **Results change for documents that use `ruby-position: under` with leading narrower than the ruby**: the space used to be added above the line, so the ruby below overlapped the characters of a following line without ruby. Ruby that fits in the leading and ruby on the over side do not change
337
+ - **Boxes of `::before` and `::after`** (HTML): background, border, padding, left and right `margin`, `vertical-align` and `box-decoration-break` now apply to a `display: inline` `::before` or `::after`. A `display: inline-block` `::before` or `::after` also takes `margin` (a negative `margin-left` can move it out to the left), border, background and height (CSS Pseudo 4 §4.1; until now only the text formatting, and the width and padding of an `inline-block`, were applied). **Results change**: backgrounds, borders and margins written on `::before` and `::after` are now drawn and take up space (for example, the space of `li::before { margin-right: 0.5em }` is inserted). An `inline-block` `::before` or `::after` without a width becomes one unbreakable box in the line (no line break inside its content)
338
+ - **Negative `margin` of inline boxes and line breaking** (HTML, XSL-FO): the negative left and right `margin` of a `display: inline` box (`span` and so on; in XSL-FO, `space-start`, `space-end` and `margin` of `fo:inline`) is now counted when deciding whether content fits on the line (CSS 2.1 §8.3, §9.4.2, §10.3.1). **Results change**: text that fits on the line once a negative right (end side) `margin` is subtracted now stays on one line (until now the line was broken using the width before subtracting the negative `margin`). Lines without a negative `margin` do not change
339
+ - **Text formatting of page margin boxes** (HTML): in margin boxes such as `@top-center`, `font-variant: small-caps` and `font-variant-caps`, the `font` shorthand, `text-transform`, `text-decoration`, `word-spacing`, `white-space`, `font-variant-*`, `font-feature-settings`, `font-kerning`, `font-stretch`, `font-variation-settings`, `font-palette` and `hyphens` now apply (CSS Paged Media 3 §6 and Appendix A; until now only font size, family, weight, style, color, line height and letter spacing were read). These declarations written in `@page` are inherited by the margin boxes. **Results change**: these declarations written on margin boxes (and in `@page`) now take effect (for example, the running head of `@top-right { content: string(heading); font-variant: small-caps }` is set in small caps, and the size and weight of the shorthand `font: bold 9pt sans-serif` apply). `text-transform` and small caps do not apply to the digits of `counter(page)` or to `element()` elements
340
+ - **Fonts without a space glyph** (XSL-FO, HTML): in text whose `font-family` names a font that has no glyph for a space (U+0020, U+00A0, U+202F, U+3000 and so on; emoji fonts, icon fonts, Latin fonts without a narrow space), spaces are now set in another font that has the glyph (the same fallback as for other characters missing from that font; CSS Fonts 4 §5.2). **Results change**: until now such a space became the missing-glyph mark (□) or was as wide as the font's missing glyph. The width of those spaces changes, and so does the height of a line that names only such a font (the font that decides the line height is the first font that has a space)
341
+ - **Inherited `font-family` and the element's language** (HTML): an element that inherits `font-family` from its parent now also chooses fonts by its own `lang` when it has one (the same result as an element that specifies `font-family` itself; CSS Fonts 4 §5.2). **Results change**: in a Japanese document, in elements whose `lang` is not Japanese, Chinese or Korean (`<p lang="ru">`, `<span lang="en">` and so on, without their own `font-family`), single Cyrillic and Greek letters (Russian `и`, `в`, `у` and so on) and symbols that the Latin font has (`—` and so on) are set in the Latin font instead of the Japanese font. A `lang="ja"` element inside a Latin-language element goes back to the Japanese font
342
+ - **Documents that list several `@font-face` rules with the same name** (HTML): when two or more `@font-face` rules have the same `font-family` and the same set of descriptors (`font-weight` and so on), they are now searched per character from the last one written, as in CSS Fonts 4 §4.5 and §5.2 (characters missing from the later font come from the earlier one). **This changes typesetting results**: previously only the first rule was used. A `@font-face` without a `font-weight` descriptor is selected as a weight-400 face even if the font file is bold (§4.4; bold text is drawn by emboldening that font). With `--style ah`, to match the output of AH Formatter, a `@font-face` without a `font-weight` descriptor is used as a face of the weight of the font file itself (usWeightClass in OS/2), so that bold text in a document that lists Regular, Bold and Heavy files under one name is set in the bold file (previously Regular was emboldened, which looked outlined)
343
+ - **Line spacing for second-level ruby and for emphasis marks under or to the left** (HTML): second-level ruby without a position (under the base; to the left in vertical writing) and emphasis marks under the text (`text-emphasis-position: under`; `left` in vertical writing) no longer count toward the line height, like ruby and marks on the over side; only the amount that does not fit in the leading is added on the side that has the annotation (CSS Ruby 1 §3.6, CSS Text Decoration 4 §3.4). **Results change**: until now such a line became taller by part or all of the annotation thickness (half the body font size; 5pt for 10pt text) even when the leading had room (2.5pt for a 10pt line with `line-height: 2`). **Lines with emphasis marks under the text or second-level ruby now have the same line pitch as other lines** (when the leading, `line-height` minus the font size, is at least the annotation thickness; when it is not, the line grows only by the missing amount). Chinese documents (`lang="zh"`) place emphasis marks under the text by default, so the pitch of their lines with emphasis marks changes. Ruby and emphasis marks on the over side in Japanese horizontal writing, and XSL-FO, do not change
344
+ - **`text-align: inside` and `outside`** (HTML; only with the AH Formatter compatibility style `--style ah`): these AH Formatter extension values, which align to the gutter (binding) side or the fore-edge side of the page, are now read (values written on the prefixed `-ah-text-align` are read with every style, see the "Antenna House extension values" item above; the same as `inside` and `outside` of XSL 1.1 §7.16.9; left and right pages are decided as for `@page :left` and `:right`). **Results change with `--style ah`**: until now the declaration was dropped as invalid and the inherited alignment (justified and so on) was used. With the other styles the values are still dropped as invalid (they are not values of `text-align` in CSS Text 3 §6.1). `text-align="inside"` and `"outside"` in XSL-FO were already supported
345
+ - **`inside` and `outside` of `text-align` and `text-align-last` in vertical writing** (XSL-FO; HTML with `--style ah`): in vertical lines the binding side (left or right) is not along the line (top to bottom), so on every page `inside` aligns to the start of the line (top) and `outside` to the end (bottom) (XSL 1.1 §7.16.9: when the binding edge is neither the start edge nor the end edge, `inside` is start and `outside` is end). **Results change**: until now top and bottom were swapped on even pages in vertical writing too. Horizontal writing does not change
346
+ - **`bolder` and `lighter` with `--style ah`** (HTML): `@font-face` rules without a `font-weight` descriptor now count with the weight of the font file (OS/2 usWeightClass), the same weight used to register the face. **Results change**: in a family that lists Regular and Bold files without descriptors, `b` and `strong` are set with the bold file. Previously they counted as the descriptor weight (400), became 500 and were set with the regular file
347
+ - **Column widths of tables with `--style ah`** (HTML): when the columns of an auto-width table do not fit, they are now distributed the same way as for XSL-FO tables (columns whose maximum length is at most half of an equal share keep their maximum length; the other columns get widths in proportion to their maximum lengths). The previous rule, which kept every column whose maximum length was at most an equal share, is gone. **Results change**: tables with many short columns (in the 9-column table "PDF/A の大きな特徴" of CSS-Print 4th edition, the PDF/A headers now wrap as "PDF/" and "A-1a" and the first column gets wider, as in the sample)
348
+ - **Line spacing in table cells with a line grid** (HTML): lines in the cells of a table (row, cell) with `-ah-baseline-grid: new` are no longer placed on the grid; their em boxes are stacked directly (matching AH Formatter's line grid samples: in CSS-Print 4th edition, with `table { line-height: 21q; -ah-baseline-grid: new }`, wrapped lines in a cell advance by the font size). **Results change**: previously the second and later lines were placed on the `line-height` grid (advancing by 21q)
349
+ - **Page number format and text-transform in margin boxes** (HTML): `counter(page, <counter style>)` in page margin boxes is now formatted with each box's own style, and that box's `text-transform` is applied (CSS Text 3 §2.1). Until now the style of the first `counter(page)` in the document was used for every box (so `lower-roman` in another box became decimal), and `text-transform` was not applied to the number. **Results change**: page numbers written with different styles or text-transform in different boxes
350
+ - **inside and outside of text-align-last** (HTML): `inside` and `outside` (AH Formatter extension values that align the last line of a paragraph to the gutter or fore-edge side; XSL 1.1 §7.16.10) are now read on `-ah-text-align-last` with every style, and on the unprefixed `text-align-last` only with `--style ah` (the same as `inside` and `outside` of `text-align`; with the other styles they are invalid values and produce a warning). Until now they were not read
351
+ - **font-synthesis** (HTML): `font-synthesis` (shorthand) and `font-synthesis-weight`, `-style`, `-small-caps` and `-position` (CSS Fonts 4 §2.8; inherited) are now read. With `none`, fonts without bold are not emboldened, fonts without italic are not slanted, and capitals are not shrunk in place of small capitals for fonts without small-cap glyphs. `font-synthesis-style: oblique-only` slants only for `font-style: oblique`. `-position` is only read (superscript and subscript glyphs were never synthesized). Until now they were reported as unsupported and synthesis always happened. **Results change**: glyph shapes in documents that set these to `none`
352
+ - **Content width with negative text-indent** (HTML and XSL-FO): when a box's width comes from its contents (shrink-to-fit for inline blocks, floats, table columns and so on), a negative indent is now subtracted from the line length (CSS Text 3 §8.1: the indent is treated as a margin on the start edge of the line box; the same as Chromium). Until now only positive indents were counted, so boxes with a negative indent were wider by the indent. **Results change**: widths of inline blocks and the like with a negative indent
353
+ - **Margins of inline svg and object** (HTML): inline `<svg>` elements written in the document and image `<object>` elements now get margins on all four sides, and borders, padding and background color, the same as `<img>` (CSS 2.1 §8.3, §10.8). Until now they were not read. **Results change**: positions of inline svg and object elements with margins and the like
354
+ - **Rounded corners and shadows of inline blocks** (HTML and XSL-FO): `border-radius` (and AH Formatter's `axf:border-radius` and so on) and `box-shadow` are now applied to inline-block boxes such as `display: inline-block` (`fo:inline-container` in XSL-FO) (CSS Backgrounds 3 §5.3, §7). Until now they were not applied to inline-block boxes: the background, border, background images and gradients were drawn square and shadows were not drawn (block boxes already had rounded corners and shadows). **Results change**: the appearance of inline blocks with rounded corners or shadows. Also, in XSL-FO compatibility mode, the unprefixed `border-radius` (not in XSL 1.1; an AH Formatter extension spelling) is read the same as `axf:border-radius` (the radio buttons in the axf-form-field-1 sample become round; spec mode still reports it as unsupported)
355
+ - **conic-gradient** (HTML): `conic-gradient()` and `repeating-conic-gradient()` (CSS Images 4 §3.3; `from <angle>`, `at <position>`, angle and percentage stops) are now drawn as backgrounds. Until now they were not drawn and no warning was shown. Both PDF and the web app draw them as thin wedges (1° or less) from the center (SVG and PDF have no conic gradient)
356
+ - **Inline images with borders, padding or background** (HTML): the border, padding and vertical margins of `img { border: …; padding: … }` now count toward the line height (CSS 2.1 §10.8: the inline box of a replaced element is as tall as its margin box). Until now the border and padding did not count and overlapped the neighboring lines, and vertical margins were ignored as unsupported. **Results change**: line heights and vertical positions of inline images with borders, padding or vertical margins
357
+ - **CSS applied by the command** (HTML): without `--css`, only the CSS in the input directory that the HTML references (`<link>`, `@import`) is used. Unreferenced CSS is not applied, and a warning says so. CSS named with `--css` is still added as a user stylesheet even if unreferenced. The API gains `unreferencedCss` (`'user-stylesheet'` (default) or `'ignore'`; the web app and the API default do not change). **Behavior changes**: until now the command also applied CSS meant for other documents in the same directory
358
+ - **Where lines are placed on the line grid** (HTML and XSL-FO; the AH Formatter extensions `-ah-baseline-grid` and `axf:baseline-grid`): (1) for lines set in a font smaller than the one that made the grid, the grid line is now chosen with the ascent of the grid's em box (when the top of the line plus that ascent passes a grid baseline, the next grid line is used). Until now the line's own em box was used, which sometimes put the line one grid line higher. (2) In lines with `line-height-shift-adjustment: disregard-shifts` (`-ah-line-height-shift-adjustment`), the raise of superscripts and subscripts is no longer counted (XSL 1.1 §7.16.5; the same as for the line height). Until now the top of a superscript could push the line to the next grid line. **Results change**: positions of lines with smaller fonts in a line grid and of lines with superscripts (in CSS-Print 4th edition, the caption of the figure in 11.1 is on the same grid line as in the sample, and so is the following heading 11.2.5; difference from the sample 1.6% → 1.5%)
359
+ - **Line grid in table cells** (HTML; the AH Formatter extension `-ah-baseline-grid`): `new` and `root` (inherited) on a table, row group, row or cell now also apply to the cell contents. In a line-grid area, no half-leading is added before the first line and after the last line (axf:baseline-grid in AH Formatter's public documentation), so a one-line cell is font size + padding + border high. Until now the table's declaration was not read and cell lines got half-leading. **Results change**: row heights of tables with a line grid (in CSS-Print 4th edition, the rows of the table in 10.1 and others go from 21.26pt to 14.88pt, as in the sample; difference from the sample 2.0% → 1.6%)
360
+ - **Inter-script spacing around footnote calls** (HTML): `text-autospace` (and `-ah-text-autospace`) on `::footnote-call` is now read. With `no-autospace` (`-ah-text-autospace: none`), no space is added between the footnote call and the adjacent Japanese characters (CSS Text 4 §8.4). Until now the quarter-em space of the surrounding text was added. **Results change**: positions of footnote calls in documents with this declaration (such as “要素2)” in CSS-Print 4th edition, which now match the sample)
361
+ - **Bottom margin of the last list item** (HTML): the bottom margin of the last child of the last item and the item's (li) own bottom margin now collapse with the margin after the list and the top margin of the next block (CSS 2.1 §8.3.1; when the li and the list have no bottom border or padding). Until now they stayed inside the item and were added to the margin of the next block. **Results change**: the space after lists whose last item ends with an element that has a margin (boxes, paragraphs and so on) (in CSS-Print 4th edition, the space above “フィードバック” in the preface becomes 7.79pt smaller and matches the sample)
362
+ - **`-ah-text-justify-trim` and `axf:text-justify-trim`** (HTML and XSL-FO; AH Formatter extensions read with every style and mode): the spacing that line adjustment (compression) may reduce is now read (inherited). `punctuation` also compresses the half-em space after full stops (。.) in the middle of a line, in the same proportion as commas and brackets, to fit characters on the line (the default `auto` does not, following JLREQ §3.8.3). `punctuation-except-fullstop` and `punctuation-except-middledot` exclude full stops and middle dots (・:;), and `none` compresses no punctuation space. `inter-word` compresses Latin word spaces even with AH Formatter compatibility. `kana` and `ideograph` (compressing the spacing between kana or kanji) are not supported and produce a warning. **Results change**: line breaks in documents that specify these (CSS-Print 4th edition specifies `punctuation` on `body:lang(ja)`; the number of lines in the multi-column example of 4.1.4 and the punctuation compression in 1.1 and elsewhere now match the sample; difference from the sample 2.4% → 2.0%)
363
+ - **Line height with footnote reference marks** (HTML and XSL-FO): when a footnote reference mark (`::footnote-call` and so on) is set in a fallback font (such as a Latin font in a Japanese line), its inline box is now determined from the first available font, as for single characters (CSS Inline 3 §5.3). Until now only the reference marks used their own font. **Results change**: heights of lines that count the reference mark at its unshifted position (`-ah-line-height-shift-adjustment: disregard-shifts`) and so on (in section 1.1 of CSS-Print 4th edition, the line with a footnote reference was 1.06pt taller and pushed the following box below the sample; it now matches the sample)
364
+ - **Line height with ligature glyphs** (HTML and XSL-FO): when a Latin ligature glyph (`ft`, `fi` and so on) comes from a fallback font (such as a Latin font in a Japanese line), the line height is now determined from the first available font, as for single characters (CSS Inline 3 §5.3). The same applies to glyphs of joined sequences (Arabic and so on). Until now only ligature glyphs determined the line height from their own font. **Results change**: heights of lines containing ligatures (in CSS-Print 4th edition, lines with “border-left-width” were 1.29pt taller and pushed the following lines below the sample; they now match the sample)
365
+ - **Vertical position of images with `-ah-alignment-baseline`** (HTML; Japanese lines with `--style ah`): the em box that `text-after-edge`, `text-before-edge`, `central` and so on align an image to is now that of the line's reference font (the Japanese font in Japanese lines) (XSL 1.1 §7.9.1: text-after-edge of an ideographic font is the ideographic baseline, 0.12em below the alphabetic baseline). Until now the em box of the first Latin font in `font-family` was used (0.25em below the baseline for Source Sans Pro). **Results change**: vertical positions of aligned images in Japanese lines whose `font-family` starts with a Latin font (the table-of-contents icons of CSS-Print 4th edition move up by 1.49pt, to the same position as in the sample)
366
+ - **Line height with outside list markers** (HTML): an outside marker (`list-style-position: outside`) belongs to the first line box of the item's content (CSS Lists 3 §3.5), so when the part of the marker below its baseline (from the marker font, `line-height` of `::marker` and so on) is deeper than that of the first line of the content, the first line box now extends downward. Until now, the marker's line height affected only the overall height of the item, not what follows the first line (nested lists and following lines). **Results change**: positions of the second and later lines and of nested lists in items whose marker font differs from the content
367
+ - **Prefixed MathML and SVG** (HTML; only with the AH Formatter compatibility style `--style ah`): in documents read with the HTML syntax, elements whose prefix is declared with `xmlns:prefix` as the MathML or SVG namespace (`<m:math xmlns:m="http://www.w3.org/1998/Math/MathML">`) are now set as MathML or SVG (as AH Formatter does). The HTML syntax does not treat prefixes as namespaces, so with the other styles such elements are still unknown elements whose text is set as is. Unlike `--xhtml`, which reads the whole document with the XML syntax, the newline after `pre` and so on follow the HTML syntax. **Results change with `--style ah`**
368
+ - **Where justification expands inter-character spacing** (HTML and XSL-FO): when the remaining space of a line is distributed to inter-character gaps, no space is now added before or after brackets, full stops and commas, middle dots, dividing punctuation (?!), hyphens, or ideographic spaces (JLREQ §3.1.11, “Character Sequences which Do Not Allow Increase of Spacing as Part of Line Adjustment Processing”). Until now, gaps at line-break opportunities (after commas, before opening brackets, after closing brackets and so on) received space. With AH Formatter compatibility (HTML `--style ah` and the XSL-FO compatibility mode), space is added before and after punctuation as well, as in AH Formatter's output (also at gaps where a line cannot break, such as “き、” and “す。”; not within inseparable “……” or “――”). **Results change**: positions of characters within justified lines (line breaks do not change)
369
+ - **`-ah-lang`** (HTML; with every style): `-ah-lang`, the AH Formatter extension that sets the language of an element (the same as `language` of XSL 1.1 §7.9.2; inherited), is now read. It applies to elements and to `::before`, `::after` and `::marker`, and takes precedence over the `lang` attribute on the same element. The language affects font selection (in Latin elements, symbols are also set in the Latin font), line breaking and inter-script spacing. **Results change**: until now it was ignored (for example, the list marker “◦” with `li::marker { -ah-lang: en }` is now set in the Latin font rather than the Japanese font, which also changes the line height)
370
+ - **Inter-script spacing and the ideographic space** (HTML): CSS `text-autospace` (and `-ah-text-autospace`) no longer adds space between the ideographic space (U+3000) and Latin letters or digits (CSS Text 4 §8.4.1: the ideographs that get the space are characters such as Han and kana, not the space character U+3000). `axf:text-autospace` in XSL-FO still treats the ideographic space as an ideograph. **Results change**: Latin text after an ideographic space (as in “第 1 章 Web”) moves a quarter em earlier
371
+ - **Column balancing** (HTML and XSL-FO): when the column height is increased so that earlier columns are not shorter than later ones, a height at which fewer columns are used (a later column is left empty) is no longer taken. **Results change**: content may now be set in the given number of columns with the second column longer than the first (until now the height was increased so that fewer columns were used, and the box could be pushed to the next page)
372
+ - **`-ah-text-decoration-line`, `-ah-text-decoration-style`, `-ah-text-decoration-color` and `-ah-text-line-width`** (HTML; with every style): these AH Formatter text decoration extensions are now read as `text-decoration-line`, `-style`, `-color` and `-thickness` (the line style `wave` as `wavy`; styles that CSS does not have, such as `dot-dash`, are dropped as invalid). **Results change**: until now they were ignored
373
+ - **Line breaking with `line-break: auto`** (HTML; only with the AH Formatter compatibility style `--style ah`): lines may now also break before small kana, the prolonged sound mark (ー) and iteration marks (ゝ, 々 and so on) (CSS Text 3 §5.2 leaves the rules of `auto` to the UA; this follows AH Formatter's output; explicit values such as `line-break: normal` do not change). **Results change with `--style ah`**: line breaks change
374
+ - **Baseline grid (`-ah-baseline-grid`)** (HTML and XSL-FO): when the half-leading of the last line of a `new` or `root` box is negative (`line-height` smaller than the font size), the box now extends to the bottom of the em box. The `root` grid is now drawn from the top of the page's content area, not from the top of the box, with the font size and `line-height` of the document root (until now, the style of the first line laid out). **Results change**: positions after large headings in a baseline grid, and of boxes on the `root` grid (such as figure captions)
375
+ - **`-ah-last-line-end-indent`** (HTML; with every style): this AH Formatter extension (the same as `last-line-end-indent` of XSL 1.1 §7.16.3; inherited; a negative value moves the end of the last line outward) is now read (also on `::before` and `::after`). Percentages are not read. **Results change**: until now it was ignored
376
+ - **`auto` left and right margins of vertical boxes in horizontal text** (HTML): for a vertical box whose width is determined by its content (also a box with `-ah-display-align`), the remaining space now goes to `auto` values of `margin-left` and `margin-right` (CSS 2.1 §10.3.3). **Results change**: until now the box was placed at the left
377
+ - **`-ah-float-x`** (HTML; with every style): of the AH Formatter float extensions, the horizontal position `-ah-float-x` is now read for `left`, `right`, `start`, `end`, `inside` (the gutter side) and `outside` (the fore-edge side), and is laid out the same as `float` to that side (when `float` is specified, `float` is used). On a `position: running()` element, the box is placed against that edge inside the page-margin box (`content: element()`). A box wider than the margin box overflows on the opposite side, and the part that leaves the page is cut at the bleed edge. **Results change**: `-ah-float-x` used to be ignored. A chapter mark (thumb tab) placed in the fore-edge margin with `-ah-float-x: inside` overlapped the left edge of the body text on left pages; it now appears at the left (fore) edge of the page, symmetric with right pages. `center`, `alternate`, `column-outside`, and declarations that also set `-ah-float-y` (the vertical position) are not read (same as no declaration; reported as unsupported)
378
+ - **Font of `position: running()` elements** (HTML; only with the AH Formatter compatibility style `--style ah`): when the element has no `font-family` of its own, its font is the `font-family` of the page-margin box that displays it (or of `@page` when the box has none), as in AH Formatter. **Results change with `--style ah`**: a running() element that specifies only a weight (`font-weight`), such as the number of a chapter mark, is set in that weight of the margin box's font instead of the bold of the body font. With the other styles it is inherited from its original position in the document, as before (CSS GCPM 3 §1.2.1)
379
+ - **Height of `line-height: normal` lines and glyphs from fallback fonts** (HTML): on a line with `line-height: normal`, glyphs set in the second or a later font of the `font-family` list (fonts loaded with `@font-face`, `--font` or `fonts`) now contribute that font's ascent, descent and line gap to the height of the line (CSS Inline 3 §5.3, CSS 2.1 §10.8.1; the same as browsers; also in vertical writing and for ruby bases). **Results change**: in a document with `line-height: normal` that lists a font for a tall script (Myanmar, Tibetan and so on) after a Japanese font, the lines containing that script become taller and no longer overlap (for example, three 20pt lines with `font-family: J, SM` (Noto Serif JP, Noto Serif Myanmar) go from 86.2pt to 149.9pt; Chromium gives 150.5pt). When a Japanese font is listed after a Latin font (both loaded), the lines containing Japanese characters get the height of the Japanese font. When a generic name (`serif` and so on) or the name of a default font comes before the loaded font in the `font-family` list, the first available font is the default font, so the `normal` line height is 1.2 (previously the value of the later, loaded font was applied to every line). Lines whose `line-height` is a number, a length or a percentage, and documents with the default style (`line-height: 1.75`), do not change. The `normal` line height of the default fonts (fonts that are not loaded) is still 1.2 times the font size, and they are not counted when used as fallback fonts
380
+ - **The baseline position within a line now comes from the font's metrics** (horizontal lines in HTML): the distance from the top of a line to the baseline is (line-height + A − D) ÷ 2, where A and D are the ascent and descent of the first available font (hhea ascent and descent) (CSS Inline 3 §5.3, CSS 2.1 §10.8.1; the same as browsers). Until now the baseline was placed 0.88em below the top of the font-size box for every font. **Results change**: glyphs move slightly up or down on every horizontal line in HTML. With the default fonts (generic `serif` = Latin Tinos + Japanese Noto Serif JP; the first available font is Tinos) they move up by 0.0425 times the font size (about 0.43pt at 10pt); `sans-serif` moves up by 0.033 times and `monospace` by 0.114 times; lines whose first font is a Japanese font named explicitly (Noto Serif JP, for example) move down by 0.0525 times. The line pitch does not change. However, when a line contains an element that names another font (monospace `code` within body text, for example), the boxes are aligned on their baselines and enclosed, so that line alone becomes slightly taller (for `monospace` glyphs of the same size and `line-height` within `serif` body text, by 0.07 times the font size = about 0.7pt at 10pt; browsers do the same). Page breaks therefore move in some documents (the "HTML and CSS" manual keeps its 139 pages, but on 19 pages the lines that fall on the page changed). To keep the lines even, give that element `line-height: 1` or similar. This also fixes lines that became slightly taller than needed when they contained a small `inline-block` or an image with `vertical-align: text-top`. Vertical lines and XSL-FO are unchanged. Antenna House compatibility (`--style ah`) is also unchanged (it keeps the baseline at the position of the character frame, to match the samples of Antenna House)
381
+ - **The default style no longer makes lines taller for monospace elements in body text** (HTML; only with the default style `kumiori`): inline `code`, `kbd`, `samp` and `tt` get `line-height: 1` (inside `pre` and the like they inherit the line-height of `pre`). Since the baseline within a line now comes from the font's metrics, a line of body text (generic `serif` or `sans-serif`) containing such a monospace element was about 0.07 times the font size taller; it now has the same height as the other lines (CSS 2.1 §10.8.1, CSS Inline 3 §5.3; when the body text's line-height is at least 1.15 times the font size). Backgrounds and borders keep their extent. A line-height in the author style sheet takes precedence. **Results change**: with the default style, lines with `code` and the like have the same line pitch as the body text (the English HTML and CSS conformance manual again breaks pages as in the previous version, except for one page). `--style browser`, `ah`, `weasyprint` and `vivliostyle` do not change
382
+ - **The page margins under `--style weasyprint` are now WeasyPrint's default of 75px (56.25pt)** (HTML): `@page { margin: 75px }` from WeasyPrint's default style sheet (css/html5_ua.css in WeasyPrint 65.1) is now part of the `--style weasyprint` default style sheet. Until now the margins were Kumiori's default of 20mm (56.69pt), shifting the whole page content by 0.44pt. A `margin` in the document's `@page` still takes precedence. **Results change**: documents under `--style weasyprint` that do not set page margins in `@page`
383
+ - **`line-height: normal` under `--style browser` and `browser-margin` now comes from the font's metrics for the default fonts too** (HTML): when a default font (Noto Serif JP, Tinos, Cousine and so on) is the first available font, the normal line height is its hhea ascent + descent + lineGap, and glyphs set in a default font as a fallback also count toward the line height (CSS Inline 3 §5.3 and §6.4, CSS 2.1 §10.8.1; the same as Chromium, the reference for these styles). A Latin-only line under the generic `serif` changes from 1.2 to 1.150 times the font size, a line with Japanese characters becomes 1.437 times, and a line under the generic `monospace` 1.133 times. **Results change**: the line pitch of `line-height: normal` documents under `--style browser` and `browser-margin` changes and comes closer to Chromium (median baseline difference from Chromium for the e2e/fixtures: sample 31.5 → 1.4pt (and 3 pages, as in Chromium), japanese 52.9 → 6.2pt, book 4.8 → 0.5pt, layout 9.5 → 6.2pt; the column pitch of vertical text 14.4 → 17.3pt against 18pt in Chromium). The other styles keep 1.2 times the font size for the default fonts
384
+ - **XSL-FO: the spaces before and after a `span="all"` block are now resolved by the rules for reference-area boundaries (results change).** In a multi-column body, only spaces with `conditionality="retain"` remain around a change of `span="all"` (XSL 1.1 §4.3.1, §6.4.14; previously the larger of the two spaces was kept). In compatibility mode (`--compat antenna`) the same applies to a single-column body (as Antenna House does)
385
+ - **XSL-FO: the `top` of an absolutely positioned `fo:block-container` that follows a `span="all"` block is now measured from the top of the area after the span (results change)** (XSL 1.1 §7.6.1; multi-column bodies, and single-column bodies in compatibility mode)
386
+ - **XSL-FO: when before-floats (`fo:float` with `float="before"`) are stacked, the last `space-after` in the content of each is now kept between it and the following before-float (results change)** (XSL 1.1 §4.3.1: the float areas are not reference areas, so the space remains up to the next float; previously they were stacked with no space). At the end of the before-float area (before the separator and the body text) the space is discarded in spec mode and kept in compatibility mode (`--compat antenna`), as Antenna House does. Stacked top floats in HTML (`float: top` and similar) are also spaced apart
387
+ - **XSL-FO compatibility mode (`--compat antenna`): a table row or `fo:list-item` with an integer-strength `keep-together` (such as `keep-together.within-column="1"`) that does not fit even on a new page (column) is now split from the current position, without applying the keep (results change)**. Previously it was not split and overflowed the bottom of the page, the same as `always`. This follows how Antenna House typesets (rows with `always` are still not split). Spec mode is unchanged
388
+ - **XSL-FO compatibility mode (`--compat antenna`): when a `keep-with-next` chain that starts at the top of a page (headings and the like) and the following block with `keep-together="always"` do not fit on one page, the block is no longer moved to the next page; it is placed after the chain without splitting and overflows the bottom of the page (results change)**. Previously only the block was moved to the next page (leaving a page with only the headings, and adding a page). This follows how Antenna House typesets (XSL 1.1 §4.8 does not list not fitting in the area as a reason to relax a keep). A warning is given when it overflows. Spec mode is unchanged
389
+ - **XSL-FO spec mode (`--compat spec`, the default): a table row or `fo:list-item` with `keep-together` that does not fit even on a new page (column) is now split from the current position, without applying the keep (results change)**. Previously it was not split and overflowed the bottom of the page. This matches `keep-together` on blocks (split when taller than a page); XSL 1.1 §4.8 does not settle how keeps are treated when the content does not fit in the area
390
+ - **XSL-FO compatibility mode (`--compat antenna`): in Japanese and Chinese text, line breaks are now allowed before and after ambiguous characters set full-width (≧, ①, ※ and the like; Line_Break AI in UAX #14) (results change)**. Previously they were treated as Latin letters (AL), so a sequence such as "fo:table-body≧fo:table-row" could not be broken. This follows Antenna House's output (UAX #14 allows AI to be treated as ID for compatibility with East Asian legacy implementations). Characters set half-width in a Latin font, spec mode and HTML are unchanged. Of the 217 samples, only table-keep-together-overflow-1 changes, and it now has 12 pages like the sample
391
+ - XSL-FO: `axf:outline-level` on a block inside `fo:static-content` no longer makes a bookmark and is reported as unsupported. Previously a bookmark was added each time the static content was read again for a page master, and none of them had a destination (with a missing-destination warning for each)
392
+ - HTML: a table (`table`) with `clear` is now placed below the floats on that side (CSS 2.1 §9.5.2). Previously the `clear` of a table was not read, and the table was placed over the area of the float, so cell text could overlap the float
393
+ - **XSL-FO: the font set is now chosen by the language of the element (results change)**. In an element whose `xml:lang` or `language` is not Japanese, Chinese or Korean (`xml:lang="en"`, `xml:lang="ru"` and so on; the three-letter codes `jpn`, `zho` and `kor` count as Japanese, Chinese and Korean), the default font set sets symbols (`—`, `§` and the like) and single Greek and Cyrillic letters (Russian `и`, `в`, `у` and the like) in the Latin font rather than the Japanese font. An element that inherits `font-family` gives the same result as one that specifies it (the same as `lang` in HTML; CSS Fonts 4 §5.2). A Japanese element inside a Latin-language element goes back to the Japanese font. In English documents (with `xml:lang="en"` on the whole document) the widths of dashes and similar characters change, and so does line breaking. Lists that name loaded fonts (MS Mincho and the like) are unchanged. Of the 217 samples, the 37 that specify a language: 3 better, 0 worse
394
+ - XSL-FO: the unprefixed `background-content-width` and `background-content-height` (names not in XSL 1.1) are now read only in compatibility mode (`--compat antenna`). In spec mode they are not read and are reported as unsupported. `axf:background-content-width` and `-height` are still read in every mode
395
+ - XSL-FO: values that cannot be read are now reported as warnings rather than silently dropped: keywords that are not in the value table (the Value line of each section of XSL 1.1), such as `display-align="justify"`, `hyphenate="none"`, `white-space="pre-wrap"`, `table-omit-header-at-break="column"`, `force-page-count="odd-document"`, `odd-or-even="odd-document"` and `page-position="second"`, and lengths with units that are not in XSL 1.1 §5.9.13 (`rem`, `ch`, `vw`, `q`, `jpt` and so on). The elements inside an `fo:page-sequence-master` that no `fo:page-sequence` refers to are no longer reported as unsupported
396
+ - XSL-FO: the background color of `fo:inline` is now also painted only up to the padding rectangle (XSL 1.1 §4.9.4; as with blocks and other boxes, only for boxes whose borders let the background show through, i.e. dashed, dotted, double and similar styles, or transparent and translucent border colors). Previously the background of an inline box was painted to the outer edge of the border and showed through the gaps in the border
397
+ - **XSL-FO: the outer half of the outer border of a table with `border-collapse="collapse"` is now placed outside the table regardless of the space around it (results change).** A table whose surrounding space is smaller than half the border moves up by half the border width (CSS2 §17.6.2)
398
+ - XSL-FO: `axf:border-radius` on `fo:inline` (rounded corners of inline boxes) and `axf:baseline-grid` (line grid; `new`, `root`, `none`) are now read
399
+ - XSL-FO: attributes and elements that were dropped silently (ineffective `axf:` extensions, misspellings, properties not read on that element) now appear in the warning "ignored unsupported XSL-FO elements/properties". String values of `text-align` (`<string>`) are also reported as unsupported
400
+ - Characters for which no loaded font has a glyph (drawn as the missing-glyph box) are now reported in a warning with the characters and their counts (XSL-FO and HTML)
401
+ - **Text extracted from PDF (lines with widened letter gaps)**: runs whose letter gaps are widened to 0.1em or more — a justified last line (`text-align-last: justify`, `text-align: justify-all`), `letter-spacing`, evenly spread ruby, dotted leaders in a table of contents — now carry the original character sequence (PDF ActualText). Text copied or extracted from the PDF no longer has spaces between the letters ("最 後 の 行"), and searching for "最後の行" finds it (in software that reads ActualText; verified with PDFium, used by the PDF viewer of Chrome and Edge, and with Poppler: `pdftotext` and Poppler-based viewers. MuPDF still splits by the gap width even with ActualText, so it is as before). **Glyph positions and the appearance do not change**; only the spaces in extracted text change, and the PDF content of lines that are not widened is the same as before. Some viewers select such a run as a whole. Where the font, the weight or an inline element (`span` etc.) changes within a line, the run is split there and a space may still appear. For vertical lines, see the next item
402
+ - **Text extracted from PDF (vertical lines)**: the characters of a vertical line (upright characters) are now written as glyphs of a PDF vertical font (Identity-V), one continuous run per line. They used to be placed one by one, so text copied or extracted from the PDF came out one character per line and words could not be searched (Poppler: `pdftotext` and Poppler-based viewers; PDFium, used by the PDF viewer of Chrome and Edge, did the same on pages with few vertical lines). Each line is now extracted as one line (PDFium joins a paragraph into one), and searching for a word such as "縦書き" finds it. Tate-chu-yoko is written as one unit inside the line with its character sequence (PDF ActualText; "平成12年" is extracted as a run). **Glyph positions and the appearance do not change**. The PDF content of horizontal lines is the same as before, and the PDF of a vertical document becomes slightly smaller. Vertical lines whose letter gaps are widened (0.1em or more) also carry the original character sequence, as in the previous item. Remaining: `pdftotext -raw` and MuPDF still put each glyph of a vertical font on its own line. Poppler may reverse the order of lines in multi-column vertical text, and may split a line at sideways Latin text, tate-chu-yoko and tightened consecutive punctuation
403
+ - **PDF: glyphs without a color picture in fonts that have pictures for only some glyphs (such as Source Code Pro, whose SVG table covers only a handful of glyphs)**: they are now written as ordinary text in an embedded font subset. Until now every glyph of such a font went through the color-glyph path (Type 3 fonts), so body text looked heavier, the PDF was larger, and the font name was lost. Glyphs that do have a color picture are still drawn in color (fonts with COLR, sbix or CBDT are unchanged). **Results change** (glyph positions are the same; how the glyphs are drawn changes)
404
+ - **How much glyphs are emboldened when the font has no bold face** (PDF, Canvas): the width of the stroke drawn around the outline is now 0.02 times the font size instead of 0.03 (it looked too heavy; this matches the output of widely used formatters). **Results change** (synthesized bold text gets slightly lighter; glyph positions and advances are the same)
405
+ - **Replacing the default fonts (`--font-dir`, `loadFont`)**: when the bold slot (`NotoSansJP-Bold.ttf` and so on) is given a file with the same contents as the regular weight of the same font, the font is treated as having no bold face and bold text is drawn by emboldening the regular face. Until now the same file was registered as the bold face, so bold text came out without any emboldening
406
+ - **Results change: bold Japanese text in Mincho is typeset in the bold Mincho face (Noto Serif JP Bold)** (HTML and XSL-FO; with every compatibility setting and default style sheet): until now the default Mincho font had no bold face, so bold Japanese text (`<b>`, `<strong>`, headings, `font-weight: bold`, `font-weight="bold"` in XSL-FO) inside Mincho text (`serif`, or no font specified) was typeset in Gothic (Noto Sans JP Bold). The specifications ask for the bold face of the same font (CSS Fonts 4 §5.2, XSL 1.1 §7.9.9), so Noto Serif JP Bold is added to the default fonts and bold Mincho text stays in Mincho. Headings of documents that specify no font also change from Gothic to bold Mincho (to keep Gothic headings, specify the font, for example `h1, h2, h3 { font-family: sans-serif; }`). Latin text is in Tinos Bold as before. Kanji, kana and full-width punctuation have the same advances, so line breaks do not change (half-width symbols set in the Japanese font, such as dashes, the quotation marks “ ” ‘ ’ and Greek letters, differ slightly in width). Text set back to the normal weight inside bold text (`font-weight="normal"` in XSL-FO), which stayed in Gothic, also returns to Mincho. Bold Japanese text with a monospace family in XSL-FO (until now drawn by emboldening the Mincho face) is also set in Noto Serif JP Bold
407
+ - **The default fonts fetched on first run grow by about 8MB** (`NotoSerifJP-Bold.ttf`; the fonts loaded for every document go from about 21MB to about 29MB in total). `DEFAULT_FONTS.base` of the API, and the fonts passed to `loadFont`, gain one entry
408
+ - If you replace the default fonts with your own through `--font-dir` or `loadFont`, provide `NotoSerifJP-Bold.ttf` too (when it is missing, Noto Serif JP Bold comes from the cache or the network like any other default font). When replacing with a font that has no bold face (MS Mincho and the like), place the same file as `NotoSerifJP-Regular.ttf` under the name `NotoSerifJP-Bold.ttf`: bold text is then drawn by emboldening that Mincho font instead of switching to Gothic. The same holds for the web app (`public/fonts/`)
409
+ - **Italic faces and faces of different widths** (HTML and XSL-FO; `--font`, `fonts`, `@font-face`, and fonts passed along with an XSL-FO document): faces within a family are now matched by width (`font-stretch`), then slant (`font-style`), then weight, as in CSS Fonts 4 §5.2. **Typesetting results change** (for documents that are given italic faces or faces of different widths):
410
+ - An italic or oblique font file (for `@font-face`, a `font-style: italic` / `oblique` descriptor) is used for `font-style: italic` / `oblique` text. Until now italic faces were not loaded and the upright glyphs were slanted. The advances are now those of the italic face, so line breaks can change. A family without an italic face is still drawn by slanting the upright glyphs
411
+ - Fonts that share a family name and differ in width (such as Arial and Arial Narrow) can now be given together with `--font` / `fonts`. Until now the one given later replaced the other (with Arial Narrow given later, all text requesting Arial came out in Arial Narrow). Without a request the normal-width face is used; `font-stretch: condensed` and the like, or the name of that face alone (`font-family: "Arial Narrow"`), selects the face of the other width. Glyphs set in a face of another width are not scaled. The `font-stretch` descriptor of `@font-face` works the same way
412
+ - `--style ah`: an `@font-face` without a `font-style` descriptor that points to an italic font file is used as an italic face (by default it is an upright face, as in CSS Fonts 4 §4.4)
413
+ - In the result (Area Tree), `GlyphArea.fontFamily` of a glyph set in an italic face or a face of another width has a mark after the font name (`Arial{ital=1}`, `Arial{wdth=75}`)
414
+ - **`font-family` lists in XSL-FO**: when the list names two or more loaded fonts (such as `font-family="Times New Roman, MS Mincho"`), characters missing from the first font (Japanese characters, for example) are now typeset in the next font of the list (XSL 1.1 §7.9.2: each character is looked up through the list in order, the same as in HTML). **Typesetting results change**: until now such characters were typeset in the default font (Noto Serif JP and so on), not in the later fonts of the list
415
+ - **Images supplied through `resolveResource` (references with `%xx` in the name)**: image references whose names contain spaces, parentheses, Japanese and so on, such as `<img src="/a%20b.png">`, came out as "image not found" even when `resolveResource` returned the data (the function was asked with the URL as written, `%xx` included, while images were matched by the decoded name, so the two did not meet). Fixed; the same applies to CSS `url()` and XSL-FO `fo:external-graphic`. Images passed in `files`, and references to CSS files and fonts, already worked
416
+ - **The exception "Trying to access beyond buffer length" when drawing to a canvas (`renderPage`)**: a page with a no-break space (U+00A0, `&nbsp;`) set in the default Latin font (Arimo) with OpenType features applied (`font-feature-settings` and so on) threw and could not be drawn. Fixed. The cause was that fontkit reads the glyph header even for TrueType glyphs without an outline (spaces), so it read past the table when the last glyph of the font is a space (U+00A0 in Arimo). The bounding box of an outline-less glyph is now empty without reading glyf (which also corrects the bogus boxes other spaces got from the neighboring glyph). In addition, a run that cannot be turned into outlines is now drawn with `fillText`, so the rest of the page is still drawn
417
+ - **Warnings on the screen (Kumiori in the browser)**: warnings from reading the document are now listed one by one in the left column (before, only the layout warnings were shown, joined into one line; the others went to the console or were not shown). Added: unsupported CSS / XSL-FO and unknown CSS properties, links whose actions were not written to the PDF for safety, nesting deeper than 128 levels and too many `@import`s, EPUB items skipped for exceeding the limits, images not fetched, and font notices. Identical messages are merged, and four or more are collapsed to a count (the count also appears in the top bar)
418
+ - **"Default page size" in the screen settings**: choose the paper for HTML that does not specify `size` in `@page` from A4, A5, B5, JIS-B5, letter or free input (`A5 landscape`, `148mm 210mm`); the same as the CLI's `--page-size` and the API's `pageSize` (the default stays A4)
419
+ - **Position of SVG `text` when its first character is inside a `tspan`** (SVG images in HTML and XSL-FO): **results change.** In `<text x="…" y="…"><tspan>…</tspan></text>`, where the first character is inside a child `tspan`, the `x` and `y` of the `text` were ignored and the characters were placed at the origin (usually outside the picture). Fixed (SVG 1.1 §10.5: when the `tspan` has no value of its own, the ancestor’s value applies to that character). An empty `y=""` or `dy=""` on a `tspan` is read as not specified. Text that used to disappear now shows in documents that use such an SVG as a background (for example a watermark given as `background-image` on `fo:region-body` in XSL-FO) or as an image
420
+ - **XSL-FO: an `fo:flow` is flowed into the region that matches its `flow-name`** (XSL 1.1 §6.4.1.4): **results may change.** When an `fo:page-sequence` has several `fo:flow` elements, the first one used to be flowed into the body whatever its `flow-name`. Now the `fo:flow` whose name matches the body region (`fo:region-body`: its `region-name` if given, otherwise `xsl-region-body`) is flowed into the body. Documents with a single `fo:flow`, and documents whose first `fo:flow` matches the body region, are unchanged. An `fo:flow` whose name matches no region, or one without `flow-name`, is still flowed into the body, with a warning ("no region matches flow-name "…"; its content was flowed into the body region"; it used to be reported as the unread attribute flow-name)
421
+ - **XSL-FO: unprefixed attributes on `axf:form-field`** (`field-type`, `field-name`, `field-default-text`, `field-maxlen`, `field-multiline`, `field-checked`, `field-value`, `field-button-face`, `action-type`, and `field-submit-method` on `axf:form`, among others): **results change.** Attributes written without `axf:` on `axf:form` and `axf:form-field`, as in Antenna House’s examples and samples, were not read (every field became a "text" field with a generated name, and default values, options and button captions were lost). They are now read like the `axf:` names (`axf:field-type` etc.), whatever `--compat` is (the `axf:` name wins when both are present). Per-event actions (`axf:form-field-event`) and button `action-type` values other than `submit` and `reset` (`javascript`, `uri` etc.) are still not written to the PDF (no scripts are written); the warning now names them
422
+ - **XSL-FO: gradients in `background-image`** (`linear-gradient()`, `radial-gradient()`, `repeating-linear-gradient()`, `repeating-radial-gradient()`): in compatibility mode (`--compat antenna`, `compat: 'antenna'`) they are drawn as the same gradient backgrounds as in HTML (**results change in compatibility mode**: nothing was drawn before, and there was no warning). The values of `background-image` in XSL 1.1 §7.8.3 are `<uri-specification> | none`, so in specification mode they are not drawn and a warning reports them (`background-image:linear-gradient()`). The same applies to a gradient inside the `background` shorthand
423
+ - XSL-FO: `axf:background-size` (size of the background image: lengths, percentages, `auto`, `cover`, `contain`; first layer only) is read, whatever `--compat` is (**results change for documents that use this attribute**: it used to be reported as unread). `background-image`, `background-repeat` and `background-position` on `fo:simple-page-master` are read as the page background image in compatibility mode only (by the specification the background properties do not apply to `fo:simple-page-master`, so in specification mode they are still reported in the warning)
424
+ - XSL-FO: a `start-indent` written as a length on the `fo:list-item-body` of the second and later list items is read (XSL 1.1 §7.11.7). When it equals the value on the first item the result is unchanged and the warning "unread attribute start-indent (fo:list-item-body)" no longer appears. A value larger than the first item’s indents that body by the difference (**results change for documents written that way**: the body used to be placed at the first item’s position). A smaller value cannot be placed and is still reported in the warning
425
+ - **XSL-FO: the background color is now painted up to the padding rectangle** (XSL 1.1 §4.9.4; independent of `--compat`): **results (appearance) change.** The background color used to be painted up to the outer edge of the border (the border box), so it showed through the gaps of dashed, dotted and double borders and under borders with a transparent color. It is now painted up to the inner edge of the border (the padding rectangle), as the specification says. Only boxes that have both a background color and a border with gaps (dashed, dotted, dot-dash, double, wave) or a transparent color on the same element change (`fo:block`, `fo:block-container`, `fo:table`, `fo:table-cell`, region borders in compatibility mode, and so on). Boxes with opaque solid or 3D-style (`groove`, `ridge`, `inset`, `outset`) borders and boxes without borders are unchanged. With rounded corners (`axf:border-radius`) the background corners follow the inner curve of the border. The parts that overlap the outer border of a collapsed-border table are not changed yet (backgrounds of inline boxes, `fo:inline`, are also painted up to the padding rectangle, as described in a separate item above)
426
+ - **Content written after `</body></html>`** (HTML; the Node command and the API; **the result changes**): elements and text written after `</html>` (or `</body>`), as in `<html><body><p>a</p></body></html><p>b</p>`, were dropped. They are now laid out as a continuation of body, as browsers do (the "after body" and "after after body" insertion modes of the HTML Standard). Comments after the end, and whitespace at the end of the document, add nothing, as before
427
+ - **Positive left and right `margin` on inline boxes and line wrapping** (HTML; **the result changes**): the left and right `margin` of a `display: inline` box (`span` and so on) is no longer separated from the first and last characters of the box (CSS 2.1 §9.4.2, CSS Text 3 §5.5: a line is broken outside the margin edge of the box). Before, the end `margin` could be left at the start of the next line, shifting the first character to the right (setting `一二三四<span style="margin-right: 30pt">五</span>六七` five characters wide shifted 六 by 30pt), the start `margin` could be left at the end of the previous line, an empty line was added at the end of a paragraph, and a full stop could come to the start of a line. Now, when the `margin` does not fit on the line, the character moves to the next line with it (as in browsers). An inline box with `box-decoration-break: clone` also gets its left and right `margin` on each fragment (CSS Fragmentation 3 §5.4). Only with the AH Formatter compatible style (`--style ah`), a start `margin` that comes to the start of a wrapped line is dropped (as in the reference output). Inline boxes without `margin`, negative `margin`, and `space-start` / `space-end` in XSL-FO are unchanged
428
+ - **Heading of the conversion report on the screen**: the report said "XSL-FO 変換レポート" (XSL-FO conversion report) even for HTML documents (EPUB included); the heading now follows the kind of document ("HTML 変換レポート" for HTML; the hint for images not found and the line shown when nothing is unsupported also follow the kind of document)
429
+ - **`@font-face` fonts of a previously opened document staying on the screen (Kumiori in the browser)**: when HTML documents that use the same `font-family` name for different font files were opened one after another, the later document was set in the font of the earlier one (and a bold face that only the earlier document had could be used for bold text in the later one). Each time a document is opened, its `@font-face` files are now registered again and faces that only the previous document had are removed (including the fonts registered with the browser). Re-laying out the same document after changing a setting does not reload the fonts. The Node command and the API already keep fonts separate per document and are unchanged
430
+ - **Kerning in content-size estimates (max-content, min-content)** (HTML): content widths such as those of flex items (children of `display: flex`) were estimated without kerning, so runs that kerning widens (such as "2.2" in some fonts) did not fit the item's width and split into "2." and "2" with `overflow-wrap: break-word`. The estimate now adds the same kerning to the same character pairs as line layout does (following `font-kerning` and the "kern" setting of `font-feature-settings`). **Results change** (boxes sized by their content, with kerned Latin text, get slightly different widths)
431
+ - **XSL-FO: `background-color` on `fo:simple-page-master` is read only in compatibility mode (`--compat antenna`)**: the background properties do not apply to `fo:simple-page-master` (XSL 1.1 §6.4.13), so in specification mode (the default) it is not read and the load warnings report it. **Results change for documents typeset in specification mode** (a background color written on the page master no longer appears). `axf:background-color`, whose name carries the prefix, is read in every mode
432
+ - **PDF: the original text (ActualText) attached to words in right-to-left scripts (Arabic, Hebrew) is now written in reading order** (ISO 32000-2 §14.9.4: replacement text is the characters equivalent to what a person sees). It used to be written in drawing order (left to right). **Text extracted from the PDF changes**: in the Chrome and Edge viewers (PDFium) the characters of each word now come out in reading order (they were reversed); poppler's pdftotext and MuPDF also reorder ActualText characters, so their words now come out reversed (they used to be in reading order). The appearance does not change
433
+
7
434
  ## 0.1.1 (2026-11-09)
8
435
 
9
436
  A release that completes the notices for third-party software and documents. Typesetting behaviour and the API are the same as in 0.1.0.
@@ -25,5 +452,5 @@ The first public release.
25
452
  - **Pages**: page masters, running heads and page numbers (folios), footnotes, multi-column layout, floats, tables (splitting, repeated headers, automatic column width), page number references, bookmarks, links, annotations, forms
26
453
  - **Output**: Canvas preview, PDF (subset font embedding, trim marks, PDF/X-3 marking)
27
454
  - **Other scripts**: right-to-left scripts such as Arabic and Hebrew (UAX #9, joined forms of Arabic letters), Latin hyphenation
28
- - **Usage**: the browser web app, the Node CLI `kumiori` (`--help`, `--version`, `--lang ja|en` and `KUMIORI_LANG` for English messages, a cache for the default fonts, warnings for unsupported CSS and XSL-FO), the library (`kumiori`: ES module; `kumiori/browser`: a single file for browsers with the dependencies bundled)
455
+ - **Usage**: the browser web app, the Node CLI `kumiori` (`--help`, `--version`, `--lang ja|en` and `KUMIORI_LANG` for English messages, a cache for the default fonts, warnings for unsupported CSS and XSL-FO), the library (`kumiori`: ES module; `kumiori/browser`: a single file for browsers with the dependencies bundled; the `lang` option for English warnings)
29
456
  - **Documentation**: the Conformance Guide (HTML and CSS volume, XSL-FO volume; Japanese and English editions), the Area Tree JSON specification, and English versions of the README and docs (README.en.md, docs/en/)