mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
- Makes errors fatal, so that a phase is only reached when all previous phases were error-free - Parsing still recovers and can produce multiple errors - Evaluation fails fast and can thus produce only a single error (except for parse errors due to an import) - The single error that could occur during execution is removed for now - Removes Value::Error variant
48 lines
1.0 KiB
XML
48 lines
1.0 KiB
XML
// Test the `circle` function.
|
|
|
|
---
|
|
// Test auto sizing.
|
|
|
|
Auto-sized circle. \
|
|
#circle(fill: rgb("eb5278"))[
|
|
#align!(center, center)
|
|
But, soft!
|
|
]
|
|
|
|
Center-aligned rect in auto-sized circle.
|
|
#circle(fill: forest)[
|
|
#align!(center, center)
|
|
#rect!(fill: conifer)
|
|
#pad!(5pt)
|
|
But, soft!
|
|
]
|
|
|
|
100%-width rect in auto-sized circle. \
|
|
#circle(fill: forest)[
|
|
#rect!(width: 100%, fill: conifer)
|
|
But, soft! what light through yonder window breaks?
|
|
]
|
|
|
|
Expanded by height.
|
|
#circle(fill: conifer)[A \ B \ C]
|
|
|
|
---
|
|
// Test relative sizing.
|
|
#rect(width: 100%, height: 50pt, fill: rgb("aaa"))[
|
|
#align!(center, center)
|
|
#font!(fill: white)
|
|
#circle(radius: 10pt, fill: eastern)[A]
|
|
#circle(height: 60%, fill: eastern)[B]
|
|
#circle(width: 20% + 20pt, fill: eastern)[C]
|
|
]
|
|
|
|
---
|
|
// Radius wins over width and height.
|
|
// Error: 23-34 unexpected argument
|
|
#circle(radius: 10pt, width: 50pt, height: 100pt, fill: eastern)
|
|
|
|
---
|
|
// Width wins over height.
|
|
// Error: 9-21 unexpected argument
|
|
#circle(height: 50pt, width: 20pt, fill: eastern)
|