Hoist `GlyphSize` out of nested scopes
parent
333a32208e
commit
52ef17d4e0
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue