cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
846 stars 35 forks source link

[bug] different SVG and PDF output #631

Closed tapyu closed 3 months ago

tapyu commented 3 months ago

Maybe related to #621 ??

#import "@preview/cetz:0.2.2"

#import cetz.draw: *

#set page(width: auto, height: auto, margin: .5cm)

#show box: set block(spacing: 5pt)

#cetz.canvas({
  content(
    (),
    box(align(center)[
      PLL

      performance
    ],
    stroke: (thickness: 1pt), inset: 10pt),
    name: "pll-performance",
    anchor: "south-west"
  )

  line(
    ("pll-performance.north"),
    (rel: (0,1)),
    mark: (end: ">"),
    name: "pll-performance-1"
  )

  content(
    "pll-performance-1.end",
    align(center)[
      Phase error variance

      Mean time beetween cicle slips

      Frequency unlock/drop lock
    ],
    anchor: "south",
    padding: 0pt
  )
})

image

In the PDF output, there is a wrong offset when content is anchored in line. In SVG, it is correct. In #621, it is the other way around. maybe both bugs are related.