~andreafeletto/zig-schrift

c45a140794d5dadda3215d4cd98f111d9f0bac53 — Andrea Feletto 1 year, 8 months ago a57b932
do not use anyopaque for font data
1 files changed, 2 insertions(+), 3 deletions(-)

M schrift.zig
M schrift.zig => schrift.zig +2 -3
@@ 44,10 44,9 @@ pub const SFT = extern struct {
};

pub const Font = opaque {
    extern fn sft_loadmem(data: [*]const anyopaque, size: usize) ?*Font;
    extern fn sft_loadmem(data: [*]const u8, size: usize) ?*Font;
    pub fn loadMem(data: []const u8) !*Font {
        const ptr = @ptrCast([*]const anyopaque, data.ptr);
        return sft_loadmem(ptr, data.len) orelse error.SchriftFontLoading;
        return sft_loadmem(data.ptr, data.len) orelse error.SchriftFontLoading;
    }

    extern fn sft_loadfile(filename: [*:0]const u8) ?*Font;