Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 21 Oct 19:10
· 56 commits to main since this release
Immutable release. Only release title and notes can be modified.

Added

  • paint-order on shapes, markers, text and text decoration lines, as Chromium paints it: the stroke of
    the boxes in the OSI model from Wikimedia (paint-order: stroke) shows its outer half only. The
    paint_order argument of install() turns it off.

Changed

  • Text decoration lines take their thickness and place from the font tables, as WeasyPrint draws
    text-decoration on HTML text, so SVG text and HTML text in one PDF get the same lines. The underline and
    the overline run straight through the glyphs: WeasyPrint skips no ink. This departs from Chromium on
    purpose (a tenth of the font size, ink skipped) and matches resvg; text-decoration-thickness: auto
    allows both.

Fixed

  • A dash that runs through the start point of a closed shape is one dash, with its line join, as in
    Chromium. PDFium drew two dashes that met there: a light seam across the stroke and a notch on its
    outer edge, and no miter at the corner of a rectangle. Every dash keeps its place.
  • A translucent stroke over a fill shows the fill under it, as in Chromium. WeasyPrint filled and stroked
    in one operator, a knockout object in PDF, so the stroke showed the white behind the shape.
  • Text laid out one character at a time draws its decoration lines character by character, as Chromium,
    Safari and Firefox do: each character carries them over its advance and its letter-spacing, and the room
    textLength, x and dx add between characters stays bare. Text with several y or dy values gets its
    lines too, under each character on its own baseline. On a textPath the last character carries its
    letter-spacing as well.
  • An arc of a zero radius in path data draws the straight line SVG asks for: WeasyPrint sent it off by the
    current point, which broke every slice of a Highcharts pie.
  • The text after a child of a <tspan> is drawn: WeasyPrint dropped it, so Don<wbr/>e in a Polarion chart
    label read "Don".
  • Text in a <foreignObject> sits on the line where Chromium and Safari put it: Blink rounds the font
    metrics to whole px and paints the baseline on a whole px. Mermaid labels sat up to 1 px lower.
  • The noise of feTurbulence is computed at 2 px per CSS px: at 1 it came out blurred once printed or
    viewed at 2x.
  • A blurred rect leaves no seam where its blurred edges meet its middle.
  • The space that ends a text moves no anchor: text-anchor="end" put the text a space too far left.
  • A wide arc in path data is drawn as curves of at most 90 degrees: WeasyPrint drew a half circle as one
    curve, which bulged the band of the flag of Brazil.
  • text-anchor places each text chunk of SVG 2 as one: a chunk starts only at a character with an absolute
    x or y, and the text after a positioned <tspan> belongs to it. WeasyPrint anchored that text with the
    <text>, so the second line of a label in a Wikimedia OSI model diagram sat off its center.
  • A blurred filled shape other than a plain rect fades as in Chromium: its coverage is blurred and drawn
    as a mesh of shaded triangles. The levels of the nearest edge left rings in the tail, made a shape
    thinner than a few deviations dark and sharp (the lens ring of the OpenStreetMap logo, the chest of
    Tux) and left white glints where the grown paint had holes (the Inkscape logo).
  • The blurred edge of a plain rect follows the Gaussian to about one level of 255, its tail included:
    one shading over 8 deviations showed bands in PDFium, and the paint stopped at 2.15 deviations.
  • Any blurred content made of paths fades as in Chromium: a group, a stroke, several shapes and colors.
    Its coverage per color is read back from the PDF operators, blurred and drawn as a mesh of shaded
    triangles, each color mixed in by its share. The levels of the nearest edge drew a mitered corner on a
    blurred square (resvg filters-filter--on-the-root-svg) and a stroke in steps with a hard inner edge.
    Text, images, gradients, patterns, masks, blend modes and dashes keep the levels.
  • The gradient of a blurred shape pads past the box of the shape: the pattern WeasyPrint makes of it
    repeated there, which cut the shadow of the map in the OpenStreetMap logo with hard straight edges.

Full changelog: v0.1.0...v0.2.0