freetype: initial import @ 4e2b158

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Ali Chraghi 2022-05-22 23:50:21 -07:00 committed by Stephen Gutekanst
parent 0d2675507d
commit b50dade2fd
20 changed files with 2252 additions and 0 deletions

32
freetype/src/Stroker.zig Normal file
View file

@ -0,0 +1,32 @@
const c = @import("c.zig");
const Error = @import("error.zig").Error;
const convertError = @import("error.zig").convertError;
const Stroker = @This();
pub const StrokerLineCap = enum(u2) {
butt = c.FT_STROKER_LINECAP_BUTT,
round = c.FT_STROKER_LINECAP_ROUND,
square = c.FT_STROKER_LINECAP_SQUARE,
};
pub const StrokerLineJoin = enum(u2) {
round = c.FT_STROKER_LINEJOIN_ROUND,
bevel = c.FT_STROKER_LINEJOIN_BEVEL,
miterVariable = c.FT_STROKER_LINEJOIN_MITER_VARIABLE,
miterFixed = c.FT_STROKER_LINEJOIN_MITER_FIXED,
};
handle: c.FT_Stroker,
pub fn init(handle: c.FT_Stroker) Stroker {
return Stroker{ .handle = handle };
}
pub fn set(self: Stroker, radius: i32, line_cap: StrokerLineCap, line_join: StrokerLineJoin, miter_limit: i32) void {
c.FT_Stroker_Set(self.handle, radius, @enumToInt(line_cap), @enumToInt(line_join), miter_limit);
}
pub fn deinit(self: Stroker) void {
c.FT_Stroker_Done(self.handle);
}