From 52ef17d4e0012e79b0f1db1d4119fbb17ce8d9bd Mon Sep 17 00:00:00 2001 From: Daniel Wennberg Date: Sun, 21 Sep 2025 11:04:32 -0700 Subject: [PATCH] Hoist `GlyphSize` out of nested scopes --- src/font/face.zig | 16 ++++++++-------- src/font/face/freetype.zig | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/font/face.zig b/src/font/face.zig index 9da3c30f6..5eb84c898 100644 --- a/src/font/face.zig +++ b/src/font/face.zig @@ -93,6 +93,14 @@ pub const Variation = struct { }; }; +/// The size and position of a glyph. +pub const GlyphSize = struct { + width: f64, + height: f64, + x: f64, + y: f64, +}; + /// Additional options for rendering glyphs. pub const RenderOptions = struct { /// The metrics that are defining the grid layout. These are usually @@ -214,14 +222,6 @@ pub const RenderOptions = struct { icon, }; - /// The size and position of a glyph. - pub const GlyphSize = struct { - width: f64, - height: f64, - x: f64, - y: f64, - }; - /// Returns true if the constraint does anything. If it doesn't, /// because it neither sizes nor positions the glyph, then this /// returns false. diff --git a/src/font/face/freetype.zig b/src/font/face/freetype.zig index 0dc4c4c03..0ccc84c44 100644 --- a/src/font/face/freetype.zig +++ b/src/font/face/freetype.zig @@ -386,7 +386,7 @@ pub const Face = struct { } /// Get a rect that represents the position and size of the loaded glyph. - fn getGlyphSize(glyph: freetype.c.FT_GlyphSlot) font.face.RenderOptions.Constraint.GlyphSize { + fn getGlyphSize(glyph: freetype.c.FT_GlyphSlot) font.face.GlyphSize { // If we're dealing with an outline glyph then we get the // outline's bounding box instead of using the built-in // metrics, since that's more precise and allows better