Skip to content

v0.11.0

Choose a tag to compare

@kenshaw kenshaw released this 18 Nov 03:10
· 12 commits to main since this release

This release adds the drawing and the text that ivy needs. The renderer draws the same output as v0.10.0 by default. Each new behavior is new API, or changes only a fill that panicked or drew nothing before.

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

Drawing

  • A fill no longer panics on a path with huge coordinates. tiny-skia 0.12 has the same fault (D53).
  • DrawPixmap of an image that is aligned to the pixels skips the stages of the pipeline, with the same bytes. A full page with a mask and an opacity draws in 12 ms in place of 30 ms (D53).
  • Paint.Coverage fills a path with 8 by 8 samples in each pixel. Paint.StrokeAdjust moves a thin stroke onto the pixel grid, as stroke adjustment does in PDF. A hairline on a pixmap of 1 or 2 rows or columns now draws (D54).
  • NewMeshGradient makes a shader that fills a mesh of triangles with a color at each corner, for the shadings of the types 4 to 7 of PDF and PostScript. SpreadModeDecal makes a gradient transparent outside its stops (D55).
  • MaskFromLuminance and Mask.ApplyTransfer make the soft masks of PDF with a backdrop color and a transfer function. Pixmap.RemoveBackdrop and Pixmap.Knockout composite the groups that are not isolated and the knockout groups (D56).

Text and SVG

  • FontDatabase gives the parsed fonts, new faces with variations, a lookup in the cached cmap and the metrics of a face. AutoFontVariations maps a CSS weight, stretch and style to the axes of a variable font. TextStyle takes the features, the language and the spacing of a run, and TextRun.Clusters gives each cluster. FontDatabase.ColorGlyph gives a glyph of COLR or of the table SVG as a tree (D57).
  • svg.ReadDimensions reads the size and the viewBox of an SVG image before the parse. svg.FromXMLTree and svg.FromXMLNode make a tree from roxmltree, and roxmltree.Builder makes a document without XML text. svg.WithZeroSize accepts an image of size zero. :has() in cssselect2 matches in about linear time (D58).
  • typesetting/font/cff exports the predefined charsets of CFF, and draws seac and the FontMatrix of each font dictionary. The go-text commit e8da365e fixes the kerning of fonts such as Calibri and Roboto (D59).