RTL tracking test

This commit is contained in:
Laurenz 2021-11-20 13:26:28 +01:00
parent c020707ebc
commit 0ad0fa5a05
3 changed files with 7 additions and 3 deletions

View File

@ -163,7 +163,7 @@ pub fn font(ctx: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
let fallback = args.named("fallback")?;
let style = args.named("style")?;
let weight = args.named("weight")?;
let tracking = args.named::<f64>("tracking")?;
let tracking = args.named("tracking")?;
let stretch = args.named("stretch")?;
let size = args.named::<Linear>("size")?.or_else(|| args.find());
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);
ShapedText {
@ -563,7 +563,7 @@ fn shape_segment<'a>(
}
/// 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() {
return;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -6,3 +6,7 @@ I saw Zoe yӛsterday, on the tram.
---
I'm in#font(tracking: 0.3)[ spaace]!
---
#font("Noto Serif Hebrew", tracking: 0.3)
טֶקסט