diff --git a/src/freetype.zig b/src/freetype.zig index 21a75b9a..9390607a 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; @@ -260,6 +262,7 @@ pub const LoadFlags = packed struct(c_int) { force_autohint: bool = false, crop_bitmap: bool = false, pedantic: bool = false, + advance_only: bool = false, ignore_global_advance_with: bool = false, no_recurse: bool = false, ignore_transform: bool = false, @@ -275,7 +278,9 @@ pub const LoadFlags = packed struct(c_int) { color: bool = false, compute_metrics: bool = false, bitmap_metrics_only: bool = false, - _padding0: u9 = 0, + svg_only: bool = false, + no_svg: bool = false, + _padding0: u2 = 0, }; pub const OpenFlags = packed struct(c_int) { @@ -1044,6 +1049,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 +1576,7 @@ pub const Error = error{ BbxTooBig, CorruptedFontHeader, CorruptedFontGlyphs, + MissingSVGHooks, }; pub fn intToError(err: c_int) Error!void { @@ -1661,6 +1671,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, }; }