font: remove unused fields from Glyph

We can reintroduce `advance` if we ever want to do proportional string
drawing, but we don't use it anywhere right now. And we also don't need
`sprite` anymore since that was just there to disable constraints for
sprites back when we did them on the GPU.
This commit is contained in:
Qwerasd
2025-07-06 15:53:59 -06:00
parent f40c9a4d38
commit b10b0f06c3
5 changed files with 0 additions and 18 deletions

View File

@ -17,9 +17,3 @@ offset_y: i32,
/// be normalized to be between 0 and 1 prior to use in shaders.
atlas_x: u32,
atlas_y: u32,
/// horizontal position to increase drawing position for strings
advance_x: f32,
/// Whether we drew this glyph ourselves with the sprite font.
sprite: bool = false,

View File

@ -333,7 +333,6 @@ pub const Face = struct {
.offset_y = 0,
.atlas_x = 0,
.atlas_y = 0,
.advance_x = 0,
};
const metrics = opts.grid_metrics;
@ -498,10 +497,6 @@ pub const Face = struct {
break :offset_x result;
};
// Get our advance
var advances: [glyphs.len]macos.graphics.Size = undefined;
_ = self.font.getAdvancesForGlyphs(.horizontal, &glyphs, &advances);
return .{
.width = px_width,
.height = px_height,
@ -509,7 +504,6 @@ pub const Face = struct {
.offset_y = offset_y,
.atlas_x = region.x,
.atlas_y = region.y,
.advance_x = @floatCast(advances[0].width),
};
}

View File

@ -373,7 +373,6 @@ pub const Face = struct {
.offset_y = 0,
.atlas_x = 0,
.atlas_y = 0,
.advance_x = 0,
};
// For synthetic bold, we embolden the glyph.
@ -662,7 +661,6 @@ pub const Face = struct {
.offset_y = offset_y,
.atlas_x = region.x,
.atlas_y = region.y,
.advance_x = f26dot6ToFloat(glyph.*.advance.x),
};
}

View File

@ -235,7 +235,6 @@ pub const Face = struct {
.offset_y = 0,
.atlas_x = region.x,
.atlas_y = region.y,
.advance_x = 0,
};
}

View File

@ -195,7 +195,6 @@ pub fn renderGlyph(
.offset_y = 0,
.atlas_x = 0,
.atlas_y = 0,
.advance_x = 0,
};
const metrics = self.metrics;
@ -227,8 +226,6 @@ pub fn renderGlyph(
.offset_y = @as(i32, @intCast(region.height +| canvas.clip_bottom)) - @as(i32, @intCast(padding_y)),
.atlas_x = region.x,
.atlas_y = region.y,
.advance_x = @floatFromInt(width),
.sprite = true,
};
}