diff options
| author | Qwerasd <qwerasd205@users.noreply.github.com> | 2025-05-26 21:39:15 -0600 |
|---|---|---|
| committer | Qwerasd <qwerasd205@users.noreply.github.com> | 2025-05-26 21:50:14 -0600 |
| commit | 2384bd69cc25db7228dcb2e90ea1d296bbf0ba84 (patch) | |
| tree | 5b1c2f912bb073b5fc2721024f556c86b89c4e23 /src/font/Collection.zig | |
| parent | 2fe2ccdbde58557f17ba1787551dfb0666b6a147 (diff) | |
style: use decl literals
This commit changes a LOT of areas of the code to use decl literals
instead of redundantly referring to the type.
These changes were mostly driven by some regex searches and then manual
adjustment on a case-by-case basis.
I almost certainly missed quite a few places where decl literals could
be used, but this is a good first step in converting things, and other
instances can be addressed when they're discovered.
I tested GLFW+Metal and building the framework on macOS and tested a GTK
build on Linux, so I'm 99% sure I didn't introduce any syntax errors or
other problems with this. (fingers crossed)
Diffstat (limited to 'src/font/Collection.zig')
| -rw-r--r-- | src/font/Collection.zig | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/font/Collection.zig b/src/font/Collection.zig index 59f89d402..8533331bc 100644 --- a/src/font/Collection.zig +++ b/src/font/Collection.zig @@ -55,7 +55,7 @@ load_options: ?LoadOptions = null, pub fn init() Collection { // Initialize our styles array, preallocating some space that is // likely to be used. - return .{ .faces = StyleArray.initFill(.{}) }; + return .{ .faces = .initFill(.{}) }; } pub fn deinit(self: *Collection, alloc: Allocator) void { @@ -707,7 +707,7 @@ test "add full" { defer c.deinit(alloc); for (0..Index.Special.start - 1) |_| { - _ = try c.add(alloc, .regular, .{ .loaded = try Face.init( + _ = try c.add(alloc, .regular, .{ .loaded = try .init( lib, testFont, .{ .size = .{ .points = 12 } }, @@ -755,7 +755,7 @@ test getFace { var c = init(); defer c.deinit(alloc); - const idx = try c.add(alloc, .regular, .{ .loaded = try Face.init( + const idx = try c.add(alloc, .regular, .{ .loaded = try .init( lib, testFont, .{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } }, @@ -779,7 +779,7 @@ test getIndex { var c = init(); defer c.deinit(alloc); - _ = try c.add(alloc, .regular, .{ .loaded = try Face.init( + _ = try c.add(alloc, .regular, .{ .loaded = try .init( lib, testFont, .{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } }, @@ -811,7 +811,7 @@ test completeStyles { defer c.deinit(alloc); c.load_options = .{ .library = lib }; - _ = try c.add(alloc, .regular, .{ .loaded = try Face.init( + _ = try c.add(alloc, .regular, .{ .loaded = try .init( lib, testFont, .{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } }, @@ -838,7 +838,7 @@ test setSize { defer c.deinit(alloc); c.load_options = .{ .library = lib }; - _ = try c.add(alloc, .regular, .{ .loaded = try Face.init( + _ = try c.add(alloc, .regular, .{ .loaded = try .init( lib, testFont, .{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } }, @@ -861,7 +861,7 @@ test hasCodepoint { defer c.deinit(alloc); c.load_options = .{ .library = lib }; - const idx = try c.add(alloc, .regular, .{ .loaded = try Face.init( + const idx = try c.add(alloc, .regular, .{ .loaded = try .init( lib, testFont, .{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } }, @@ -885,7 +885,7 @@ test "hasCodepoint emoji default graphical" { defer c.deinit(alloc); c.load_options = .{ .library = lib }; - const idx = try c.add(alloc, .regular, .{ .loaded = try Face.init( + const idx = try c.add(alloc, .regular, .{ .loaded = try .init( lib, testEmoji, .{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } }, @@ -908,7 +908,7 @@ test "metrics" { defer c.deinit(alloc); c.load_options = .{ .library = lib }; - _ = try c.add(alloc, .regular, .{ .loaded = try Face.init( + _ = try c.add(alloc, .regular, .{ .loaded = try .init( lib, testFont, .{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } }, |
