stevee

My wayland statusbar
git clone git://gtms.dev/stevee
Log | Files | Refs | Submodules | README | LICENSE

commit ba7271cf9469019908fad6cff871b57d54aaaaa1
parent f2cfbc477f3e962d13118e8c43fe5eef68ef5c6c
Author: Andrea Feletto <andrea@andreafeletto.com>
Date:   Fri, 20 May 2022 00:58:22 +0200

deps: use zig-fcft by novakane

Diffstat:
M.gitmodules | 6+++---
Msrc/main.zig | 2+-
Msrc/render.zig | 6+++---
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -4,12 +4,12 @@ [submodule "deps/zig-pixman"] path = deps/zig-pixman url = https://github.com/ifreund/zig-pixman -[submodule "deps/zig-fcft"] - path = deps/zig-fcft - url = https://git.sr.ht/~andreafeletto/zig-fcft [submodule "deps/zig-udev"] path = deps/zig-udev url = https://git.sr.ht/~andreafeletto/zig-udev [submodule "deps/zig-clap"] path = deps/zig-clap url = https://github.com/Hejsil/zig-clap +[submodule "deps/zig-fcft"] + path = deps/zig-fcft + url = https://git.sr.ht/~novakane/zig-fcft diff --git a/src/main.zig b/src/main.zig @@ -25,7 +25,7 @@ pub fn main() anyerror!void { var gpa: heap.GeneralPurposeAllocator(.{}) = .{}; defer _ = gpa.deinit(); - fcft.init(.auto, false, .warning); + _ = fcft.init(.auto, false, .warning); // cli arguments const params = comptime [_]clap.Param(clap.Help){ diff --git a/src/render.zig b/src/render.zig @@ -69,7 +69,7 @@ pub fn renderClock(bar: *Bar) !void { // resterize const font = state.config.font; - const run = try fcft.TextRun.rasterizeUtf32(font, runes, .default); + const run = try font.rasterizeTextRunUtf32(runes, .default); defer run.destroy(); // compute total width @@ -132,7 +132,7 @@ pub fn renderModules(bar: *Bar) !void { // rasterize const font = state.config.font; - const run = try fcft.TextRun.rasterizeUtf32(font, runes, .default); + const run = try font.rasterizeTextRunUtf32(runes, .default); defer run.destroy(); // compute total width @@ -214,7 +214,7 @@ fn renderTag( }; const font = state.config.font; var char = pixman.Image.createSolidFill(glyph_color).?; - const glyph = try fcft.Glyph.rasterizeUtf32(font, tag.label, .default); + const glyph = try font.rasterizeCharUtf32(tag.label, .default); const x = offset + @divFloor(size - glyph.width, 2); const y = @divFloor(size - glyph.height, 2); pixman.Image.composite32(.over, char, glyph.pix, pix, 0, 0, 0, 0, x, y, glyph.width, glyph.height);