freetype: fix tests for stage2 and Face.getGlyphName()

This commit is contained in:
PiergiorgioZagaria 2022-07-18 10:15:48 +02:00 committed by Stephen Gutekanst
parent 6a5bb2566e
commit 2f1a9f4364
3 changed files with 12 additions and 6 deletions

View file

@ -137,10 +137,8 @@ pub fn getTrackKerning(self: Face, point_size: i32, degree: i32) Error!i32 {
return kerning;
}
pub fn getGlyphName(self: Face, index: u32) Error![]const u8 {
var buf: [32]u8 = undefined;
try intToError(c.FT_Get_Glyph_Name(self.handle, index, &buf, buf.len));
return std.mem.sliceTo(&buf, 0);
pub fn getGlyphName(self: Face, index: u32, buf: []u8) Error!void {
try intToError(c.FT_Get_Glyph_Name(self.handle, index, buf.ptr, @intCast(c_uint, buf.len)));
}
pub fn getPostscriptName(self: Face) ?[:0]const u8 {

View file

@ -9,6 +9,11 @@ pub const c = @import("c");
const std = @import("std");
// Remove once the stage2 compiler fixes pkg std not found
comptime {
_ = @import("utils");
}
test {
std.testing.refAllDeclsRecursive(@import("blob.zig"));
std.testing.refAllDeclsRecursive(@import("buffer.zig"));