mirror of
https://github.com/typst/typst
synced 2025-08-18 00:48:34 +08:00
Every element, like path, text, etc., had a group around them, that defined it's transform. These changes accumulate the transformations of these groups and release them to the element itself. This reduces the overall size of the exported SVG, because those group elements can be removed. Added new SVG path builder using relative coordinates. The previous with global coordinates is still used for glyph paths. Using relative coordinates allows to transform the entire element without changing the entire path.
23 lines
570 B
XML
23 lines
570 B
XML
--- svg-relative-paths ---
|
|
#block[
|
|
#rect(width: 10pt, height: 10pt)
|
|
#block(inset: 10pt)[
|
|
#rect(width: 10pt, height: 10pt)
|
|
#rotate(45deg,
|
|
block(inset: 10pt)[
|
|
#block(inset: 10pt)[
|
|
#rect(width: 10pt, height: 10pt)
|
|
#text("Hello world")
|
|
#rect(width: 10pt, height: 10pt, radius: 10pt)
|
|
#rotate(45deg,
|
|
block(inset: 10pt)[
|
|
#rect(width: 10pt, height: 10pt, radius: 10pt)
|
|
#rect(width: 10pt, height: 10pt, radius: 10pt)
|
|
]
|
|
)
|
|
]
|
|
]
|
|
)
|
|
]
|
|
]
|