diff options
| author | Daniel Wennberg <daniel.wennberg@gmail.com> | 2025-07-18 00:56:14 -0700 |
|---|---|---|
| committer | Daniel Wennberg <daniel.wennberg@gmail.com> | 2025-07-18 00:58:08 -0700 |
| commit | 652bae73790fe8e708177dcdf1b7041a39d2bd8e (patch) | |
| tree | 7716dae2e60b8e5c4f71eab7d4005aac4e4c7cf9 /src/font/Collection.zig | |
| parent | a7c560c159921b744d45192a9d1af3df23f6b458 (diff) | |
Update a straggling name and signature
Diffstat (limited to 'src/font/Collection.zig')
| -rw-r--r-- | src/font/Collection.zig | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/font/Collection.zig b/src/font/Collection.zig index 14279f787..2bc6159b7 100644 --- a/src/font/Collection.zig +++ b/src/font/Collection.zig @@ -451,8 +451,9 @@ pub fn setSize(self: *Collection, size: DesiredSize) !void { try self.updateMetrics(); } -pub fn setReferenceMetric(self: *Collection, index: Index, scale_reference: ReferenceMetric) !void { - var entry = try self.getEntry(index); +/// Update the scale reference metric associated with a face. This will +/// also rescale the face's size accordingly. +pub fn setScaleReference(self: *Collection, entry: *Entry, scale_reference: ReferenceMetric) !void { entry.scale_reference = scale_reference; if (self.load_options) |opts| { const primary_entry = self.getEntry(.{ .idx = 0 }) catch null; @@ -1206,7 +1207,7 @@ test "adjusted sizes" { ) })); inline for ([_][]const u8{ "ex_height", "cap_height" }) |metric| { - try c.setReferenceMetric(fallback_idx, @field(ReferenceMetric, metric)); + try c.setScaleReference(try c.getEntry(fallback_idx), @field(ReferenceMetric, metric)); // The chosen metric should match. { @@ -1259,7 +1260,7 @@ test "adjusted sizes" { } // Test em_size giving exact font size equality - try c.setReferenceMetric(symbol_idx, .em_size); + try c.setScaleReference(try c.getEntry(symbol_idx), .em_size); try std.testing.expectEqual( (try c.getFace(.{ .idx = 0 })).size.points, |
