mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-01-01 11:12:16 +00:00
Hoist GlyphSize out of nested scopes
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user