kumiori 0.2.0 → 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 (126) hide show
  1. package/CHANGELOG.en.md +97 -2
  2. package/CHANGELOG.md +98 -3
  3. package/NOTICE +2 -0
  4. package/README.en.md +53 -17
  5. package/README.md +53 -17
  6. package/THIRD_PARTY_NOTICES.md +364 -26
  7. package/dist-browser/NOTICE +2 -0
  8. package/dist-browser/THIRD_PARTY_NOTICES.md +364 -26
  9. package/dist-browser/chunks/{UTIF-DJ2yEO_P.js → UTIF-D5qoainF.js} +4 -4
  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-Bh-cSidd.js → el-monoton-BVsCvfmZ.js} +4 -4
  13. package/dist-browser/chunks/{en-gb-DLCXyvjY.js → en-gb-Cjtf0A6r.js} +4 -4
  14. package/dist-browser/chunks/{en-us-BBLcTX9N.js → en-us-B_UiZPbu.js} +4 -4
  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-DDGE_g3K.js → export-contract-OHP-GNO0.js} +3 -3
  18. package/dist-browser/chunks/{la-D46x91kc.js → la-7qtmi2aU.js} +4 -4
  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-CeDDB8tF.js → pako-Dl02IHsa.js} +6 -6
  23. package/dist-browser/chunks/pixels-ByXzkjlj.js +714 -0
  24. package/dist-browser/chunks/{rolldown-runtime-BXCUS5Bd.js → rolldown-runtime-Bra2mvh4.js} +2 -2
  25. package/dist-browser/chunks/{ru-CkmoNumx.js → ru-BMiVc5Ts.js} +4 -4
  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-DIZr4Urv.js → uk-ChOFgYc8.js} +4 -4
  29. package/dist-browser/kumiori.js +23159 -38999
  30. package/dist-cli/NOTICE +2 -0
  31. package/dist-cli/THIRD_PARTY_NOTICES.md +364 -26
  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 +53167 -56741
  38. package/dist-lib/NOTICE +2 -0
  39. package/dist-lib/THIRD_PARTY_NOTICES.md +364 -26
  40. package/dist-lib/{api-CQ3aOtc5.js → api-DB-5PKHp.js} +20086 -24380
  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 +11 -12
  45. package/dist-lib/load-plWCtVUv.js +15328 -0
  46. package/dist-lib/metafile-BOfMQbwN.js +1867 -0
  47. package/dist-lib/node.js +4 -5
  48. package/dist-lib/pixels-ByXzkjlj.js +714 -0
  49. package/dist-lib/types/api.d.ts +26 -1
  50. package/dist-lib/types/areaTree.d.ts +3 -1
  51. package/dist-lib/types/assets.d.ts +57 -3
  52. package/dist-lib/types/base64.d.ts +7 -0
  53. package/dist-lib/types/ccitt.d.ts +1 -1
  54. package/dist-lib/types/cgm.d.ts +2 -2
  55. package/dist-lib/types/color.d.ts +9 -3
  56. package/dist-lib/types/colorGlyphPdf.d.ts +4 -0
  57. package/dist-lib/types/compat.d.ts +11 -2
  58. package/dist-lib/types/cssSelector.d.ts +40 -1
  59. package/dist-lib/types/documentResources.d.ts +2 -1
  60. package/dist-lib/types/drawio/base64.d.ts +6 -0
  61. package/dist-lib/types/drawio/drawio.d.ts +137 -0
  62. package/dist-lib/types/drawio/drawioCanvas.d.ts +156 -0
  63. package/dist-lib/types/drawio/drawioEdges.d.ts +89 -0
  64. package/dist-lib/types/drawio/drawioJs/archimate.d.ts +33 -0
  65. package/dist-lib/types/drawio/drawioJs/arrows.d.ts +37 -0
  66. package/dist-lib/types/drawio/drawioJs/aws3d.d.ts +18 -0
  67. package/dist-lib/types/drawio/drawioJs/basic.d.ts +29 -0
  68. package/dist-lib/types/drawio/drawioJs/bpmn.d.ts +35 -0
  69. package/dist-lib/types/drawio/drawioJs/edges.d.ts +19 -0
  70. package/dist-lib/types/drawio/drawioJs/electrical.d.ts +29 -0
  71. package/dist-lib/types/drawio/drawioJs/misc.d.ts +34 -0
  72. package/dist-lib/types/drawio/drawioJs/mockup.d.ts +27 -0
  73. package/dist-lib/types/drawio/drawioJs/mockupIos.d.ts +2 -0
  74. package/dist-lib/types/drawio/drawioJs/ui.d.ts +34 -0
  75. package/dist-lib/types/drawio/drawioShapes.d.ts +51 -0
  76. package/dist-lib/types/drawio/drawioShapesA.d.ts +23 -0
  77. package/dist-lib/types/drawio/drawioShapesB.d.ts +26 -0
  78. package/dist-lib/types/drawio/drawioSketch.d.ts +50 -0
  79. package/dist-lib/types/drawio/drawioStencil.d.ts +159 -0
  80. package/dist-lib/types/drawio/drawioTapered.d.ts +67 -0
  81. package/dist-lib/types/drawio/drawioText.d.ts +27 -0
  82. package/dist-lib/types/drawio/drawioXml.d.ts +40 -0
  83. package/dist-lib/types/drawio/index.d.ts +37 -0
  84. package/dist-lib/types/drawio/inflate.d.ts +12 -0
  85. package/dist-lib/types/drawio/load.d.ts +35 -0
  86. package/dist-lib/types/drawio/messages.d.ts +12 -0
  87. package/dist-lib/types/drawio/options.d.ts +44 -0
  88. package/dist-lib/types/drawio/prefixSums.d.ts +9 -0
  89. package/dist-lib/types/drawio/sniff.d.ts +16 -0
  90. package/dist-lib/types/eps.d.ts +2 -28
  91. package/dist-lib/types/epsInfo.d.ts +36 -0
  92. package/dist-lib/types/fontMapping.d.ts +14 -0
  93. package/dist-lib/types/fontSanity.d.ts +15 -0
  94. package/dist-lib/types/hebrewMarks.d.ts +11 -3
  95. package/dist-lib/types/htmlImport.d.ts +22 -0
  96. package/dist-lib/types/htmlPaged.d.ts +15 -2
  97. package/dist-lib/types/htmlParserStack.d.ts +26 -0
  98. package/dist-lib/types/htmlPrepare.d.ts +6 -2
  99. package/dist-lib/types/imageFormats.d.ts +138 -0
  100. package/dist-lib/types/imageInfo.d.ts +6 -1
  101. package/dist-lib/types/imageLimits.d.ts +4 -4
  102. package/dist-lib/types/index.d.ts +6 -1
  103. package/dist-lib/types/inflateFast.d.ts +12 -0
  104. package/dist-lib/types/inlineLayout.d.ts +16 -0
  105. package/dist-lib/types/jis.d.ts +19 -0
  106. package/dist-lib/types/layoutEngine.d.ts +34 -2
  107. package/dist-lib/types/linearText.d.ts +69 -0
  108. package/dist-lib/types/lnode.d.ts +10 -0
  109. package/dist-lib/types/pdfCheck.d.ts +36 -0
  110. package/dist-lib/types/pdfLibPatches.d.ts +1 -1
  111. package/dist-lib/types/pdfRenderer.d.ts +38 -12
  112. package/dist-lib/types/pdfStandard.d.ts +78 -0
  113. package/dist-lib/types/pixels.d.ts +21 -3
  114. package/dist-lib/types/psFilters.d.ts +4 -14
  115. package/dist-lib/types/psShading.d.ts +1 -24
  116. package/dist-lib/types/resources.d.ts +2 -2
  117. package/dist-lib/types/strokeOutline.d.ts +32 -0
  118. package/dist-lib/types/svg.d.ts +236 -10
  119. package/dist-lib/types/svgFilterRaster.d.ts +28 -0
  120. package/dist-lib/types/svgFilterSubregion.d.ts +46 -0
  121. package/dist-lib/types/tableBorders.d.ts +33 -4
  122. package/dist-lib/types/types.d.ts +64 -4
  123. package/package.json +5 -1
  124. package/dist-lib/api-CQ3aOtc5.js.map +0 -1
  125. package/dist-lib/index.js.map +0 -1
  126. package/dist-lib/node.js.map +0 -1
package/CHANGELOG.en.md CHANGED
@@ -4,6 +4,101 @@
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
+
7
102
  ## 0.2.0 (2026-11-12)
8
103
 
9
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.
@@ -51,7 +146,7 @@ A release that adds flex features, WOFF/WOFF2, an API for loading referenced fil
51
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)
52
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)
53
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
54
- - Positions of absolutely positioned boxes (NC-28). **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)
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)
55
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
56
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>`)
57
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)
@@ -216,7 +311,7 @@ A release that adds flex features, WOFF/WOFF2, an API for loading referenced fil
216
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)
217
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
218
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)
219
- - 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; NC-28). **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
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
220
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)
221
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
222
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
package/CHANGELOG.md CHANGED
@@ -4,6 +4,101 @@
4
4
 
5
5
  版の番号は [セマンティック バージョニング](https://semver.org/lang/ja/) に従います。0.x の間は、互換の無い変更も minor の版 (0.2.0 など) で出すことがあります。
6
6
 
7
+ ## 0.3.0 (2026-11-16)
8
+
9
+ draw.io の図・画像の形式を足すプラグイン・PDF/X-4 などを足し、SVG の描ける範囲を広げた版。0.x の間なので、組版の結果が変わる修正も含めて minor の版にします。
10
+
11
+ - **draw.io の図**: draw.io (diagrams.net) の図のファイル (`.drawio`・`.dio`。圧縮したページも) を、既定で画像として読む。ページを SVG にして、PDF に図形と文字のまま入れる (書き方は `docs/drawio.md`)
12
+ - 描くページは、画像の参照の `#` の後ろで選ぶ: `#page=N` (1 から数える)・`#page-id=ID`・`#ページの名前`。無ければ最初のページ。無いページは、最初のページを描いて警告する。同じページになる `#` の参照は、描いた図を使い回す
13
+ - 形・線・矢印は、draw.io と mxGraph の公開のソースを移して描く: 標準の形、包みの形 (AWS・GCP・Cisco など)、draw.io が JavaScript で描く形 (約 750 種類)、線の曲げ方・跳び越し・太い矢印・線の端の形 34 種類、形ごとの文字の置き場、曲げた文字。影 (形・文字・図の全体)、ガラスの光沢、両端の不透明度の付いたグラデーション、手書き風 (`sketch`。rough.js)・ゆらした線 (`comic`)
14
+ - 図形ライブラリ (`mxgraph.*`) と図に埋め込んだ形 (`stencil(…)`) を描く。図形ライブラリは Kumiori に入れず、`drawio.stencils` (コマンドは `--drawio-stencils`) で渡すか、`drawio.fetchStencils` (コマンドは `--fetch-drawio-stencils`・`--drawio-stencils-url`) で取るのを許したときだけ使う (draw.io の配布物の `stencils.min.js` とライブラリの XML を読む)。SAP のアイコンの中の画像・クリップアートなどの配布物の画像も同じ。コマンドで取ったものは書体のキャッシュの場所に保存する
15
+ - API: `TypesetOptions.drawio` (型 `DrawioOptions`: `stencils`・`fetchStencils`・`stencilsUrl`・`provideStencils`。`false` なら draw.io の図を画像として読まない)。`DRAWIO_MIME`・`isDrawio`・`createDrawioStencilRegistry` (`provideStencils` で返す図形ライブラリの登録所 `DrawioStencilRegistry` を作る) と型を出す。コマンド: `--drawio-stencils`・`--fetch-drawio-stencils`・`--drawio-stencils-url`・`--no-drawio`。`--watch` は `.drawio`・`.dio` も見張る
16
+ - URL の画像は、文書の画像と同じ決まり (`resolveResource`・`fetchImages`) で取る。文字の幅は、Kumiori が描く書体で測る。`drawio` の選択肢を使い回す API の使い方でも、ある文書の決まりで取った画像を、別の文書には使わない。警告の文は `lang` (コマンドは `--lang`・環境) に従って日本語か英語で書く
17
+ - 図を描く処理 (rough.js を含む) は、draw.io の図が出てきたときだけ読み込む (CGM・EPS・WMF・EMF と同じ。画面とブラウザ向けのライブラリでは別のファイル)。依存に roughjs・pako を足した
18
+ - draw.io の `shapes/` の形 (`src/drawio/drawioJs/` など) は、draw.io が `shapes/` に利用の制限 (`shapes/LICENSE`。Atlassian の製品に使うこと。v29.3.2 から) を付ける前の v24.7.5 (Apache License 2.0 だけ) から移し、v24.7.5 の描き方にそろえる。
19
+ v24.7.5 より後に足された形は入れない: `mxgraph.archimate4.*` (36 種類)・`mxgraph.c4.mobileDeviceContainer`・`mxgraph.bpmn.task2`・`data2`・`conversation2`・`mxgraph.atlassian2.icon`・`mxgraph.networks2.icon`。これらの形は文字だけ描き、v24.7.5 より後の形なので描かないと警告する (図形ライブラリが無いという警告にはせず、取りにも行かない)。
20
+ 後から足された style のキー (色を変える `strokeColor2`・`fillColor2`・`bodyColor` など) も読まない
21
+ - 取ってくる図形ライブラリと配布物の画像の既定の版も v24.7.5 にする (CC BY 4.0)
22
+ - draw.io と mxGraph から移したファイルの先頭に、元のファイルの著作権表示と、変更したことを書く (Apache License 2.0 の 4 項)。ビルドした JavaScript の、draw.io の図の処理を取り込んだチャンクの先頭にも著作権表示を書く。元のファイルとその版・表示の一覧は THIRD_PARTY_NOTICES.md の 13 節。NOTICE にも draw.io と mxGraph から移したことを書いた
23
+ - 細工した図への強さ: 小さなファイルで時間・メモリを使い切る入力に上限がある (XML の閉じのタグ・宣言の読み飛ばし、経路の移動、`html=0` と placeholders のラベルの長さと図ごとの合計、図ごとの SVG の長さ (16Mi 字。約 1,678 万字)、線の跳び越しの交わり、埋め込んだ形の展開の大きさ、セルの座標と図の大きさ (1,000 万 px)、要素の入れ子の深さ)。上限を超えた部分は描かずに警告を出す (SVG の長さと図の大きさの上限を 1 つで超えるセルは、そのセルだけを描かず、図の残りは描く)。手書き風 (`sketch=1`) の塗りの斜線の数は、`style` の値 (`rackCabinet` の `unitNum`、ボタンの列の `textSize` など) でセルの枠より大きく描かれる形でも、描く要素の大きさで見積もり、大きさ (幅と高さの和) が 1,000 万 px を超える要素は手書き風にせずに描く。`,` で区切った項目を並べる形 (ボタンの列・メニュー・パンくず・タブ・円グラフなど 11 種) は、項目の数に比例する手間で描く
24
+ - **画面** (デモの Web アプリ): 設定に「draw.io の図」の欄を足した。「draw.io の図を読む」で、図を読む・読まないを選べる (既定は読む。選んだものはブラウザに覚える)。切ると、図を描く処理を読み込まず、開いている文書の画像を読み直して組み直す。欄の中で、draw.io の図形ライブラリのファイルを読み込む (ブラウザに覚える)・消す・図に要るときだけ draw.io から取る、を選べる。開くファイルと一緒に図形ライブラリ (`stencils.min.js`・ライブラリの XML) を渡すと、その画面の間だけ使う。`#` の後ろで図のページを指す参照 (`図.drawio#page=2`) の図も、設定を変えたときと、同じ画面で図のファイルを開き直したときに描き直す
25
+ - **プラグイン** (API の `plugins`・コマンドの `--plugin`・`--plugin-option`): 画像の形式を足すプラグインを渡せる (`KumioriPlugin`。受け口の版 `PLUGIN_API_VERSION` は 1)。形式は中身の判定 (`sniff`) と読み込み (`load`。SVG と大きさを返す) を持ち、Kumiori は SVG の画像として描く。`load` には、文字の幅を描く書体で測る道具・文書の画像と同じ決まりで取る道具・利用者がプラグインの選択肢で許した URL を取る道具 (`fetch`。時限は `fetchTimeoutMs`)・警告を出す道具と、警告の文の言語 (`lang`)、画像の参照の fragment (`#` の後ろ。`fragment`。1 つのファイルの中の、どの図・ページを描くか) が渡る。同じファイルを fragment の違う参照で指すと、参照ごとに読む (別の画像になる)。プラグインは Kumiori と同じ権限で動くので、信頼できるものだけを渡す。画面 (デモの Web アプリ) は、利用者の渡したプログラムを動かさない。コマンドの `--watch` は、プラグインの形式の拡張子のファイルも見張る
26
+ - コマンドの `--plugin` の探し方: `./`・`../` で始まるもの、絶対の道、`file:` の URL は、ファイルの道とみなす。それ以外は、`import()` と同じに、まずパッケージの名前として、`import()` と同じ条件 (`import`・`node`・`default`) で今のディレクトリから解決し (`@scope/name`・`name/sub`、`kp/dist/plugin.js`・`chart.js` のような拡張子で終わるものも。`exports` に `import` の条件しか無い ESM のパッケージも読める)、パッケージとして読めなければ (パッケージが無いときのほか、指したサブパスをそのパッケージが `exports` で出していないときや、パッケージの入口のファイルが無いときも)、今のディレクトリのその名前のファイルを読む (`--plugin myplugin.js`)。パッケージとして読めるときはパッケージを読む (今のディレクトリに同じ名前のファイル・ディレクトリがあっても、パッケージが先) ので、確実にファイルを指すには `./` を付ける。見つからないときは、何をどの順に探したかを誤りの文に書く
27
+ - 読めないプラグインを指したときは (`--watch` でも)、誤りの文だけを出して、終了コード 1 で終わる
28
+ - **PDF/X-4** (API の `pdfx: { version: 'X-4', profile }`・コマンドの `--pdfx x4 --output-profile <ICC>`): PDF/X-4 の印を出せるようにした (PDF/X-3:2003 も残す。既定は X-3)。X-4 は、出力の CMYK の ICC プロファイルの埋め込みが要り (無いか CMYK でなければ誤り)、XMP のメタデータ (`GTS_PDFXVersion`・日付・題・`Trapped`・ID) を Info と合わせて書き (ISO 32000-2 §14.3.2)、透明はそのまま出して PDF 1.6 で書く。コマンドの `--pdfx x3|x4`・`--output-profile`・`--output-condition` (印刷条件の名前。既定 JC200103) を足した。PDF/X の規格 (ISO 15930-6・-7) の本文では確かめていない
29
+ - **PDF/X の出力の変わる所** (X-3・X-4 の両方。PDF/X でない出力は変わらない。字・線・画像の位置も変わらない): ページには TrimBox だけを書く (ArtBox は書かない)。**ページの中のリンク・注釈・フォームの欄は書かない** (塗り足しまでの範囲 (BleedBox) と少しでも重なるものを書かずに、件数を警告に出す。BleedBox はページの絵柄の全体を囲むので、目次などの内部のリンクも外の URL へのリンクも、ページの中のものはほぼ全部が無くなる。0.2.0 の PDF/X-3 では書いていた。しおりは注釈ではないので、そのまま書く。画面で読むための PDF は、PDF/X にせずに書き出す)。題が無ければ Untitled にする。入稿の仕様 GWG 2022-R1 の推奨に合わせ、灰色 (R = G = B) の字・線・塗りを K だけの CMYK で書き (灰色の画像は DeviceGray のまま)、本文 (ページの余白の字も) の K 100% の 12pt 未満の字と 2pt 未満の線・罫線にノセ (OP・op・OPM 1。ISO 32000-2 §8.6.7) を付ける (図 (SVG・EPS など) の中の字・線には付けない)。GWG 2022-R1 の要件のうち、ページの仕上がりの大きさの違い (R0004)・特色 (R0020)・画像の解像度 (R0031。149ppi 以下は要る、224ppi 以下は勧める) を調べて警告に出す (出力は変えない)
30
+ - **SVG** (組版の結果が変わる: これまで描けずにラスタライズ・仮の枠にしていた SVG を、図形で描く):
31
+ - `<style>` の結合子 (子孫・子・隣接・後続)・属性・疑似クラスの選択子を当てる (Selectors 4。HTML と同じ照合)
32
+ - text: `font-style` (斜体の書体が無ければ立体を傾ける)、字ごとの `x`・`y`・`dx`・`dy`・`rotate` の並び、`baseline-shift`、`dominant-baseline`・`alignment-baseline`、`word-spacing`、`paint-order`
33
+ - `clipPathUnits`・`maskContentUnits` の `objectBoundingBox`、image の `preserveAspectRatio` の `slice`、外のファイルを指す image (文書のファイルの PNG・JPEG。無ければその image だけを描かず、警告に出す)
34
+ - pattern の中身のグラデーション・不透明度・切り抜き・描画モード・入れ子の模様、`mix-blend-mode` の 15 通りの値
35
+ - switch と条件の属性の `systemLanguage`。画像を置いた所の言語 (`lang`・`xml:lang`・`language`) で照らす (言語の指定が無ければ実行環境の言語)。switch の外の要素も、条件が満たされなければ描かない
36
+ - Node (コマンドと API) の filter の近似に、`feColorMatrix`・`feComponentTransfer` (図形の色を変える)、`feComposite`・`feBlend` (16 通りの描画モード) の重ねを足した (Figma の書き出す影も描く)。filter の結果は filter の領域で切り抜く。filter の要素に部分領域 (`x`・`y`・`width`・`height`。Filter Effects 1 §9.4) を書いたものは、要素の結果をその部分領域で切り抜く (前は読まずに、部分領域の外も描いていた。ぼかした結果を切るものは、画素で計算する)
37
+ - `opacity` の要素・`mix-blend-mode` の付いた `g` など・`isolation: isolate` の要素を、子をまとめた透明のグループで描く (前は子ごとに不透明度を掛けたので、重なった所が濃くなり、塗りと線のある図形では線の下の塗りが透けていた)。`visibility` を受け継ぎ、`visible` に戻した子は描く (前は `hidden` の要素の子を丸ごと描かなかった)
38
+ - CSS の書き方: 単位の付いた `transform` (`rotate(45deg)` など)、`style`・`<style>` の `transform`・`transform-origin`・`transform-box`、`var()`・`calc()`、`clip-path` の基本図形 (`circle()`・`inset()`・`polygon()`・`path()` など) と参照の箱、`<style>` の `@media` (印刷の画面として照らす)
39
+ - use で外のファイルの要素 (`icons.svg#a`) を描く (見つからなければ警告に出す)。`a` のリンクを PDF のリンクにする
40
+ - text: tspan の `letter-spacing`・`word-spacing`・`text-decoration`、textPath の `side`・`baseline-shift`、`@font-face` の `font-weight`・`font-style`、縦書き (`writing-mode`・`text-orientation`。字の向きと縦書き用の字形は本文の縦書きと同じ決め方)
41
+ - mask の `mask-type: alpha`・マスクの領域・入れ子のマスク (前は内側だけが効いた)、`context-fill`・`context-stroke`、image の GIF・BMP・WebP
42
+ - text: tspan の `textLength`、縦書きの `textLength`・`text-decoration`、SVG 2 の `inline-size` (自動の折り返し)、SVG フォント (`font` 要素の字形)
43
+ - Node (コマンドと API) で、図形で近似できない filter (`feTurbulence`・`feMorphology`・`feDiffuseLighting`・`feSpecularLighting`・`feDisplacementMap`・`feConvolveMatrix`・`feImage`・`feTile`・`feComposite` の `arithmetic`、図形で描けない `feComposite` の `in`・`out`・`atop` (内側の影など) など) を、画素で計算して画像にする (Filter Effects 1 のとおり。前は仮の枠)
44
+ - foreignObject の中身 (HTML・MathML) を、本文と同じ HTML の組版で組んで描く (背景・罫線・表・画像・数式も。前は仮の枠)。中身には、SVG の `<style>` の規則 (SVG の祖先の id・class を使う `#id p` のような選択子も) と、SVG の祖先から受け継ぐ書式 (`font-family`・`font-size`・`font-weight`・`font-style`・`color`・`letter-spacing`・`word-spacing`・`visibility`) を当てる (SVG 2 §23.2・CSS 2.1 §6.2)。本文の既定のスタイル (`--style`・`style`) と、本文に当てる CSS のファイル (`--css`・`files` の、文書から参照しない CSS) は掛けず、ブラウザの既定のスタイルで組む。組んだ中身が foreignObject の枠の中に何も描かないとき (中身が枠の外に出たときなど) は、警告を出して、文字だけを近似して描く。API で組まないとき (`renderPdf` を直に使うときなど) は、HTML の文字だけを近似して描く
45
+ - 点の多い clipPath を多くの図形に付けた SVG (地図など) を、図形で描く。前は図形ごとに切り抜きの形を書き直し、線分の予算を超えて仮の枠になっていた。続く図形で同じ切り抜きは 1 度だけ書く (ISO 32000-2 §8.4.2・§8.5.4)
46
+ - API の `svgLanguages`・コマンドの `--svg-lang`: SVG の `systemLanguage` を照らす言語 (SVG を置いた所に言語の指定が無いとき)
47
+ - **書体**: 記号の書体 (Noto Sans Symbols 2) にも無い絵文字 (😀 などの顔・国旗・肌の色の指定など) が文書にあるときは、絵文字の書体 Noto Emoji (単色の輪郭の絵文字。SIL Open Font License 1.1。約 870KB) を読み込む。前は、既定の書体に絵文字の書体が無く、その字は字形の無い字の形 (豆腐) で組まれ、「読み込んだどの書体にも字形の無い字があります」の警告が出ていた。**組版の結果が変わる**のは、その絵文字を含む文書だけ (記号の書体が持つ ✈・❤ などは、これまでどおり記号の書体で組む)。色つきの絵文字にするには、これまでどおり Noto Color Emoji などの書体を渡す。`DEFAULT_FONTS` に `emoji` を足した
48
+ - **XSL-FO の `word-spacing` の `.minimum`・`.maximum`** (仕様モードだけ): 読むようにした (前は未対応として警告に出していた)。両端揃えで組む行で、語間を `.minimum` の幅まで縮めて字・語を収め、広げるときは `.maximum` の幅までにする (XSL 1.1 §7.17.8: “The minimum and maximum values specify the limits of the adjustment.”。§5.11 の `<space>`)。互換モードは今までどおり読まずに警告に出す
49
+ - **PDF を書く途中の警告**: 描けない字・色つきの字形の上限・SVG の表の字形・作れないフォームの欄などの知らせを、`result.toPdf()` の後に `result.warnings` に足す (前は console に出るだけか、`warnings` を作った後に出ていた)。描けない字の知らせは書体ごとに 1 度にする。警告の言語は、組んだときの `lang` に従う。画面も警告の一覧に出す
50
+ - **警告の文**: `lang: 'en'` (コマンドは `--lang en`) でも日本語のままだった警告を英語で書く: 画像の警告 3 つ (`画像 … を描けないため、仮の枠で描きます`・`画像 … の一部を描けません`・`画像 … が見つからないか、中身を画像として読めません`) と、読めない画像の仮の枠の理由、未対応の CSS・XSL-FO の通知の、項目に添えた理由 (`--style ah のときだけ解釈する値`・`単位 xx (長さ …)` など) と並びの区切り、PDF/X の透明と ICC プロファイルの警告、組版の溢れの警告 (ページに収まらない行・箱・float・脚注・表の行など)、字形の無い字の並びの区切り、EPUB の読み込みの誤り、入れ子の深すぎる変換の誤り、画像の形式の中の知らせ (CGM・WMF・EMF の描けない要素と上限、EPS の描けない機能の名前)、Area Tree の JSON を読むときの誤り (`parseAreaTree`)、書体と画像の中身の誤り (CFF・WebP・PNG)
51
+ - **脆弱性の報告**: 脆弱性を見つけたときの、非公開の報告の手順 (`SECURITY.md`・`SECURITY.en.md`) を足し、README の「脆弱性の報告」の節から案内する
52
+ - **flex**: 項目の幅 (中身の幅 max-content の見積もり) に、和字と欧文の字・数字の間の和欧間アキ (`text-autospace`。CSS Text 4 §8.4) を足す。**組版の結果が変わる**: 目次の行を項目名・リーダー・ページ番号の flex で組むとき、「ecoモードの使い方」のような和欧の混じる項目名の最後の字が、次の行に送られなくなった (前は見積もりにアキが無く、組んだ行が項目の幅に入りきらなかった)
53
+ - **flex**: 幅の指定の無い項目 (`flex-basis`・`width` が `auto` か中身の大きさの語) の幅を、組むときに中身を組んで測る (Flexbox 1 §9.2 の 3 の E。これまでは読み込みのときに字の幅を足して見積もり、ページ番号の引用を持つ項目だけを組むときに測っていた)。行が入りきらなければ、組むときに `flex-shrink` の比で縮め直す (§9.7。`min-width: auto` の下限の中身の最も狭い幅も、組むときに測る)。**組版の結果が変わる**: 目次の行を項目名・リーダー・ページ番号の flex で組むとき、見積もりが組んだ行より狭く、項目名の最後の語・字が次の行に送られていた次の場合を直した: 要素の間の空白 (`<b>1.2</b> <b>概要</b>`)・行内の要素の左右の余白・枠・内側の余白、子孫の `::before`・`::after` の中身 (カウンターの章番号など)、項目そのものの `::before`・`::after`、`word-spacing`、`inline-block` の幅と余白、上付きの字と隣の語の間の空白、子の要素の `letter-spacing`。`justify-content: space-between` と `flex-wrap: wrap` の行・`flex: auto` の項目も同じ。画像の `-ah-image-resolution` で決まる幅・表を中に持つ項目の幅も、組んだ大きさになる (前は本来の大きさ・見積もりの幅で、表が項目からはみ出していた)。中身の幅で決まる箱 (flex の項目・表のセルなど) の中にある横並びの flex の容器の中身の幅 (max-content・min-content) は、項目の中身の幅の和で測る (Flexbox 1 §9.9.1)
54
+ - **flex**: 縦並び (`flex-direction: column`) の容器の、行内の要素 (`span` など)・直下の文字の並び・`::before`・`::after` の項目をブロック化する (Flexbox 1 §4・CSS Display 3 §2.7)。**組版の結果が変わる**: 前は項目が縦に積まれず、横に 1 行に並んでいた
55
+ - **flex**: 項目の中身の幅の見積もり (`flex-wrap` の行分けの目安・縦並びの容器で寄せる項目の箱の幅) に、要素の間の空白・行内の箱の左右の余白と枠と内側の余白・`::before`・`::after` の中身・`word-spacing`・`inline-block` の幅を数える。目次の項目名で調べた書き方では、組んだ幅と 0.02pt 以内で一致する
56
+ - **flex**: 行内の要素 (`span`・`a` など) の項目の罫線・内側の余白・背景を、項目の箱にだけ付ける (項目はブロック化する。Flexbox 1 §4・CSS Display 3 §2.7)。**組版の結果が変わる**: 罫線・内側の余白のある `span` の項目が、和字だけの短い中身でも最後の字を次の行に送られていたのを直した。罫線も二重に描かなくなった (前は、中身の行内の箱にも同じ罫線・内側の余白を付けていた)
57
+ - **HTML の空白**: 行内の要素の端の空白を消さない (CSS Text 3 §4.1.1・§4.1.2)。**組版の結果が変わる**: 前は「`word <b>bold </b>word`」が「boldword」、「`Over<b> B </b>view`」が「OverBview」になり、中身の空の要素の `::before`・`::after` の端の空白も消えていた (目次の章番号「第1章 」の後ろの空白など)。英語と日本語の混ざる項目名を要素で分けたとき (`<b>eco </b>モード`) にも当たっていた。行内の要素の境目をまたいで重なる空白は 1 つに詰め、行の頭・終わりの空白は消す。和文では、改行を空白にするか消すかも、行内の要素の境目をまたいだ前後の字で決め、前後が和文の改行は消す (CSS Text 3 §4.1.3・§1.5)。タグのすぐ内側の改行 (`これは<b>\n強調\n</b>です`) は 0.2.0 と同じに「これは強調です」になり、**組版の結果が変わる**: 0.2.0 で空白が入っていた、タグのすぐ外側の改行 (`これは\n<b>強調</b>\nです`) も、空白が入らなくなる。前後のどちらかが欧文なら、これまでどおり空白にする。改行・画像・inline-block・ルビ・ブロックの境目はまたがない
58
+ - **HTML の、行内の要素の中のブロック** (どのスタイルでも。**組版の結果が変わる**): `<span><p>…</p></span>`・`<a><div>…</div></a>` (カードのリンクなど)・`<b><div>`・`<span><ul>`・`<span><table>`・`<label><div>`、行内の要素の中の `display: block` の要素などの、中のブロックを組む (CSS 2.1 §9.2.1.1 のブロックを含む行内の箱)。行内の箱をブロックの前後で分け、ブロックはブロックとして、前後の行内の中身はその前と後ろの行に組む。行内の要素の字の書式 (色・書体・太さなど) とリンクは中のブロックにも当て、分けた所の辺には罫線・内側の余白を付けない。前は、中のブロックの中身が警告なしで消え、その中の見出しのしおりの飛び先も無くなっていた (Mermaid 10 以降の flowchart のラベル `<span class="nodeLabel"><p>…</p></span>` も、この形)。行内の箱の中に残って置けないブロックがあれば、警告に出す。`display: inline-flex`・`inline-grid` の要素は行内水準の箱 (Flexbox 1 §3・CSS Grid 1 §5.1) なので、その中のブロックの項目 (`<a style="display: inline-flex"><div>…</div><div>…</div></a>` のような、アイコンとラベルを `div` で書いたボタン・リンクなど) では、外の段落の行を分けない。ブロックの項目 (中にブロックを持つ行内の要素の項目も) は、行の中の分けられない箱 (`inline-block` と同じ。幅は中身の幅) にして横に並べる (前は、項目の字が消えていた)。そうした容器の直下の、続いた文字の並びも 1 つの項目として同じ箱にし、空白だけの並び (項目の間・容器の頭と終わりの改行と字下げ) は、`white-space` に関わらず組まない (Flexbox 1 §4・CSS Grid 1 §6)。行内の要素だけの項目は、これまでどおり行の中に組む。どちらも、行内の flex・grid の容器としては組まないので、項目の間の空き (`gap`)・縦並び (`flex-direction: column`)・揃え (`align-items`・`justify-content`)・grid の列 (`grid-template-columns`) は効かない (項目は行の基線で揃う)
59
+ - **CSS の `content` の文字列の、制御文字のエスケープ** (HTML のどのスタイルでも。**組版の結果が変わる**): `::before`・`::after` の `content` の `\A` (改行)・`\9` (タブ) などの制御文字のエスケープが、字「n」「t」になっていた (`content: "X\A Y"` が「XnY」。0.1.0 から)。計算値を CSS の文字列の書き方 (CSSOM §2.1 の serialize a string。`"X\a Y"`) で作るようにした。あわせて、生成した内容の文字列も文書の字と同じに `white-space` で扱うようにした (CSS 2.1 §12.2・CSS Text 3 §4.1): 改行は、`pre`・`pre-wrap`・`pre-line`・`break-spaces` なら強制改行、`normal`・`nowrap` なら文書の中の改行と同じ決まりで空白にするか消す (前後が和文なら消す)。タブは `normal` なら空白、CR (`\D`) は空白と同じ。ページの余白の箱の `content` も、箱の `white-space` で同じに扱う (前は、余白の箱の `\A` は `white-space` に関わらず改行していた)。このため、余白の箱の `content` の続いた空白も、`white-space` が `normal` (既定) なら 1 つに詰める (CSS Text 3 §4.1.1。前は、余白の箱では続いた空白を残していた)。**組版の結果が変わる**: `content: counter(page) " | " string(chapter)` の空白 2 つは 1 つになる。空白を残すには、U+00A0 (`\A0`) か U+3000 を使うか、余白の箱に `white-space: pre` を書く。`\"`・`\\`・`\2014`・`\000041 B` などの、ほかのエスケープは変わらない。また、文字列の中の「`\`」と改行 (文字列を次の行へ続ける書き方。CSS Syntax 3 §4.3.5) を、何も足さずに読み捨てるようにした (前は「`\`」と改行が残った。CRLF も 1 つの改行として読む)。16 進のエスケープの後ろで読み捨てる空白は、CSS の空白 (空白・タブ・改行) だけにした (前は `\25A0` の後ろの U+3000・U+00A0 も読み捨てていた)
60
+ - **HTML の、同じ性質を 2 度書いたときの印刷の色** (**組版の結果が変わる**): 同じ規則の中で、後に書いた印刷の色の宣言が勝つようにした (CSS Cascade 4 §6.1)。前は、前に同じ性質の宣言があると、後の `rgb-icc()`・`cmyk()`・`device-cmyk()` の宣言を退け、前の色のままにしていた (`.r { color: #00f; color: rgb-icc(255,0,0,#CMYK,0,1,1,0) }` が `--style ah` でも青になった)。`--style ah` では `rgb-icc()`・`cmyk()` も色として読むので後の宣言が勝ち、`device-cmyk()` (CSS Color 5 §12.1) はどのスタイルでも勝つ。`--style ah` 以外のスタイルでは、これまでどおり `rgb-icc()`・`cmyk()` を無効の値として捨て (警告に出す)、前の宣言の色が残る。`style` 属性の中でも、同じ性質の宣言は後の宣言が勝つ (前は、後に書いた画面の色 `color: #00f` より、前に書いた印刷の色が勝っていた)。『CSSページ組版入門』第 4 版 (`--style ah`、特色の値を渡したとき) では、罫線の見本 (`.BorderSample`) の罫線の色が、RGB の緑から見本と同じ特色 (PANTONE 627 PC) になる
61
+ - **和欧間のアキの相手の字** (HTML の既定のスタイル。**組版の結果が変わる**): `text-autospace` のアキを、CSS Text 4 §8.4.1 の定義どおり、和字と、Unicode の一般カテゴリ L・M の字 (ラテン文字のほか、ギリシャ・キリル・アラビア・ヘブライ・インド系・タイの字など。1 字でも) と Nd の数字 (アラビア・インドの数字も) の間に入れる。これまではラテン文字・数字と、2 字以上続くギリシャ文字・キリル文字の語だけだった。East Asian Width が W・F の字 (ハングル・全角の英数字)・記号・句読点、縦書きで正立にする字 (`text-orientation: upright`) の前後には入れない。字の種類は字の単位 (書記素クラスタ) の基底の字で決める。右から左の字との間のアキは、並べ替えた後の見た目の境目に入れる (§8.4.2)。互換の指定 (`--style ah`・`vivliostyle`・`weasyprint`) と XSL-FO の `axf:text-autospace` は、これまでどおり (見本で確かめられないため。『CSSページ組版入門』第 4 版には、和字とギリシャ文字などが本文で隣り合う所が無い)。
62
+ - **高さ・幅を指定したページの余白の箱の位置** (HTML の全スタイル。**組版の結果が変わる**): CSS Paged Media 3 §5.3.3 どおり、高さを指定した上下の箱・幅を指定した左右の箱 (と隅の箱) は、margin が決まりすぎのときページの端の側の margin を auto として、本文の側に寄せる (margin が両方 auto なら真ん中)。これまでは vertical-align で箱の位置を決め、既定は真ん中だった。vertical-align は箱の中の中身の縦の揃えだけにする (§6.3)。指定した `height`・`width` は中身の大きさとし、罫線と内側の余白を足した箱にする (`box-sizing: border-box` なら含めた大きさ)。WeasyPrint の見本との組み比べで見つかったもの (WeasyPrint 65.1 も §5.3.3 どおり)。
63
+ - **区切りを避ける値の伝わり方** (HTML。**組版の結果が変わる**): 箱の最初の子の `break-before` と最後の子の `break-after` の避ける値 (`avoid`・`avoid-page`・`avoid-column`) を、強制の区切りと同じに、親の箱の前・後ろの区切りに伝える (CSS Fragmentation 3 §3.1.1。入れ子の奥の子からもたどる)。前は強制の区切り (`page` など) だけを伝え、避ける値は隣り合う兄弟の間だけで見たので、`<section><h2 style="break-before: avoid">` の section とその前の段落の間で改ページした。同じ所に強制の区切りがあれば、強制の区切りが勝つ (§4.3。避ける値は伝えず、箱自身の避ける値も外す)。`avoid-column` は段組の容器の手前で止まる (§3.1.1)。リストを表にして組む所 (項目の最初・最後の子の値を、項目の行とリストの前後に合わせる) と、記号の無いリスト (ふつうのブロックの並びにする所) も同じに扱う。flex・grid の容器と表の行には、まだ伝えない。XSL-FO の keep は変えない。『CSSページ組版入門』第 4 版 (`--style ah`) と対応仕様説明書 4 冊の組み上がりは変わらない (目次の `.TOC li.TocLevel1 > ul` の `break-before` を利用者のスタイルシートで `auto` に戻すと、前は「第5章」の行と 5.1 の間で改ページしたが、`li.TocLevel2:first-child` の `avoid-page` が伝わり、「第5章」を次のページへ送る)
64
+ - **罫線をつぶした表の、太さの違う罫線の置き方** (XSL-FO のどのモードでも、HTML の `border-collapse: collapse` の表も。**組版の結果が変わる**): 表に罫線の無い辺で、表の外周の罫線をセルが持つとき、太さの違う線 (5pt と 15pt など) の中心をそろえ、グリッド線 (表の端) を中心に置く。前は、細い線を辺のいちばん太い線の外の縁にそろえたので、細い線とそのセルの中身がグリッド線より外 (余白の側) へ出ていた。XSL-FO の互換モード (`--compat antenna`) の内側の線 (後ろのセルが持つ線) も、同じ線の上で太さが違えば中心をそろえる (前は、細い線を後ろのセルの箱の縁にそろえていた)。セルの中身は、グリッド線から自分の線の太さの半分の内側に置く。CSS 2.1 §17.6.2 (罫線はセルの間のグリッド線を中心に置く)・XSL 1.1 §6.7.10・§7.28.3 による。アンテナハウスの見本 (サンプル FO 集の `table-border-conflict-resolution-1`) も中心をそろえる。セルの背景は、ずらした線の外の縁から塗る。Area Tree の版を 3 に上げた (`collapse.paintWidth` が `width` より小さい辺を足した。版 1・2 の木も読める)。サンプル FO 集で変わるのは 4 つの見本 (`table-border-conflict-resolution-1`・`table-omit-header-footer-1`・`table-within-page-1`・`axf-form-field-event-1`)、対応仕様説明書は HTML と CSS 編の `border-collapse` の例の 1 ページ (日本語版 93・英語版 97 ページ) だけ。列の幅の決め方 (列の指定の無い `table-layout="fixed"` の表) は、次の項目で直した
65
+ - **列の指定の無い固定の列幅の、罫線をつぶした表の列の幅** (XSL-FO のどのモードでも、HTML の `--style ah` (アンテナハウス互換) の `table-layout: fixed`・`border-collapse: collapse` の表も。**組版の結果が変わる**): 幅の指定の無い列は、1 行目のセルの罫線を除いた幅 (中身と padding の幅) が等しくなるように、表の幅を配る。前は、外へはみ出す罫線の半分まで含めた列の箱を等分したので、太い罫線のある列ほど中身が狭く、外周の列は太い罫線の分だけ狭かった。CSS 2.1 §17.5.2.1 (XSL 1.1 §7.28.16 の `table-layout="fixed"` が引く) の「残りの列は、残りの表の幅を (罫線・セルの間隔を除いて) 等しく分ける」による。固定の列幅は 1 行目のセルだけを見るので、除く罫線は 1 行目のセルの罫線。アンテナハウスの見本 (サンプル FO 集の `table-border-conflict-resolution-1`。1 行目の罫線 5・10・5・5・15pt の 5 列の表) も、5 列とも中身の幅が約 86.4pt で等しい。この見本は、15pt のセルの字が 2 行に折れなくなり、見本と同じ 2 ページになる。サンプル FO 集で変わるのは、仕様モードで 5 つ、互換モード (`--compat antenna`) で 9 つの見本 (どれも見本との差が減るか、0.01% の単位で同じ)。対応仕様説明書 (4 冊) は変わらない。HTML のほかのスタイル (`kumiori`・`browser`・`browser-margin`・`vivliostyle`・`weasyprint`) は、これまでどおり列の箱を等分する (同じ文の「罫線・セルの間隔」を、表の罫線とセルの間隔と読む。ブラウザ (Chromium) も列の箱を等分する)
66
+ - **罫線をつぶした表の、表の端の列の幅の指定** (XSL-FO のどのモードでも、HTML の `table-layout: fixed`・`border-collapse: collapse` の表も。**組版の結果が変わる**): 列の幅の指定 (`column-width`・`col` の `width`) は、表の端の列も含めて、グリッド線の間の幅にする。前は、仕様モードでは表の始めと終わりの端の列が、外へ出る罫線の半分だけ狭く (表が外周の罫線を持つときは、表の罫線の内側の半分だけ広く)、互換モード (`--compat antenna`) では最後の列が外周の線の太さだけ狭かった (内側の線の太さが列ごとに違うときは、内側の列もずれた)。表の幅は外周のグリッド線の間 (CSS 2.1 §17.6.2 の row-width) なので、列の幅の指定の和が表の幅になる。アンテナハウスの見本 (サンプル FO 集の `axf-form-field-event-1`: 30・30・30・40mm の 4 列) も、端の列も最後の列もグリッド線の間が指定の幅。中身から列の幅を決める自動レイアウトの表は変えない。サンプル FO 集で変わるのは、仕様モードで 10、互換モードで 9 の見本 (互換モードの `table-spanned-1` は見本との差が 0.39% から 0.02% に、`table-within-page-1` は表の右端の線が見本と同じ位置になる)。対応仕様説明書は、XSL-FO 編の 2 ページ (日本語版 43・71、英語版 46・74) と HTML と CSS 編の 1 ページ (日本語版 94、英語版 97) で、表の線と字が 1 画素ほど動く。『CSSページ組版入門』は変わらない
67
+ - **罫線を分ける表の、列の指定の無い固定の列幅** (XSL-FO の `border-collapse="separate"` の表 (どのモードでも) と、HTML の `--style ah` (アンテナハウス互換) の `table-layout: fixed`・`border-collapse: separate` の表。**組版の結果が変わる**): 幅の指定の無い列は、罫線をつぶした表 (上の「列の指定の無い固定の列幅の、罫線をつぶした表の列の幅」) と同じく、1 行目のセルの罫線を除いた幅が等しくなるように配る (CSS 2.1 §17.5.2.1)。前は、セルの罫線を含めた箱を等分した。HTML のほかのスタイルは、これまでどおり (ブラウザ (Chromium) と同じく) セルの箱を等分する。サンプル FO 集・対応仕様説明書・『CSSページ組版入門』には、この表が無く、変わらない
68
+ - **XSL-FO の、行の向きの大きさの指定の無い直交する `fo:block-container`** (どのモードでも。**組版の結果が変わる**): 横書きの本文の中の `writing-mode="tb-rl"` など、書字方向が親と直交し `inline-progression-dimension` (縦書きなら高さ) の指定の無いコンテナは、行の長さを本文の幅にしていたので、箱がページの高さを超えて次のページへ送られ、下へはみ出して字が切れた。XSL 1.1 §6.5.3 は、この大きさを auto にしてはならないとし、組み方を決めていない (§7.15.7 の auto は「ほかの制約を考えに入れて組版ソフトが決める」) ので、直交するブロック (BACKLOG の E-16) と同じに、行の長さをページの残りの高さ (次のページからはページの高さ) にし、親の幅まで行を積み、入りきらない行は次のページへ続ける。1 ページに収まる箱は、これまでどおり親の幅いっぱい。90°・270° 回した、寸法の指定の無い枠 (罫線・padding) つきのコンテナも、これまでは 1 つの箱にして、局所の block の向きに本文の幅を超えて積んだ行が箱の外へはみ出したので、枠の無いコンテナと同じに、本文の幅まで積み、続きは次のページへ送る (枠の切れ目は、ブロックの断片と同じに `conditionality` で決める)
69
+ - **XSL-FO の仕様モード (`--compat spec`・`compat: 'spec'`。既定) の両端揃えの行の語間** (**組版の結果が変わる**): 両端揃えで組む行 (`text-align="justify"` の段落の途中の行と、`text-align-last="justify"` の行) でも、欧文の語間 (空白) を詰めて字・語を行に追い込むのをやめた。空白は本来の幅より狭くせず、詰めれば入っていた語は次の行へ送り、行は語間を広げて埋める (前は、空白を 1/3 まで詰めて、行に 1 語多く入れることがあった)。XSL 1.1 §7.17.8 で、`word-spacing="normal"` と長さの語間は `.minimum = .optimum` (縮める幅が無い) のため。0.2.0 で両端揃えでない行の語間を詰めなくしたことの続き。行が増える段落があり、ページの切れ目が動くことがある (対応仕様説明書の XSL-FO 編の英語版は 102 → 104 ページ)。約物 (読点・括弧) のアキの追込み、和欧間の四分アキの詰め (`axf:text-autospace` を指定した文書)、互換モード (`--compat antenna`)、HTML の結果は変わらない。`axf:text-justify-trim` の `inter-word` を指定した段落は、今までどおり語間を詰める
70
+ - **XSL-FO の脚注の区切り** (どのモードでも。**組版の結果が変わる**): `flow-name="xsl-footnote-separator"` の `fo:static-content` があれば、いつもその中身を組んで、脚注の領域の初めに置く。XSL 1.1 §6.12.1.3 で、区切りは、この static-content を組んで返る領域で、既定の区切り線は無いため。0.2.0 から変わること:
71
+ - 罫線を `border-after-style`・`border-bottom-style`・`border-style` などで書いた区切りと、アキ (`padding-before`・高さのある `fo:block-container` など) だけの区切りを、書いたとおりに組む。前は、中身が無いとみなして、Kumiori の既定の区切り線 (本文の幅の 1/3 の実線) で代用し、「既定書式で代用しました」と知らせていた
72
+ - 中身が空 (字・`fo:leader`・画像・背景・罫線・アキのどれも無い。空のブロックだけなど) のときは、何も描かず、場所も取らない (static-content が無いときと同じ)。前は、同じく既定の区切り線で代用していた
73
+ - 区切りの先頭のブロック (前側に罫線・内側の余白の無いブロックの中の、先頭のブロックも) の `space-before` は、脚注の参照領域の始めなので 0 にする (XSL 1.1 §4.3.1。`space-before.conditionality="retain"` のものと、`margin-top` などから来るものは残す)。**中身のある区切りでも、先頭に `space-before` を書いていれば、脚注の領域がその分だけ低くなり、区切りの位置が変わる** (本文の入る量が変わることもある)。前は、その空きを区切りの上に残していた
74
+ - **XSL-FO の字下げの受け継ぎ** (仕様モードだけ。**組版の結果が変わる**): 表のセルの中と、リストのラベル・本体の中の start-indent・end-indent を、XSL 1.1 どおりに受け継ぐ (§5.3.2・§7.11.7・§7.11.8)。(1) セルの中の指定の無いブロックも、表 (と、行グループ・行・セルに書いた値) の字下げを受け継ぎ、セルの内容の端からその分だけ下がる (前はセルの端に置いた)。(2) ラベル・本体は参照領域ではない (§6.8.4・§6.8.5) ので、中で長さで書いた start-indent は、リストと同じ参照領域の端から測る (前は本体の始端から測った)。(3) start-indent・end-indent の `from-parent()`・`inherited-property-value()` を読む (§5.10.4。前は読まずに警告に出した)。(4) margin-left・margin-right だけを書いた block-container の中へ受け継ぐ字下げに、外から受け継いだ値も足す (§5.3.2。前は margin・border・padding だけだった)。互換モード (`--compat antenna`) は従来どおり。どちらのモードでも、入れ子のリストのラベルの start-indent が `label-end()` の位置より後ろにあるとき、ラベルの幅が 0 になって字が縦に割れていたのを直した (ラベルの終端を、本体の始端から provisional-label-separation だけ手前にする)。確かめる見本は `samples/check/fo/indent-inheritance-1.fo`
75
+ - **段組の釣り合わせの、段の長さの許し** (HTML と XSL-FO の段組。**組版の結果が変わる**): 「1 段目をいちばん長くし、後の段ほど短くする」ために段の高さを伸ばすのは、後ろの段が前の段より段組の箱の 1em 以上長いときだけにした (前は 0.5pt を超えれば伸ばしていた)。差が 1em 未満なら、同じ高さとみてそのまま組む。アンテナハウスのサンプル FO 集の graphics-cgm-1 の 2 段の画像の比べ (2 段目の画像の箱が 1.24pt 高い) が、見出しを 1 段目へ引き取らずに見本と同じ並びになり、3 ページから見本と同じ 2 ページになる。CSS-Print 第 4 版とほかの段組の見本は変わらない
76
+ - **アンテナハウス互換の、行がページに入るかの判定** (HTML の `--style ah` と XSL-FO の `--compat antenna`。**組版の結果が変わる**): 行の下端が、脚注の分を引いた本文の下端を 0.05pt まで越えても、その行をそのページに置く (前は計算の誤差の 0.01pt まで)。見本の PDF に合わせた (『CSSページ組版入門』第 4 版の 75 ページの図のキャプションは、約 0.03pt 越えるがそのページに置かれる。Kumiori は次のページへ送っていた)。CSS-Print で変わるのは 75・76 ページだけ (どちらも見本に近づく)。XSL-FO の見本 151 は変わらない
77
+ - **行グリッドの段組の中の段組フロート** (HTML。**組版の結果が変わる**): `-ah-baseline-grid` が `new`・`root` の段組の中の `float: multicol top` の箱の中身は、表のセルと同じに行グリッドの領域にし、最初の行の前と最後の行の後ろに半行間を付けない (`new` なら em の箱を積む)。フロートの下の段の本文は、段組の箱の内容の上端から引いた行グリッドに載せる (前は、フロートの下端から格子を引き直していた)。アンテナハウスの見本に合わせた (『CSSページ組版入門』第 4 版の 9.3.6 の段組フロートの箱は 30pt → 22pt で見本と同じ)。一部の段だけをまたぐ置き方は未対応 (`docs/BACKLOG.md` の E-21)
78
+ - **行グリッドの表の見出し** (HTML。**組版の結果が変わる**): `-ah-baseline-grid` が `new`・`root` の表の見出し (`caption`) も、セルと同じに行グリッドの領域にし、最初の行の前と最後の行の後ろに半行間を付けない (`new` なら em の箱を積む)。アンテナハウスの見本に合わせた (『CSSページ組版入門』第 4 版の `table { line-height: 21q; -ah-baseline-grid: new }` の表の見出しは、上下に半行間を空けない。10.2 の表は、見出しと表がそれぞれ 3.2pt 下にずれていた)
79
+ - **`--style ah` の見出しの後ろの改ページ** (HTML。**組版の結果が変わる**): 既定のスタイル (CSS 2.1 付録 D) に、`@media print` の `h1, h2, h3, h4, h5, h6 { page-break-after: avoid }` を足した。作成者の CSS に改ページの指定の無い見出しも、ページの最後に見出しだけを残さず、次の段落と一緒に次のページへ送る (『CSSページ組版入門』第 4 版の「はじめに」の「Antenna House CSS Formatter」の見出しが、3 ページ目の最後に残っていた。見本は 4 ページ目の先頭)。付録 D の `@media print` のほかの 2 つの規則 (`h1` の前の改ページ、リストの前で改ページしない) は、見本の組み方と合わないので入れない
80
+ - **アンテナハウス互換の追込み** (`--style ah` だけ。**組版の結果が変わる**): 追込みで詰める量の上限 (1 行に二分) を超えて詰めれば行に収まり、詰める量が、追い出したときに行に残る空き以下なら、二分を超えても追い込む (小さいほうの調整を選ぶ)。前は、二分を超える行はいつも追い出したので、『CSSページ組版入門』第 4 版の 17.9 の縦書きの例 (`hanging-punctuation: first`) が「『行人』/『こゝろ』」になった (見本は「『行人』『こ/ゝろ』」と、全角ぶん追い込む)。見本の PDF で、二分を超えて詰めれば収まる行 (見本と行頭のそろう 232 か所) は、見本が追い込んだ 22 か所のうち 17 か所、追い出した 210 か所のうち 205 か所がこの規則に合う。本の全体で見本と行の違う所は 575 → 482 (例の書体を見本と同じにした組では 1227 → 1158)。仕様モード・ほかのスタイルと、XSL-FO の互換 (`--compat antenna`) は従来どおり
81
+ - **特色の立体の罫線の明暗の色** (HTML の `--style ah` と XSL-FO の、特色の値 (`--spot-colors`) を渡したとき。**組版の結果が変わる**): `groove`・`ridge`・`inset`・`outset` の罫線を特色 (`rgb-icc(r, g, b, #Separation, '名前')`) で引くとき、明るい側・暗い側の色を、作成者が `rgb-icc()` に書いた代わりの RGB から作るようにした。前は、特色の代わりの CMYK を RGB に直したものから作っていたので、見本より暗かった。特色の値を渡さないときの罫線 (その RGB の色) と同じ明暗になる。作り方 (明るい側は白へ半分、暗い側は黒へ 1/3) と、明暗の色を RGB で塗ることは前と同じ (CSS Backgrounds 3 §3.2 は立体の罫線の色の作り方を決めていない)。代わりの RGB の無い特色 (`rgb-icc(#Separation, '名前')`) は、これまでどおり代わりの CMYK から作る。『CSSページ組版入門』第 4 版 (`--style ah`、特色の値を渡したとき) では、26 ページの罫線の見本 (`.BorderSample`) の明暗の色が、見本の RGB (0, 40, 16)・(128, 158, 140) に対して (0, 41, 17)・(128, 158, 140) になる (前は (2, 20, 12)・(129, 143, 137))
82
+ - **CGM の字の集合の読み方** (どのモードでも。**組版の結果が変わる**): CHARACTER CODING ANNOUNCER が基本の 8 ビットで、CHARACTER SET INDEX が 96 字の集合 (ISO 8859-1 の右半分など) を選んだとき、0x20〜0x7E の字を 96 字の集合の字 (右半分の字) に読み替えていたのを直し、94 字の集合 (ISO 646 など) の字として読む。96 字の集合は 0xA0〜0xFF の字に使う (ISO/IEC 2022 の 8 ビットの符号では 96 字の集合は右半分にだけ置ける。WebCGM 2.1 の T.16.14・T.14.5)。WebCGM の試験の BIGCGM01 (アンテナハウスの見本 graphics-cgm-1) の表の字が「ÃÇÍïðåî」のように化けていたのが、見本と同じ「CGMopen」になる
83
+ - **SVG の字のソフトハイフン** (どのモードでも。**組版の結果が変わる**): SVG (CGM から作るものも) の字のソフトハイフン (U+00AD) などの描かない字 (Default_Ignorable_Code_Point) は描かず、書体の組む処理にも渡さない。前は、ハイフンと字形を分け合う書体 (Arimo・Noto Serif JP など) でソフトハイフンを先に描くと、書体の字形の覚え (fontkit) が汚れ、同じ書体の後の「-」が送り 0 の空白の字形になって消え、続く字と重なっていた (PDF)
84
+ - **配布物の大きさ・最初に読むもの** (組版の結果は変わらない): CGM・EPS (PostScript の解釈系)・WMF・EMF の処理を、文書にその画像が出てきたときだけ読み込むようにした。画面 (`npm run build`) とブラウザ向けのライブラリ (`kumiori/browser`) では、別のファイル (`cgm-….js`・`eps-….js`・`metafile-….js`) になり、これらの画像の無い文書では読まない。最初に読む JS は、ブラウザ向けのライブラリが約 3,649KB から約 3,367KB (gzip で約 1,203KB から約 1,126KB。この版の配布物では、ほかの変更と合わせて約 3,414KB・gzip で約 1,138KB)、画面が約 2,815KB から約 2,609KB、`npm run build:lib` の入口が約 2,199KB から約 1,917KB になった。使う人の書き方 (API の `typeset`・コマンド・画面) は変わらず、何も足さずに、これまでどおり CGM・EPS・WMF・EMF を読める。EPS の文書あたりの時間の予算も同じ。npm の配布物では、draw.io の処理を本体に入れたのでライブラリの JS が増えたが、ライブラリ (`dist-lib`) の sourcemap (`.js.map`。9 個で約 10.6MB。ソースの全文を含んでいた) を配布物から外した。配布物は、0.2.0 の 170 ファイル・tarball 約 5.6MB (展開して約 18.6MB) から、228 ファイル・約 4.5MB (展開して約 16.0MB) になった (sourcemap を外さなければ 236 ファイル・約 7.2MB (展開して約 26.4MB) だった)。配る JS は行を詰めておらず、クラスのメソッドの名前も残っている (短くなっているのは、関数の名前と、変数・引数の名前) ので、エラーの場所は、スタックトレースの `dist-lib` の JS の行とメソッドの名前で分かる。ソースは GitHub のその版のタグで見られる
85
+ - **メモリ** (組版の結果は変わらない): 行分けの結果の覚え (同じ段落を同じ幅で組み直すとき、段の高さ揃え・keep-with-next の試し組み・表のセルの計測で使い回すもの) に、大きさの上限を置き、古いものから捨てる。前は、文書の全部の段落の字ごとの atom・行・行の位置を、組み終えるまで持ち続けた。組み終えた時点で残る量 (GC の後) は、ふつうの文章 1MB で 657MB → 486MB、表 1MB (10 万セル) で 1458MB → 592MB。最大の常駐の大きさは、文章 934MB → 837MB、表 1971MB → 1671MB (組版の時間は変わらない)。上限は `LayoutOptions.lineMemoAtoms` (既定 5 万) で変えられる。組んだ回数の数え上げ (`LayoutEngine.stats`) に、覚えの大きさの最大 (`lineMemoPeak`) と使い回した回数 (`lineMemoHits`) を足した
86
+ - **速さ・メモリ** (組版の結果は変わらない): 入れ子の上限 (128 段) を超える要素が多い HTML の、構文解析・カスケード・読み込みを軽くした。(1) 要素ごとの計算値の表は、親と違う値・初期値と違う値だけを持つ (前は要素ごとに約 200 の性質の全部を持った)。(2) 子孫の結合子の照合で、16 段より遠い祖先の照合の答えを覚えて使い回す。(3) `text-align: inside`・`outside` (`--style ah`) を祖先へたどった答えを覚えて使い回す。(4) Node で HTML を読む構文解析器 (linkedom の使う htmlparser2) の、開いた要素の列を、先頭への足し引きが軽い入れ物に替える (前は深さの 2 乗の手間がかかった)。htmlparser2 の作りが受け持つ使い方から外れていれば (版が変わったときなど)、替えずにそのまま使う。替える相手を linkedom と同じにするため、htmlparser2 を直接の依存にも足した (linkedom と同じ `^10.1.0`)。`<b><i><a><font>` × 3 万 (474KB) は 24.3 秒・1.8GB → 14.1 秒・1.2GB、`<h1><button>` × 5 万 (600KB) は 39.3 秒・1.8GB → 20.0 秒・1.2GB (Node の最大の常駐の大きさ)
87
+ - **読み込みの手間**: 入力に当てる正規表現のうち、長さの 2 乗以上の手間になっていた残りの 12 か所を、結果を変えずに、長さに比例する手間にした。HTML: `::first-letter` の字 (字の無い改行の並び)・行の幅を測るときの前後の空白の切り詰め (途中の長い空白の並び)・`string-set` のコンマの分け方 (コンマの並び)・改行の前後の空白 (改行の無い空白の並び)・`image-resolution` (`-ah-image-resolution`) の解像度 (数字の長い並びで、長さの 3 乗に近かった)。書体の SVG の表 (閉じない `<`・`<svg` の多い文書と、パレットの色 `var(--colorN, …)` の閉じない並び。後者は 2 万字で 2 分を超えていた)。XSL-FO の `fo:instream-foreign-object` と MathML のファイルの文書型宣言 (閉じない宣言の空白の並び)。どれも 2 万字ほどで 0.3〜0.5 秒かかっていた。XML (XSL-FO など) の内部実体を展開するときの、文書型宣言の内部サブセットの探し方 (閉じない `<!DOCTYPE a` の並び。22 万字で 4.3 秒) と、注釈・CDATA 区間の飛ばし方 (閉じない `<!--`・`<![CDATA[` の並び。8 万字で 0.9 秒)
88
+ - **表の罫線の重ね合わせの重さ**: 列をまたぐセル (`colspan`・`number-columns-spanned`) を、列ごとのマスでなく範囲のまま扱う (罫線の重ね合わせ `border-collapse: collapse` と、セルのグリッドへの割り付け)。手間は、セルの数とまたぐ行の数に比例し、またぐ列の数にはよらない。`colspan="1000"` のセルを 150 行 × 150 個並べた表 (564KB・列が 15 万本) は、組むのに 12.6 秒 → 7.9 秒 (手元の測定。残りは、2 万 2,500 個のセルの組版そのもの)。組版の結果は変わらない
89
+ - **大きな画像の重さ**: 画素の上限 (1 枚 1 億画素・文書の画素の合計) いっぱいの画像を、結果を変えずに速く組む (上限の値は変えない)。1 億画素の RLE の BMP (約 800KB) を PDF に入れるまで 16 秒 → 3 秒、CGM の TILE の 6,400 万画素 17 秒 → 5 秒、2,500 万画素の画像 3 枚を描く EPS 14 秒 → 2 秒 (手元の測定)。(1) zlib の展開を、表引きの符号とバイト列への書き込みにした (PNG の画素のデータの確かめ・CGM の TILE・書体の表など)。(2) PDF に入れる 8 ビットの α の付いた PNG は、自前で展開して、pdf-lib と同じ RGB と α の画像にする。(3) 読んだ画像 (GIF・BMP・TIFF・WebP・EPS の画像など) のうち、不透明のものは RGB の PNG にして、展開せずに PDF に入れる (PDF の中の画像の流れは変わるが、画素は同じ)。(4) 無圧縮の PNG・CRC-32・Adler-32 の写しと数え方、data: の URI の base64 の読み (組み込みの変換を使う)、PostScript の image の DeviceGray・DeviceRGB の画素の写し方を速くした
90
+ - **書体**: 壊れた書体で、文書の全体が失敗しないようにする (組む途中で読めない表の残り 2 種)。(1) 特定の字の並びのときだけ整形の表 (GPOS など) の参照の先が無い書体 (登録のときの見本の整形では組める): その並びだけを、整形の表を使わずに組み直す (字は cmap の字形、送りは hmtx。書体の整形は止めないので、ほかの字の並びはこれまでどおり)。前は、その並びの字が PDF で黙って抜け、PDF の符号にする所では文書の全体が失敗した。(2) 字形のデータが読めない字形 (loca の位置がずれた書体など): PDF の部分書体では輪郭の無い字形にし (送りは hmtx のまま)、PDF の全体を失敗させない。どちらも、書体ごとに 1 度だけ結果の警告に出す。正当な書体の組版の結果は変わらない
91
+ - **壊れた入力・細工した入力への強さ**: `constructor`・`__proto__`・`toString` などの名前を入力に書いたとき、名前で引く表から Object.prototype のものを拾っていた残りを直した (0.2.0 の修正の続き)。SVG の要素名 (`<svg><constructor/></svg>`) で、文書の全体が `TypeError` で組めなかった。MathML の `linethickness="constructor"` で分数の線の太さが、`lspace="__proto__"` などで空きが NaN になっていた。`@page` の中の `@constructor { … }` を余白の箱として扱い、知らない名前の警告に出していなかった。`axf:column-rule-width="constructor"` で段罫の太さが数でなくなっていた。ほかに、`target-counter()` のカウンターの名前、`font-variant-numeric`・`-ligatures`・`-east-asian` の値、位置の語 (`background-position`・`transform-origin`・グラデーションの `at`)、システムの色の名前、`font-size`・`font-stretch` のキーワード (CSS・XSL-FO)、MathML の `mathsize` の表も、原型を持たないものにした。正当な文書の組版の結果は変わらない
92
+ - **安全性・細工した入力への強さ** (上限の値と根拠は各ソースのコメント。上限を超えたものは、その画像・宣言・字形だけを描かないか、そこまでを描いて警告を出し、文書の残りは組む):
93
+ - Node のコマンド: `--no-outside-files` のとき、入力のディレクトリの中にあっても、実体が外にあるファイル (外を指すシンボリックリンク) は使わない (ディレクトリの中に置いた `a.png → ../secret/s.png` のリンクで、外の画像が PDF に描かれていた)。読み込んだプラグインが終わらないときは、誤りとして終了コード 1 で終わる
94
+ - SVG の filter を画素で計算するとき (Node): `feMorphology` は、`radius` が大きくても、窓の最大・最小を画素あたり一定の手間で求める。`feTurbulence` の `numOctaves` は 24 段まで計算する (それより後の段は 8 ビットの色を変えない)。`feGaussianBlur` は、`stdDeviation` が大きくても、手間を画像の大きさまでにする。後で参照されない名前付きの結果 (`result`) は持たず、参照を待つ結果が多いときは解像度を下げる。1 つの SVG に計算の予算を置き、足りない filter は解像度を下げて計算し、尽きたら読めない SVG として扱う (仮の枠と警告。filter を付けた要素の多い SVG・入れ子の模様やマスク・feImage の連鎖)
95
+ - SVG: `var()` の置き換えの長さに上限 (1 つの値で 2MiB、1 つの SVG で 16MiB。HTML の側と同じ考え方)。`calc()` の解き方を値の長さに比例する手間にし、入れ子は 32 段まで。`<style>` の属性の選択子を索引で引き、照合の回数を 50 万回までにする。SVG フォントの合字を字の木で引き (64 字まで)、glyph の輪郭を線分の上限に数える。foreignObject の入れ子を重ねて組まない。`systemLanguage` の結果が同じ言語では、組んだ SVG を使い回す。多数の字の text で PDF を書く所が誤りで終わらないようにした。1 ページの SVG のリンクは 5,000 個まで
96
+ - 画像の形式 (プラグインと draw.io の図) の結果を確かめる: 大きさは有限で 1,000 万 px まで、SVG の長さに上限、読み込みの時限 (既定 150 秒)、1 つのファイルの `#` の後ろの違う参照は 64 種類まで
97
+ - CSS: 子孫の結合子 (空白)・後続の兄弟の結合子 (`~`) を多く重ねたセレクタ (`div div … div` を 60 個) の照合で、合わない祖先の選び方を総当たりして 30 秒を超えていた。結合子がすべて子孫か、すべて後続の兄弟のセレクタは、要素ごとに「祖先 (前の兄弟) に、左から順にいくつの複合セレクタを合わせられるか」を 1 つ覚えて、要素の数に比例する手間で照合する (`i ~ i ~ … ~ i` を 2 万個つないだセレクタと 2 万個の `<i>` (240KB) で 2 秒)。結合子の種類が混ざったセレクタ (`a ~ b c` など) は、途中の結果を覚えて、複合セレクタの数 × 要素の数に比例する手間で照合し、複合セレクタが 64 個を超えるものは、どの要素にも当てずに警告する (実在のスタイルシートには無い長さ)。当たる規則は、上限を超えるもののほかは変わらない
98
+ - **開発** (組版の結果は変わらない):
99
+ - CI と同じ手順を手元で走らせる `npm run ci:local` (`scripts/ci-local.mjs`) を足した。CI (`.github/workflows/ci.yml`) の build・node-min・e2e のジョブと、GitHub Pages (`.github/workflows/pages.yml`) の画面のビルド (pages のジョブ) の手順を順に走らせ、手順ごとの結果を並べる。`--worktree` で、いまのコミットを一時的な場所に取り出して試す
100
+ - 結合テストの Chromium: `npm run e2e` (`playwright.config.ts`) も、比較のスクリプトと同じく、環境変数 `KUMIORI_CHROMIUM` の指す Chromium の実行ファイルを使うようにした (読み方は `scripts/chromium.mjs` にまとめた)。Playwright の版と、入っている Chromium の版が合わない環境で、一時的な設定を作らずに動かせる。指さないときは、これまでどおり Playwright の取った Chromium を使う
101
+
7
102
  ## 0.2.0 (2026-11-12)
8
103
 
9
104
  flex・WOFF/WOFF2・参照の読み込みの API などを足した版。0.x の間なので、組版の結果が変わる修正も含めて minor の版にします。
@@ -51,7 +146,7 @@ flex・WOFF/WOFF2・参照の読み込みの API などを足した版。0.x の
51
146
  - リストの項目・表の行と、その中の強制の区切り (CSS Fragmentation 3 §2.1・§3.1・§4.3)。**組版の結果が変わる**: `li` の中のブロック・入れ子のリストの `li`・表のセルの中のブロックの `break-before`・`break-after` (`page` など) が効く (その所で項目・行を分ける。前は効かなかった)。リストの途中の `li`・表の途中の `tr` の `left`・`right`・`recto`・`verso` は、偶奇が合うまで白ページを挟む (前はページを改めるだけ)。段組の中の途中の `li`・`tr` の `column` が効く。ページを段に組む文書の途中の `li`・`tr` の `page` は、次の段ではなくページを改める。段組の外の `break-before: column`・`break-after: column` は効かない (前は、段組でない所でもページを改めていた)。XSL-FO でも、表のセル・リストの項目の本体の中のブロックの `break-before`・`break-after` が、その所で行を分ける (XSL 1.1 §4.8。前は効かなかった)
52
147
  - 絶対配置の包含ブロック (CSS 2.1 §10.1・CSS Position 3 §2.1)。**組版の結果が変わる**: `position: relative` (か `transform`) の表・表のセル・リストの項目・縦書きの箱の中の `position: absolute` の箱を、その箱の padding の箱を基準に置く。基準のブロックとの間に表やリストの項目があるときも、そのブロックを基準に置く (前は、どれもページの本文領域が基準になり、位置が大きくずれた)。縦書きのブロックの `position: relative` のずらしを、物理の向き (`left` は横、`top` は縦) にした。行の中の要素 (`span`・`inline-block`) の `position: relative` も基準になる (その要素の padding の箱を囲む矩形)。行の中の要素の中の `position: absolute` の箱が消えていたのを直した。段落の字の並びの途中の絶対配置の箱は、行を分けない (前は、そこで行が分かれた)。行の中の要素 (`span`・`inline-block`・`img`) の `position: relative` のずらし (`top`・`left` など) が効く (CSS 2.1 §9.4.3。前は効かなかった)
53
148
  - 絶対配置の箱の `top`・`bottom`・`height` の百分率 (CSS 2.1 §10.5・CSS Position 3 §3.1)。**組版の結果が変わる**: `top: 50%`・`top: 100%` (ドロップダウンの形)・`bottom: 10%`・`inset: 10%`・`height: 50%` を、包含ブロックの padding の箱の高さに対する割合として読む (高さが中身で決まる箱が基準のときは、組んだ後の高さ。基準の祖先が無いとき・`position: fixed` は本文領域の高さ。`::before`・`::after` の絶対配置も)。前は、`top`・`bottom` の百分率は無いものとして扱われ (箱が基準の上端・見つけた所に出た)、`height` の百分率は親の内容の高さから決めていた
54
- - 絶対配置の箱の位置 (NC-28)。**組版の結果が変わる**: 段落の行の途中にある、`left`・`right` (と `top`・`bottom`) が `auto` の絶対配置の箱を、行の中の見つけた所 (static position。CSS 2.1 §10.3.7・§10.6.4) に置く (前は、段落の 1 行目の頭に置かれ、前の字と重なった)。表のセルの中で見つけた箱も同じ。`position: relative` (か `transform`) の flex・grid の容器 (横書き) の中の絶対配置の箱を、容器の padding の箱を基準に置く (CSS Flexbox 1 §4.1・CSS Grid 1 §9.1。前は本文領域が基準になった)。高さが中身で決まる `position: static` の flex・grid の容器は、外の基準の箱まで通す。リストの項目 (`li`) と表のセル (`td`・`th`) の `position: relative` のずらし (`left`・`top` など) が効く (CSS 2.1 §9.4.3。項目は記号もいっしょに動く。行の高さ・ほかのセルの位置は変えない。前は効かなかった)
149
+ - 絶対配置の箱の位置。**組版の結果が変わる**: 段落の行の途中にある、`left`・`right` (と `top`・`bottom`) が `auto` の絶対配置の箱を、行の中の見つけた所 (static position。CSS 2.1 §10.3.7・§10.6.4) に置く (前は、段落の 1 行目の頭に置かれ、前の字と重なった)。表のセルの中で見つけた箱も同じ。`position: relative` (か `transform`) の flex・grid の容器 (横書き) の中の絶対配置の箱を、容器の padding の箱を基準に置く (CSS Flexbox 1 §4.1・CSS Grid 1 §9.1。前は本文領域が基準になった)。高さが中身で決まる `position: static` の flex・grid の容器は、外の基準の箱まで通す。リストの項目 (`li`) と表のセル (`td`・`th`) の `position: relative` のずらし (`left`・`top` など) が効く (CSS 2.1 §9.4.3。項目は記号もいっしょに動く。行の高さ・ほかのセルの位置は変えない。前は効かなかった)
55
150
  - `writing-mode` を指定した表 (CSS Writing Modes 3 §2.1・CSS 2.1 §17)。**組版の結果が変わる**: 横書きの文書の中の `writing-mode: vertical-rl`・`vertical-lr` の表 (`table`・`display: table`) を、縦書きで組む (行が右から左へ、行の中のセルが上から下へ並ぶ。前は、表の `writing-mode` を見ずに横書きのまま組んでいた)。縦書きの文書の中の `horizontal-tb` の表も同じ。親と書字方向の違う、罫線を分ける表 (`border-spacing`) の大きさに、セルの間隔を入れる
56
151
  - 表の無名の行・セル (CSS 2.1 §17.2.1)。**組版の結果が変わる**: 表 (`display: table`・`inline-table`)・行 (`table-row`) の直下の、表の部分でない中身 (文字・ほかの要素) を、無名の行・無名のセルに包んで組む (前は消えていた。`<span style="display: inline-table">字</span>` の字など)
57
152
  - 表の `text-indent` (CSS Text 3 §8.1・HTML Standard の既定のスタイル)。**組版の結果が変わる**: 表に指定した `text-indent` がセルの行に効く (前は効かなかった)。表の外 (`body`・`div` など) の `text-indent` は、表の中へ入らない (`table { text-indent: initial }`。前は、外の字下げがセルの行に入っていた。ブラウザと同じ)
@@ -142,7 +237,7 @@ flex・WOFF/WOFF2・参照の読み込みの API などを足した版。0.x の
142
237
  - JPEG・TIFF・CCITT: 走査の数 (500 まで)、IFD の値の数、2 次元の行の探索の手間を抑える
143
238
  - EPS (PostScript): VM の使用量 (512MB。超えれば VMerror)、パスの点の合計 (500 万点。超えれば limitcheck)、フィルタが読みためる量 (16MB)、画像のマスクの寸法、網かけの画素の手間、`resourceforall` の型紙の照合、`search`、`StartData` の長さに上限を置く
144
239
  - 組版: 入れ子の深い文書 (表の中の表、inline-block・float・絶対配置・段組・回したコンテナの入れ子) で、組版の手間が深さに対して指数的に増えていたのを直した (計測・試し組みで求めた値を、1 回の組版の中で覚えて使い回す。組版の結果は変わらない)。XSL-FO の入れ子の表は、12 段で 35 秒かかっていたのが、60 段で 1 秒足らずになる
145
- - **組版: 幅を中身で決める箱 (inline-container・inline-block・float・表・絶対配置・回したコンテナ) を混ぜた深い入れ子と、中身がページからあふれる段組の入れ子で、組版の手間を抑える** (細工した入力で時間を使い切らない)。組版の 1 回の通し (ページ番号の参照による組み直しは別に数える) で組む回数が 10 万回を超えたら、以後の箱は中身の幅を測らずに使える幅で組み、5 段目より内側の段組は 1 段に組んで、警告を出す。上限に届かない文書の結果は変わらない (説明書・見本で最も多い本で約 2 万回、段組の入れ子は 1 段)。種類を混ぜた XSL-FO の入れ子 120 段は数分かかっていたのが 5 秒ほどに、あふれる段組の入れ子 10 段は 80 秒かかっていたのが 2 秒ほどになる
240
+ - **組版: 幅を中身で決める箱 (inline-container・inline-block・float・表・絶対配置・回したコンテナ) を混ぜた深い入れ子と、中身がページからあふれる段組の入れ子で、組版の手間を抑える** (細工した入力で時間を使い切らない)。組版の 1 回の通し (ページ番号の参照による組み直しは別に数える) で組む回数が 10 万回を超えたら、以後の箱は中身の幅を測らずに使える幅で組み、4 段より深い段組は 1 段に組んで、警告を出す。上限に届かない文書の結果は変わらない (説明書・見本で最も多い本で約 2 万回、段組の入れ子は 1 段)。種類を混ぜた XSL-FO の入れ子 120 段は数分かかっていたのが 5 秒ほどに、あふれる段組の入れ子 10 段は 80 秒かかっていたのが 2 秒ほどになる
146
241
  - 描画と Area Tree の走査が、深い入れ子でスタックを使い切らない (再帰をやめた)。回転した領域の入れ子は 300 段まで。深すぎる木の直列化は `AreaTreeFormatError`
147
242
  - EPS (PostScript): 1 つの EPS が使うメモリの合計に上限を置く (512MB。超えれば VMerror。配列・辞書は、実際に使う量に近い重みで数える)。作る SVG の長さにも上限を置く (128MB。超えれば、そこまでの絵と limitcheck)
148
243
  - 出力: `renderPage` が、改行しない空白 (U+00A0) の字形を読めない書体のページで例外にならない。壊れた data URI・`@font-face` の URL 1 つで `typeset` 全体が失敗しない。Node のコマンドは、入力のディレクトリの下の読めないディレクトリを飛ばす
@@ -216,7 +311,7 @@ flex・WOFF/WOFF2・参照の読み込みの API などを足した版。0.x の
216
311
  - `font-variant="small-caps"` (スモールキャップ) と `word-spacing` (語の間の空白に足す長さ) を読む (XSL 1.1 §7.9.8・§7.17.8)
217
312
  - `glyph-orientation-vertical` の `auto`・`0deg` (すべての字を立てる)・`90deg` (すべての字を横に倒す) を読む (XSL 1.1 §7.29.3)。180・270 度と `glyph-orientation-horizontal` の 0 度以外は、読まずに報告する
218
313
  - `relative-position="relative"` (横書きの `fo:block` をずらして描く)、`visibility` の `hidden`・`collapse` (場所を残して描かない)、絶対配置の `fo:block-container` の負の `z-index` (本文の背面に描く) を読む (XSL 1.1 §7.13.5・§7.30.17・§7.30.18)
219
- - `fo:table-row`・`fo:list-item` の `break-before`・`break-after` の種類 (`odd-page`・`even-page`・`page`・`column`) を、`fo:block` と同じに残す (XSL 1.1 §7.20.1・§7.20.2。NC-28)。**組版の結果が変わる**: 行・項目の `odd-page`・`even-page` は、白ページを挟んで奇数・偶数ページから始める (前は、どの種類も次の段・ページへ送るだけだった)。段組の領域の `page` は、次の段でなく次のページへ送る
314
+ - `fo:table-row`・`fo:list-item` の `break-before`・`break-after` の種類 (`odd-page`・`even-page`・`page`・`column`) を、`fo:block` と同じに残す (XSL 1.1 §7.20.1・§7.20.2)。**組版の結果が変わる**: 行・項目の `odd-page`・`even-page` は、白ページを挟んで奇数・偶数ページから始める (前は、どの種類も次の段・ページへ送るだけだった)。段組の領域の `page` は、次の段でなく次のページへ送る
220
315
  - ページ番号の桁区切り (`fo:page-sequence` の `grouping-separator`・`grouping-size`) を読む (XSL 1.1 §7.26.2・§7.26.3。「1,234」)。`letter-value` の値を受け付ける (§7.26.4)
221
316
  - 目次の行: `last-line-end-indent` を読む (XSL 1.1 §7.16.3)。折り返した行を `end-indent` の手前で終え、ページ番号のある最後の行だけを端まで伸ばせる (`text-align-last="justify"` + `end-indent` + 負の `last-line-end-indent`)。`leader-alignment` の `reference-area`・`page` を読む (§7.22.1): 点のリーダーの周期を、本文の領域 (段・表のセル)・ページの端からの格子に合わせる
222
317
  - `fo:initial-property-set` を読む (XSL 1.1 §6.6.4): `fo:block` の最初の行にだけ、フォント・`color`・`letter-spacing`・`word-spacing`・`text-decoration`・`background-color` を当てる。`text-transform`・`font-variant`・`line-height`・罫線・`padding` などは読まずに報告する
package/NOTICE CHANGED
@@ -2,4 +2,6 @@ Kumiori (組み織り)
2
2
  Copyright 2026 Northern Lights Co.
3
3
 
4
4
  This product is licensed under the Apache License, Version 2.0 (see LICENSE).
5
+ It includes code ported from draw.io and mxGraph (Copyright JGraph Ltd, JGraph Holdings Ltd and draw.io AG, Apache License 2.0).
6
+ The shapes from draw.io's src/main/webapp/shapes/ are ported from draw.io v24.7.5, which is licensed only under the Apache License 2.0.
5
7
  Third-party components and their licenses are listed in THIRD_PARTY_NOTICES.md.