mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 03:57:29 +00:00
Add drawTextCodepoints (#135)
This commit is contained in:
parent
4b2d9b305f
commit
58df62807f
@ -2285,6 +2285,11 @@ pub fn unloadFontData(chars: []GlyphInfo) void {
|
|||||||
cdef.UnloadFontData(@as([*c]GlyphInfo, @ptrCast(chars)), @as(c_int, @intCast(chars.len)));
|
cdef.UnloadFontData(@as([*c]GlyphInfo, @ptrCast(chars)), @as(c_int, @intCast(chars.len)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Draw multiple character (codepoint)
|
||||||
|
pub fn drawTextCodepoints(font: Font, codepoints: []const c_int, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void {
|
||||||
|
cdef.DrawTextCodepoints(font, @as([*c]const c_int, @ptrCast(codepoints)), @as(c_int, @intCast(codepoints.len)), position, fontSize, spacing, tint);
|
||||||
|
}
|
||||||
|
|
||||||
/// Load UTF-8 text encoded from codepoints array
|
/// Load UTF-8 text encoded from codepoints array
|
||||||
pub fn loadUTF8(codepoints: []const c_int) [*:0]u8 {
|
pub fn loadUTF8(codepoints: []const c_int) [*:0]u8 {
|
||||||
return std.mem.span(cdef.LoadUTF8(@as([*c]const c_int, @ptrCast(codepoints)), @as(c_int, @intCast(codepoints.len))));
|
return std.mem.span(cdef.LoadUTF8(@as([*c]const c_int, @ptrCast(codepoints)), @as(c_int, @intCast(codepoints.len))));
|
||||||
|
@ -2285,6 +2285,11 @@ pub fn unloadFontData(chars: []GlyphInfo) void {
|
|||||||
cdef.UnloadFontData(@as([*c]GlyphInfo, @ptrCast(chars)), @as(c_int, @intCast(chars.len)));
|
cdef.UnloadFontData(@as([*c]GlyphInfo, @ptrCast(chars)), @as(c_int, @intCast(chars.len)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Draw multiple character (codepoint)
|
||||||
|
pub fn drawTextCodepoints(font: Font, codepoints: []const c_int, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void {
|
||||||
|
cdef.DrawTextCodepoints(font, @as([*c]const c_int, @ptrCast(codepoints)), @as(c_int, @intCast(codepoints.len)), position, fontSize, spacing, tint);
|
||||||
|
}
|
||||||
|
|
||||||
/// Load UTF-8 text encoded from codepoints array
|
/// Load UTF-8 text encoded from codepoints array
|
||||||
pub fn loadUTF8(codepoints: []const c_int) [*:0]u8 {
|
pub fn loadUTF8(codepoints: []const c_int) [*:0]u8 {
|
||||||
return std.mem.span(cdef.LoadUTF8(@as([*c]const c_int, @ptrCast(codepoints)), @as(c_int, @intCast(codepoints.len))));
|
return std.mem.span(cdef.LoadUTF8(@as([*c]const c_int, @ptrCast(codepoints)), @as(c_int, @intCast(codepoints.len))));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user