I’m using freetype+harfbuzz.
When I was trying to compile next code:
var ft_library: freetype.FT_Library = undefined;
var ft_face: freetype.FT_Face = undefined;
var ft_error: freetype.FT_Error = undefined;
ft_error = freetype.FT_Init_FreeType(&ft_library);
if (ft_error != 0) freetypePanic("Failed init FreeType!\n");
defer _ = freetype.FT_Done_FreeType(ft_library);
ft_error = freetype.FT_New_Face(ft_library, "FiraCodeNerdFont-Regular.ttf", 0, &ft_face);
if (ft_error != 0) freetypePanic("Failed create new face!\n");
defer _ = freetype.FT_Done_Face(ft_face);
ft_error = freetype.FT_Set_Char_Size(ft_face, FONT_SIZE * 64, FONT_SIZE * 64, 0, 0);
if (ft_error != 0) freetypePanic("Failed set char size!\n");
const hb_font = harfbuzz.hb_ft_font_create(ft_face, null);
I got next error:
src\main.zig:42:48: error: expected type '[*c]cimport.struct_FT_FaceRec_', found '[*c]cimport.struct_FT_FaceRec_'
const hb_font = harfbuzz.hb_ft_font_create(ft_face, null);
^~~~~~~
src\main.zig:42:48: note: pointer type child 'cimport.struct_FT_FaceRec_' cannot cast into pointer type child 'cimport.struct_FT_FaceRec_'
E:\_projects\zig\qgen-next-sdl2\.zig-cache\o\c096b3fe556b85bb8e096e8882be37a5\cimport.zig:2052:39: note: struct declared here
pub const struct_FT_FaceRec_ = extern struct {
~~~~~~~^~~~~~
E:\_projects\zig\qgen-next-sdl2\.zig-cache\o\23d59c28d5bc660e4866740be0eeb459\cimport.zig:3008:39: note: struct declared here
pub const struct_FT_FaceRec_ = extern struct {
~~~~~~~^~~~~~
E:\_projects\zig\qgen-next-sdl2\.zig-cache\o\23d59c28d5bc660e4866740be0eeb459\cimport.zig:3142:42: note: parameter type declared here
pub extern fn hb_ft_font_create(ft_face: FT_Face, destroy: hb_destroy_func_t) ?*hb_font_t;