mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
RTL tracking test
This commit is contained in:
parent
c020707ebc
commit
0ad0fa5a05
@ -163,7 +163,7 @@ pub fn font(ctx: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
|
|||||||
let fallback = args.named("fallback")?;
|
let fallback = args.named("fallback")?;
|
||||||
let style = args.named("style")?;
|
let style = args.named("style")?;
|
||||||
let weight = args.named("weight")?;
|
let weight = args.named("weight")?;
|
||||||
let tracking = args.named::<f64>("tracking")?;
|
let tracking = args.named("tracking")?;
|
||||||
let stretch = args.named("stretch")?;
|
let stretch = args.named("stretch")?;
|
||||||
let size = args.named::<Linear>("size")?.or_else(|| args.find());
|
let size = args.named::<Linear>("size")?.or_else(|| args.find());
|
||||||
let top_edge = args.named("top-edge")?;
|
let top_edge = args.named("top-edge")?;
|
||||||
@ -264,7 +264,7 @@ pub fn shape<'a>(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
track_segment(&mut glyphs, style.tracking);
|
track(&mut glyphs, style.tracking);
|
||||||
|
|
||||||
let (size, baseline) = measure(ctx, &glyphs, style);
|
let (size, baseline) = measure(ctx, &glyphs, style);
|
||||||
ShapedText {
|
ShapedText {
|
||||||
@ -563,7 +563,7 @@ fn shape_segment<'a>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Apply tracking to a slice of shaped glyphs.
|
/// Apply tracking to a slice of shaped glyphs.
|
||||||
fn track_segment(glyphs: &mut [ShapedGlyph], tracking: Em) {
|
fn track(glyphs: &mut [ShapedGlyph], tracking: Em) {
|
||||||
if tracking.is_zero() {
|
if tracking.is_zero() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.5 KiB |
@ -6,3 +6,7 @@ I saw Zoe yӛsterday, on the tram.
|
|||||||
|
|
||||||
---
|
---
|
||||||
I'm in#font(tracking: 0.3)[ spaace]!
|
I'm in#font(tracking: 0.3)[ spaace]!
|
||||||
|
|
||||||
|
---
|
||||||
|
#font("Noto Serif Hebrew", tracking: 0.3)
|
||||||
|
טֶקסט
|
||||||
|
Loading…
x
Reference in New Issue
Block a user