mirror of
https://github.com/typst/typst
synced 2025-05-21 04:25:28 +08:00
- font - color -> fill - shorthands for families and size - decoration functions - color -> stroke - strength -> thickness - position -> offset - invert offsets: now positive goes downwards just like the rest of typst
57 lines
1.4 KiB
Typst
57 lines
1.4 KiB
Typst
// Test bidirectional text and language configuration.
|
||
|
||
---
|
||
// Test reordering with different top-level paragraph directions.
|
||
#let text = [Text טֶקסט]
|
||
#font!("EB Garamond", "Noto Serif Hebrew")
|
||
#lang!("he") {text}
|
||
#lang!("de") {text}
|
||
|
||
---
|
||
// Test that consecutive, embedded LTR runs stay LTR.
|
||
// Here, we have two runs: "A" and italic "B".
|
||
#let text = [أنت A_B_مطرC]
|
||
#font!("EB Garamond", "Noto Sans Arabic")
|
||
#lang!("ar") {text}
|
||
#lang!("de") {text}
|
||
|
||
---
|
||
// Test that consecutive, embedded RTL runs stay RTL.
|
||
// Here, we have three runs: "גֶ", bold "שֶׁ", and "ם".
|
||
#let text = [Aגֶ*שֶׁ*םB]
|
||
#font!("EB Garamond", "Noto Serif Hebrew")
|
||
#lang!("he") {text}
|
||
#lang!("de") {text}
|
||
|
||
---
|
||
// Test embedding up to level 4 with isolates.
|
||
#font!("EB Garamond", "Noto Serif Hebrew", "Twitter Color Emoji")
|
||
#lang!(dir: rtl)
|
||
א\u{2066}A\u{2067}Bב\u{2069}?
|
||
|
||
---
|
||
// Test hard line break (leads to two paragraphs in unicode-bidi).
|
||
#font!("Noto Sans Arabic", "EB Garamond")
|
||
#lang!("ar")
|
||
Life المطر هو الحياة \
|
||
الحياة تمطر is rain.
|
||
|
||
---
|
||
// Test spacing.
|
||
#font!("EB Garamond", "Noto Serif Hebrew")
|
||
L #h(1cm) ריווחR \
|
||
Lריווח #h(1cm) R
|
||
|
||
---
|
||
// Test inline object.
|
||
#font!("Noto Serif Hebrew", "EB Garamond")
|
||
#lang!("he")
|
||
קרנפיםRh#image("../../res/rhino.png", height: 11pt)inoחיים
|
||
|
||
---
|
||
// Test the `lang` function.
|
||
// Ref: false
|
||
|
||
// Error: 13-16 must be horizontal
|
||
#lang!(dir: ttb)
|