Skip to content

v9.2.1

Latest

Choose a tag to compare

@edragoev1 edragoev1 released this 23 Nov 19:00
· 9 commits to main since this release

PDFjet v9.2.1, in all four ports: Java, C#, Go and Swift, kept behaviorally identical. Listed in CHANGELOG.md under v9.2.1. It includes everything given to customers as the 9.2.0 builds.

Highlights

  • Hindi, Khmer and the other Indic and Southeast Asian scripts in TextBlock and TextLine, and in TextFrame and TextColumn*: Hindi, Bengali, Tamil, Telugu, Kannada, Malayalam, Gujarati, Gurmukhi, Odia, Sinhala, Khmer, Lao and Burmese, shaped by a text engine and drawn as outlines, tagged for screen readers (PDF/UA); mixed with English, Arabic or Thai in one block; in Table cells; turned. Java and Android, and Swift on Apple platforms, use the platform's engine; .NET and Go add PDFjet's HarfBuzz, nothing to install (PDFjet.HarfBuzz on NuGet, github.com/edragoev1/pdfjet/harfbuzz/v9); HBShape runs HarfBuzz's hb-shape anywhere, when asked for.
  • Noto Sans for these 13 scripts, Regular and Bold, in the world fonts.
  • Thai, Lao, Khmer and Burmese lines break between words, by ICU's dictionaries, as Chrome breaks them: the Thai UDHR's lines are Chrome's, line for line.
  • Arabic and Hebrew paragraphs right to left by themselves in a TextBlock.
  • Large PNGs in a fraction of the memory in Go, Java and C#: 22 MB in place of 1.3 GB for an 8000 by 8000 PNG with alpha, in Go; the PDF the same, byte for byte.
  • Swift on 32-bit Int (watchOS, wasm32), checked on every push for wasm32, watchOS and iOS; and the Swift package from pdfjet-swift, about 50 MB where SwiftPM cloned this whole repository.

* The glyphs of these scripts are outlines: they look the same on every screen and in print, and each line is marked with its text, which screen readers read in a tagged PDF; viewers differ in how they select and search it, and PDF.attachText attaches the text whole for anyone who needs it.

Fixed

  • Stamp.drawPath in Java and .NET wrote a curve's c as 99 and each line break as 10, so a viewer could not read the path, ever since Stamp was added. Go and Swift were right.
  • Overnight fuzzing of the text layout, PNG, SVG, Markdown, fonts and PDF reading; what it found is fixed in every port, among it a line wider than its TextBlock drawn outside it, and a PNG header claiming a huge width that took 1.2 GB in Go before failing.
  • A code review of the PNG read a row at a time and of Markdown's SVG fonts, its findings fixed: a palette PNG with transparency is read once, not twice; an SVG's italic and monospace text in Markdown keeps its style.
  • The four ports cleaned of dead and duplicated code, about 3,500 lines, with every example PDF the same, byte for byte, and the benchmarks unchanged.

Behavior changes

Each one below can change what an existing program does; the CHANGELOG describes each in detail.

  • Hindi and the other scripts above, in a TextBlock, a TextLine, a TextFrame or a TextColumn, are shaped and drawn as outlines, where they were drawn as text, their letters wrong. In .NET and Go without PDFjet's HarfBuzz add-on or a shaper set, and in Swift on Linux without a shaper set, the document fails saying what to add.
  • A TextBlock paragraph whose first letter is Arabic or Hebrew is right to left, aligned to the right, unless setRightToLeft was called: a block of "Hello\nمرحبا" draws its second line from the right.
  • Thai text without zero width spaces breaks between its words, not only at its spaces.
  • An SVG's text in Markdown is in the document's fonts, in the style it asks for, not in the fonts PDFjet carries.
  • drawGlyphs in an untagged document marks its glyphs with their text as actual text, as it did in a tagged one only.
  • Stamp.drawPath in Java and .NET writes its path's operators and line breaks, as Go and Swift always did.