Skip to content

NetPdf 1.2.0

Latest

Choose a tag to compare

@raroche raroche released this 01 Oct 01:54
83e7ff3

A minor release: system font collections, per-character font fallback, and layout fixes found in a visual review of real travel documents against a browser. No breaking public API changes.

Added

  • System font collections (.ttc / .otc) are now used. The system-font index skipped every collection file, so families that ship only as a collection could not be used and a document asking for them fell back to another font. On macOS these include Helvetica, Helvetica Neue, Avenir, Avenir Next, Menlo and Optima; on Windows and Linux, CJK families such as MS Gothic and Noto Sans CJK. Every face of a collection is now indexed, and the chosen face is embedded on its own (not the whole collection). Faces that the font safety validator rejects (bitmap or SVG glyph tables) or that lack a required table are skipped. Fonts you supply yourself through an IFontResolver must still be a single TTF / OTF.
  • Per-character font fallback. Each text run used one font — the first font-family entry that resolved — so a character that font lacks (✔, ▲, →, or a word in another script) was drawn as an empty box, even when a later family or an installed symbol font had it. Now that text is drawn with the first font that covers it: the rest of the font-family list, then the default family, then common symbol and broad-coverage system fonts (for example Apple Symbols / Menlo on macOS, Segoe UI Symbol on Windows, DejaVu Sans / Noto Sans Symbols on Linux). The fallback text sits on the same baseline, and only the glyphs it uses are embedded. A custom IFontResolver gets only the fallback fonts it resolves itself. FONT-MISSING-GLYPH-001 is now reported only when no font covers the character.

Fixed

  • Flex items no longer lose content when flexed below it. A flex: 1 item in a column flexbox (for example the feature list inside a card) could be flexed to almost no height; its content was then laid out into that tiny space and everything after the first line was silently dropped. A column item with height: auto and min-height: auto now keeps at least its content height (CSS Flexbox §4.5), and an item's content never paginates inside a fixed-size item — it overflows it, as in a browser.
  • Absolutely positioned content taller than its box is no longer cut. It overflows the box (CSS overflow: visible) instead of keeping only what fitted before the first "page break" inside the box.
  • Content in narrow boxes is measured at its real width. The pre-measure that sizes boxes and decides page breaks laid nested text, flex rows, tables and multi-column content out at the full page width. Text that wraps in a narrow box was measured as one line, so the box's border was drawn too short (losing its bottom padding), spacing after such content was squeezed, and a list item could be split leaving a single line at the page bottom.
  • A box's bottom padding is no longer lost when its content is short. A box with one short block child and a bottom padding (plus border) larger than that content — for example a padding: 24px card holding one line — was drawn without its bottom padding: the text sat in the padding and the next box was drawn over it. Percentage padding and margins of nested boxes are also measured at their real size now, instead of as 0.
  • PAGINATION-FORCED-OVERFLOW-001 is reported only for real overflows. A document whose content sits in one wrapper element reported it on every page; it is now reported once per box that is actually taller than a page.

Full changelog: v1.1.1...v1.2.0