Repository navigation
Releases
v0.26.0
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.0Changes:
lottiedecodes JSON withencoding/json/v2and a set of lenient unmarshalers (D110). Before,lottie.Parsegave an error for a width of200.0, which thejsonmodule 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
This release fixes the lint of v0.25.0. The code is the same.
go get github.com/xo/okage@v0.25.1Fixes:
svgdrops anolintdirective 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
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.0Breaking changes:
- The package
filteris now a port of filtra 0.1.0, the filter engine that resvg takes since #1255.filter.Applyruns a whole filter graph, and the types of filtra describe the graph.Blur,BlurMask,ApplyColorMatrixandApplyComponentTransferkeep their signatures, but they now call the kernels of filtra, so their bytes change. The optionWithBoxBluris removed, because filtra has one blur for each standard deviation (D108). - The filter tree of
svgfollows usvg:svg.Filterembedsfilter.Filter[*svg.Group], and the primitive types with the suffixFilter, such asGaussianBlurFilterandColorMatrixFilter, are removed.svg.ColorInterpolationreplacessvg.ColorInterpolationFilterfor gradients and masks (D108).
Changes:
svgrenders its filters withfilter.Apply, and matches the reference images of resvg at 664c8dc1, which changed for 199 filter tests.pdfpretty-prints its XMP metadata whenWithPretty(true)is set, as krilla 70a0aa80 does.internal/xmpwriterfollows the fork of xmp-writer that krilla takes (D109).lottieblurs 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
This release ports the new commits of resvg, go-tex/math and go-text/typesetting.
go get github.com/xo/okage@v0.24.2Changes:
svgtakes a number from 1 to 1000 forfont-weight, and resolvesbolderandlighteras CSS Fonts 4 does (resvg #1252).- The text decorations of
svgfollowpaint-order(resvg #1256). pathLengthscales the dashes of a stroke and thestartOffsetof a text path (resvg #1253, #1262).svgskips an image too thin to place, where it panicked (resvg #1249).- The bidi of
typesettingreuses the buffers of its level runs and isolating sequences. texmathsizes the delimiters of a fraction by delim1 and delim2 of TeX, sets the glyphs of a script with thesstyalternates 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
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.1Fixes:
path.RectFromPointsreturns false for a NaN in any point, as Skia does. tiny-skia does not check the first one or two points, soPathBuilder.Finishtook a path whose second point was NaN, and the fill of that path panicked in the alpha runs.Finish,Path.TransformandRect.Transformnow 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
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.0New APIs:
pdf.Surface.DrawInvisibleGlyphsdraws a run of glyphs with its text as invisible text, with the text rendering mode 3. It takes the arguments ofDrawGlyphswithoutoutlined. 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, andpdftotextandmutoolextract its text (D106).
v0.23.0
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.0New APIs:
pdf.DestinationNameis a link target that names a named destination by its name alone.Document.Finishresolves 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.WithMathConstantsets a constant of the MATH table for a layout, without a change of the face.texmath.WithSubSupShiftDowngives a subscript with a superscript the shift sub2 of TeX (D103).- The optional interface
cssselect2.ChildrenAppendergives the children of anElementas a slice, without the closures ofChildren(D105).
Changes:
- A glyph of a TrueType CID font of
pdfwhose 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 mapIdentity, 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). texmathsets\ldots,\dots,\cdotsand their kin as three dots with the spacing of TeX:1,\ldots,nis now 33.23 points wide at 10 points with Latin Modern Math, where pdfLaTeX gives 33.22. The primes ofx'are at full size, the scripts of\hat y_ifollow TeX rule 12, the drop of a subscript is at the size of the script, and the cells ofaligned,splitandgatheredare in display style (D103).roxmltreeguesses 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.cssselect2makes 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
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.1internal/colrcounts the deltas of a paint as auint64, so the count is never negative with an int of 32 bits (D101).typesetting/harfbuzzgenerates its USE table with a port ofgen-use-table.pyof 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.mdnow runs the tests withGOARCH=386, as CI does.
v0.22.0
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.0New APIs:
- The new package
filterholds the Gaussian blur, the color matrix and the component transfer of the filters of resvg:Blur,BlurMask,ApplyColorMatrixandApplyComponentTransfer, with variants for animage.NRGBA.svgandlottieuse it, with the same bytes (D88). pdf.NewImageFontandFont.AddImageGlyphmake a Type 3 font from masks and images that the caller gives.DrawGlyphswrites their text, so a reader can copy and search it (D89).pdfwrites XMP metadata by default, as krilla does.WithXMPMetadata(false)turns it off.WithArchivalValidatorchecks a document against PDF/A, andDocument.EmbedFileembeds a file. PDF/UA needs tags, whichpdfdoes not have (D99).- The root package adds the sentinel error
ErrPDFXMP(D99).
Changes:
typesetting/harfbuzzfollows 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 ofperf_referencestill gives the glyphs of HarfBuzz (D97).typesettingnormalizes 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).svgfollows 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).
pdfwrites the opacity masks of meshes as gray transparency groups.lottiecombines masks and trims the paths of a group as ThorVG does (D43, D94).
v0.21.0
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.0New APIs:
lottie.WithQualitysets the quality of the blur and the drop shadow, as ThorVG does. The default is 50 (D94).- With
Renderer.MergePathson,lottiestrokes and trims the result of a merge path of mode 2 to 5 (D94). texmath.WithLineWidthputs the label of\tagat the right margin.texmathnow parses each formula of its corpus that KaTeX parses, such asalign,gather,\sidesetand the symbols of AMS (D95).Face.KernPairandFont.LigaturePairoftypesetting/fontgive the kerning and the ligature of a pair of glyphs (D95).HarfbuzzShaper.SetUnsafeToConcatandGlyph.UnsafeToConcatgive the flag unsafe-to-concat of HarfBuzz 15.1.0 (D93).segmenter.LineBreakscomputes only the line breaks of a paragraph (D92).kurbo.Flattenflattens 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.
typesettingis about 11% faster on the path ofshaping.Paragraphthat ivy uses, with the same glyphs (D92).Paragraph.Lineshapes 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).
pdfwrites the soft mask of the opacity of a gradient as a gray transparency group, as krilla does.internal/subsetterwrites the bounds of the glyphs of an instance of a variable font in the table head, as subsetter does.- The bidi algorithm of
typesettingskips each run of European terminators once, as go-text does. lottieignores expressions, andwebfontreads 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.