From 01f6c1fd8979a548011bbe6ca43f681e952895f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 15 Dec 2022 05:04:39 +0100 Subject: [PATCH] Expose subpixel offsets in `LayoutGlyph` --- src/layout.rs | 4 ++++ src/shape.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/layout.rs b/src/layout.rs index 7cb99a4..0e371f5 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -20,6 +20,10 @@ pub struct LayoutGlyph { pub rtl: bool, /// Cache key, see [CacheKey] pub cache_key: CacheKey, + // X offset in line + pub x_offset: f32, + // Y offset in line + pub y_offset: f32, /// Integer component of X offset in line pub x_int: i32, /// Integer component of Y offset in line diff --git a/src/shape.rs b/src/shape.rs index aeb4577..86a27c9 100644 --- a/src/shape.rs +++ b/src/shape.rs @@ -262,6 +262,8 @@ impl ShapeGlyph { w: x_advance, rtl, cache_key, + x_offset, + y_offset, x_int, y_int, color_opt: self.color_opt,