From 8ddc7bcdfa659d99fbc52e076e9510c082bd3404 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Wed, 29 Mar 2023 09:17:49 -0700 Subject: [PATCH] we shall do fonts another way --- src/main.zig | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/main.zig b/src/main.zig index 938b42e..0de2b9b 100644 --- a/src/main.zig +++ b/src/main.zig @@ -267,32 +267,7 @@ fn convertImage(alloc: std.mem.Allocator, filename: [:0]u8, pixels: *[WIDTH * HE // status = c.MagickExtentImage(mw, WIDTH, HEIGHT, null, null); if (status == c.MagickFalse) return error.CouldNotSetExtent; - // TODO: move this into function - { - var annotation_pw = c.NewPixelWand(); - defer { - if (annotation_pw) |pixw| annotation_pw = c.DestroyPixelWand(pixw); - } - var dw = c.NewDrawingWand(); - defer { - if (dw) |d| dw = c.DestroyDrawingWand(d); - } - status = c.PixelSetColor(pw, "black"); - if (status == c.MagickFalse) - return error.CouldNotSetColor; - c.DrawSetFillColor(dw, annotation_pw); - - status = c.DrawSetFont(dw, "DejaVu-Serif"); - if (status == c.MagickFalse) - return error.CouldNotSetFont; - c.DrawSetFontSize(dw, 20); - c.DrawSetStrokeColor(dw, annotation_pw); - c.DrawAnnotation(dw, 0, 0, "hello world"); - status = c.MagickDrawImage(mw, dw); - if (status == c.MagickFalse) - return error.CouldNotDrawAnnotationOnImage; - } // We make the image monochrome by quantizing the image with 2 colors in the // gray colorspace. See: // https://www.imagemagick.org/Usage/quantize/#monochrome