mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-17 21:12:39 +00:00
font/shaper: hook functions can't fail
This commit is contained in:
@@ -98,7 +98,7 @@ pub const Shaper = struct {
|
||||
self.unichars.deinit(alloc);
|
||||
}
|
||||
|
||||
fn reset(self: *RunState) !void {
|
||||
fn reset(self: *RunState) void {
|
||||
self.codepoints.clearRetainingCapacity();
|
||||
self.unichars.clearRetainingCapacity();
|
||||
}
|
||||
@@ -644,8 +644,8 @@ pub const Shaper = struct {
|
||||
pub const RunIteratorHook = struct {
|
||||
shaper: *Shaper,
|
||||
|
||||
pub fn prepare(self: *RunIteratorHook) !void {
|
||||
try self.shaper.run_state.reset();
|
||||
pub fn prepare(self: *RunIteratorHook) void {
|
||||
self.shaper.run_state.reset();
|
||||
// log.warn("----------- run reset -------------", .{});
|
||||
}
|
||||
|
||||
@@ -681,7 +681,7 @@ pub const Shaper = struct {
|
||||
});
|
||||
}
|
||||
|
||||
pub fn finalize(self: RunIteratorHook) !void {
|
||||
pub fn finalize(self: RunIteratorHook) void {
|
||||
_ = self;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -175,7 +175,7 @@ pub const Shaper = struct {
|
||||
pub const RunIteratorHook = struct {
|
||||
shaper: *Shaper,
|
||||
|
||||
pub fn prepare(self: RunIteratorHook) !void {
|
||||
pub fn prepare(self: RunIteratorHook) void {
|
||||
// Reset the buffer for our current run
|
||||
self.shaper.hb_buf.reset();
|
||||
self.shaper.hb_buf.setContentType(.unicode);
|
||||
@@ -191,7 +191,7 @@ pub const Shaper = struct {
|
||||
self.shaper.hb_buf.add(cp, cluster);
|
||||
}
|
||||
|
||||
pub fn finalize(self: RunIteratorHook) !void {
|
||||
pub fn finalize(self: RunIteratorHook) void {
|
||||
self.shaper.hb_buf.guessSegmentProperties();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -73,7 +73,7 @@ pub const RunIterator = struct {
|
||||
var current_font: font.Collection.Index = .{};
|
||||
|
||||
// Allow the hook to prepare
|
||||
try self.hooks.prepare();
|
||||
self.hooks.prepare();
|
||||
|
||||
// Initialize our hash for this run.
|
||||
var hasher = Hasher.init(0);
|
||||
@@ -283,7 +283,7 @@ pub const RunIterator = struct {
|
||||
}
|
||||
|
||||
// Finalize our buffer
|
||||
try self.hooks.finalize();
|
||||
self.hooks.finalize();
|
||||
|
||||
// Add our length to the hash as an additional mechanism to avoid collisions
|
||||
autoHash(&hasher, j - self.i);
|
||||
|
||||
Reference in New Issue
Block a user