Skip to content

Releases

v0.26.0

Choose a tag to compare

@kenshaw kenshaw released this 30 Nov 05:14

This release makes lottie read Lottie files that do not follow the schema exactly, as ThorVG does.

go get github.com/xo/okage@v0.26.0

Changes:

  • lottie decodes JSON with encoding/json/v2 and a set of lenient unmarshalers (D110). Before, lottie.Parse gave an error for a width of 200.0, which the json module of Python writes. Now it reads such a file.
  • An integer field takes a number with a fraction, a boolean, or a string that holds a number. The fraction is cut off, and a value out of range takes the nearest end of the range.
  • A float field takes a boolean or a string that holds a number. A boolean field takes a number, and a value that is not 0 is true. A string field takes a number or a boolean.
  • An optional field with an unknown enumeration value, such as a blend mode of 99, is absent, so its default applies. An unknown star type is a star.
  • A layer of an unknown type, such as a camera or an audio layer, is a null layer, so its children keep their parent. A shape item of an unknown type is skipped.
  • A missing required key, a value of the wrong kind, such as an array in place of a number, and NaN in a string are still errors. A file that velato reads decodes as before.

v0.25.1

Choose a tag to compare

@kenshaw kenshaw released this 29 Nov 03:34

This release fixes the lint of v0.25.0. The code is the same.

go get github.com/xo/okage@v0.25.1

Fixes:

  • svg drops a nolint directive that golangci-lint v2.15.0, which CI pins, does not need. CI failed on it for v0.25.0, although each test passed.

v0.25.0

Choose a tag to compare

@kenshaw kenshaw released this 29 Nov 03:18

This release moves the filters to a port of filtra, as resvg does, and pretty-prints the XMP metadata of pdf.

go get github.com/xo/okage@v0.25.0

Breaking changes:

  • The package filter is now a port of filtra 0.1.0, the filter engine that resvg takes since #1255. filter.Apply runs a whole filter graph, and the types of filtra describe the graph. Blur, BlurMask, ApplyColorMatrix and ApplyComponentTransfer keep their signatures, but they now call the kernels of filtra, so their bytes change. The option WithBoxBlur is removed, because filtra has one blur for each standard deviation (D108).
  • The filter tree of svg follows usvg: svg.Filter embeds filter.Filter[*svg.Group], and the primitive types with the suffix Filter, such as GaussianBlurFilter and ColorMatrixFilter, are removed. svg.ColorInterpolation replaces svg.ColorInterpolationFilter for gradients and masks (D108).

Changes:

  • svg renders its filters with filter.Apply, and matches the reference images of resvg at 664c8dc1, which changed for 199 filter tests.
  • pdf pretty-prints its XMP metadata when WithPretty(true) is set, as krilla 70a0aa80 does. internal/xmpwriter follows the fork of xmp-writer that krilla takes (D109).
  • lottie blurs its layers and drop shadows with the blur of filtra. All 70 frames of the ThorVG quality test now show 0% difference from ThorVG, where 6 showed up to 0.5% before.

v0.24.2

Choose a tag to compare

@kenshaw kenshaw released this 28 Nov 23:19

This release ports the new commits of resvg, go-tex/math and go-text/typesetting.

go get github.com/xo/okage@v0.24.2

Changes:

  • svg takes a number from 1 to 1000 for font-weight, and resolves bolder and lighter as CSS Fonts 4 does (resvg #1252).
  • The text decorations of svg follow paint-order (resvg #1256).
  • pathLength scales the dashes of a stroke and the startOffset of a text path (resvg #1253, #1262).
  • svg skips an image too thin to place, where it panicked (resvg #1249).
  • The bidi of typesetting reuses the buffers of its level runs and isolating sequences.
  • texmath sizes the delimiters of a fraction by delim1 and delim2 of TeX, sets the glyphs of a script with the ssty alternates of the face, also for \scriptstyle, and treats a group of one character as that character before its scripts (go-tex/math #71, #76, #77, #80).

Two upstream commits wait for the next release: resvg moves its filters to the new crate filtra, and krilla moves xmp-writer to a fork with a pretty mode.

v0.24.1

Choose a tag to compare

@kenshaw kenshaw released this 27 Nov 22:48

This release fixes two crashes of the renderer. ivy found the first one with a fuzz test.

go get github.com/xo/okage@v0.24.1

Fixes:

  • path.RectFromPoints returns false for a NaN in any point, as Skia does. tiny-skia does not check the first one or two points, so PathBuilder.Finish took a path whose second point was NaN, and the fill of that path panicked in the alpha runs. Finish, Path.Transform and Rect.Transform now refuse such a path. okage v0.23.0 and v0.24.0 have the fault (D107).
  • A hairline without anti-aliasing skips a pixel past the right side on the last row of the pixmap. tiny-skia writes that pixel past the end of the pixels and panics. On every other row, the pixel stays on the first column of the next row, as in tiny-skia (D107).

Each image that tiny-skia draws keeps its bytes. The fuzz test FuzzFillPathHuge now also takes NaN and infinities.

v0.24.0

Choose a tag to compare

@kenshaw kenshaw released this 27 Nov 21:42

This release gives ivy a way to write text that a reader can search and copy, and that paints nothing.

go get github.com/xo/okage@v0.24.0

New APIs:

  • pdf.Surface.DrawInvisibleGlyphs draws a run of glyphs with its text as invisible text, with the text rendering mode 3. It takes the arguments of DrawGlyphs without outlined. The run embeds the font and its ToUnicode map, as a visible run does. It writes no color and no graphics state, so the runs after it do not change. A run of a font of Type 3, such as a font of color glyphs or an image font, also takes the mode 3. MuPDF and Poppler paint no pixel of such a run, and pdftotext and mutool extract its text (D106).

v0.23.0

Choose a tag to compare

@kenshaw kenshaw released this 26 Nov 01:39

This release gives ivy four changes that it asked for: the text of a glyph with two texts in pdf, the math of TeX in texmath, links to a later page in pdf, and fewer allocations in roxmltree and cssselect2.

go get github.com/xo/okage@v0.23.0

New APIs:

  • pdf.DestinationName is a link target that names a named destination by its name alone. Document.Finish resolves the name after the last page, so a page can link to a later page before that page is drawn. A link to a name without a destination is left out and logged (D104).
  • texmath.WithMathConstant sets a constant of the MATH table for a layout, without a change of the face. texmath.WithSubSupShiftDown gives a subscript with a superscript the shift sub2 of TeX (D103).
  • The optional interface cssselect2.ChildrenAppender gives the children of an Element as a slice, without the closures of Children (D105).

Changes:

  • A glyph of a TrueType CID font of pdf whose text differs from the text of its first use takes a second CID with its own entry in the ToUnicode map, where krilla marks the use with ActualText. A font without such a glyph keeps the map Identity, so other files do not change. A glyph without text takes an empty ActualText, so that MuPDF gives no U+FFFD for it. On a document in Arabic of the corpus of ivy, MuPDF missed 104 of 114 words before, and misses none now (D102).
  • texmath sets \ldots, \dots, \cdots and their kin as three dots with the spacing of TeX: 1,\ldots,n is now 33.23 points wide at 10 points with Latin Modern Math, where pdfLaTeX gives 33.22. The primes of x' are at full size, the scripts of \hat y_i follow TeX rule 12, the drop of a subscript is at the size of the script, and the cells of aligned, split and gathered are in display style (D103).
  • roxmltree guesses the number of nodes with the text nodes, copies a list of a parse only when a quarter of it is spare, and keeps one text buffer for a parse. A parse of a large document allocates about 70% less. cssselect2 makes the wrappers of the children of a parent as one slice. On a book of 270,000 elements, ivy allocates 1,441 MB where it allocated 1,744 MB (D105).

v0.22.1

Choose a tag to compare

@kenshaw kenshaw released this 25 Nov 11:18

This release fixes the variable color glyphs of COLRv1 with an int of 32 bits, such as with GOARCH=386 or TinyGo for wasip1. With v0.22.0, the walks of internal/colr read no variation delta there, so a varied paint of svg and pdf kept its default value.

go get github.com/xo/okage@v0.22.1
  • internal/colr counts the deltas of a paint as a uint64, so the count is never negative with an int of 32 bits (D101).
  • typesetting/harfbuzz generates its USE table with a port of gen-use-table.py of HarfBuzz 15.2.0, from the files of Unicode 18.0.0. The table gives the category SPACE to the space separators, as HarfBuzz 15.2.0 does (D101).
  • The list of checks in AGENTS.md now runs the tests with GOARCH=386, as CI does.

v0.22.0

Choose a tag to compare

@kenshaw kenshaw released this 25 Nov 06:41

This release adds a public package for the filters, image fonts and XMP metadata with PDF/A in pdf, and moves the shaper of typesetting to HarfBuzz 15.2.0. The renderer is faster on the programs that it draws most, with the same bytes.

go get github.com/xo/okage@v0.22.0

New APIs:

  • The new package filter holds the Gaussian blur, the color matrix and the component transfer of the filters of resvg: Blur, BlurMask, ApplyColorMatrix and ApplyComponentTransfer, with variants for an image.NRGBA. svg and lottie use it, with the same bytes (D88).
  • pdf.NewImageFont and Font.AddImageGlyph make a Type 3 font from masks and images that the caller gives. DrawGlyphs writes their text, so a reader can copy and search it (D89).
  • pdf writes XMP metadata by default, as krilla does. WithXMPMetadata(false) turns it off. WithArchivalValidator checks a document against PDF/A, and Document.EmbedFile embeds a file. PDF/UA needs tags, which pdf does not have (D99).
  • The root package adds the sentinel error ErrPDFXMP (D99).

Changes:

  • typesetting/harfbuzz follows HarfBuzz 15.2.0: its work limits, its fixes of lookups, marks, kerning and the unsafe-to-break flag, and its changes of the Indic, USE, Khmer, Hangul, Arabic and AAT shapers. Each line of perf_reference still gives the glyphs of HarfBuzz (D97).
  • typesetting normalizes the coordinates of a variable font as skrifa does, reads the 32-bit deltas of an ItemVariationData, and no longer panics on a table trak with a null offset (D101).
  • svg follows the font model of read-fonts 0.46: the MVAR deltas, the walk of the paint graph of COLRv1 and the strikes of EBDT (D100).
  • The pipeline runs fused copies of six common programs, such as solid fills and linear gradients. The root benchmarks are 13% faster in the scalar build and 20% faster in the SIMD build, with the same bytes (D98).
  • pdf writes the opacity masks of meshes as gray transparency groups.
  • lottie combines masks and trims the paths of a group as ThorVG does (D43, D94).

v0.21.0

Choose a tag to compare

@kenshaw kenshaw released this 25 Nov 03:42

This release follows the new upstream commits, fixes the nightly Rust oracle, and clears the backlog of typesetting, lottie, texmath and the pipeline. The README now shows an example for each main package, with the image that it draws.

go get github.com/xo/okage@v0.21.0

New APIs:

  • lottie.WithQuality sets the quality of the blur and the drop shadow, as ThorVG does. The default is 50 (D94).
  • With Renderer.MergePaths on, lottie strokes and trims the result of a merge path of mode 2 to 5 (D94).
  • texmath.WithLineWidth puts the label of \tag at the right margin. texmath now parses each formula of its corpus that KaTeX parses, such as align, gather, \sideset and the symbols of AMS (D95).
  • Face.KernPair and Font.LigaturePair of typesetting/font give the kerning and the ligature of a pair of glyphs (D95).
  • HarfbuzzShaper.SetUnsafeToConcat and Glyph.UnsafeToConcat give the flag unsafe-to-concat of HarfBuzz 15.1.0 (D93).
  • segmenter.LineBreaks computes only the line breaks of a paragraph (D92).
  • kurbo.Flatten flattens the curves of a path into lines (D94).

Changes:

  • The renderer draws the pixel that a hairline without anti-aliasing puts one column past the right side, as tiny-skia does. Since v0.20.0, okage left it out, and the nightly oracle failed on one scene of 100,000.
  • typesetting is about 11% faster on the path of shaping.Paragraph that ivy uses, with the same glyphs (D92).
  • Paragraph.Line shapes again a run that the shaper sets against its direction, so a line gives the glyphs of a new shaping (D93).
  • The stages of sRGB and gamma, the blend modes hue, saturation, color and luminosity, and the bicubic sampling are faster, with the same bytes (D96).
  • pdf writes the soft mask of the opacity of a gradient as a gray transparency group, as krilla does.
  • internal/subsetter writes the bounds of the glyphs of an instance of a variable font in the table head, as subsetter does.
  • The bidi algorithm of typesetting skips each run of European terminators once, as go-text does.
  • lottie ignores expressions, and webfont reads no EOT file with MicroType Express. The maintainers do not plan either one (D91).

The status of each package is now in docs/STATUS.md, and the differences from upstream are in docs/DIFFERENCES.md.

⌂ 换网址