diff --git a/src/freetype.zig b/src/freetype.zig index 21a75b9a..fd146f59 100644 --- a/src/freetype.zig +++ b/src/freetype.zig @@ -8,6 +8,8 @@ pub const c = @cImport({ @cInclude("freetype/ftstroke.h"); @cInclude("freetype/fttrigon.h"); @cInclude("freetype/ftsynth.h"); + @cInclude("freetype/otsvg.h"); + @cInclude("freetype/ftmodapi.h"); }); pub const Affine23 = c.FT_Affine23; @@ -275,7 +277,8 @@ pub const LoadFlags = packed struct(c_int) { color: bool = false, compute_metrics: bool = false, bitmap_metrics_only: bool = false, - _padding0: u9 = 0, + no_svg: bool = false, + _padding0: u8 = 0, }; pub const OpenFlags = packed struct(c_int) { @@ -1044,6 +1047,10 @@ pub const Library = struct { pub fn setLcdFilter(self: Library, lcd_filter: LcdFilter) Error!void { return intToError(c.FT_Library_SetLcdFilter(self.handle, @intFromEnum(lcd_filter))); } + + pub fn setProperty(self: Library, module_name: [*c]const u8, property_name: [*c]const u8, value: *const anyopaque) Error!void { + return intToError(c.FT_Property_Set(self.handle, module_name, property_name, value)); + } }; pub const OpenArgs = struct { @@ -1567,6 +1574,7 @@ pub const Error = error{ BbxTooBig, CorruptedFontHeader, CorruptedFontGlyphs, + MissingSVGHooks, }; pub fn intToError(err: c_int) Error!void { @@ -1661,6 +1669,7 @@ pub fn intToError(err: c_int) Error!void { c.FT_Err_Bbx_Too_Big => Error.BbxTooBig, c.FT_Err_Corrupted_Font_Header => Error.CorruptedFontHeader, c.FT_Err_Corrupted_Font_Glyphs => Error.CorruptedFontGlyphs, + c.FT_Err_Missing_SVG_Hooks => Error.MissingSVGHooks, else => unreachable, }; }