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:
parent
8019d55fe5
commit
a4792f6e5a
1 changed files with 4 additions and 0 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue