freetype: examples: add help/usage output to single-glyph if arg not specified

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-26 19:04:54 -07:00
parent 8019d55fe5
commit a4792f6e5a

View file

@ -19,6 +19,10 @@ pub fn main() !void {
const face = try lib.createFace("upstream/assets/FiraSans-Regular.ttf", 0);
try face.setCharSize(60 * 48, 0, 50, 0);
if (args.len < 2) {
std.debug.print("usage: single-glyph 'a'\n", .{});
std.process.exit(1);
}
try face.loadChar(args[1][0], .{ .render = true });
const bitmap = face.glyph().bitmap();