package core:engine/font
Index
Constants (0)
This section is empty.
Variables (0)
This section is empty.
Procedures (5)
Procedure Groups (0)
This section is empty.
Types
font_render_opt ¶
font_render_opt :: struct { scale: [2]f32, // (0,0) -> (1,1) offset: [2]f32, pivot: [2]f32, stroke_color: [4]f32, // if thickness == 0, ignore color: runtime.Maybe($T=[4]f32), area: runtime.Maybe($T=[2]f32), thickness: f32, // if 0, no stroke flag: engine.resource_usage, }
Related Procedures With Parameters
font_render_opt2 ¶
font_render_opt2 :: struct { opt: font_render_opt, ranges: []font_render_range, }
Related Procedures With Parameters
freetype_err ¶
freetype_err :: union { freetype.Error, runtime.Allocator_Error, }
Related Procedures With Returns
Constants
This section is empty.
Variables
This section is empty.
Procedures
font_deinit ¶
font_deinit :: proc(self: ^font) -> (err: freetype_err = nil) {…}
Deinitializes and cleans up font resources
Inputs:
self: Pointer to the font to deinitialize
Returns:
An error if deinitialization failed
font_init ¶
font_init :: proc(_fontData: []u8, #any_int _faceIdx: int = 0, allocator := context.allocator) -> (font: ^font = nil, err: freetype_err = nil) {…}
Initializes a font from font data
Inputs:
_fontData: Font file data as bytes
_faceIdx: Face index in the font file (default: 0)
allocator: Allocator to use (default: context.allocator)
Returns:
Pointer to the initialized font, or nil on error
An error if initialization failed
Allocator error if allocation failed
font_render_string ¶
font_render_string :: proc(self: ^font, _str: string, _renderOpt: font_render_opt, allocator := context.allocator) -> (res: ^geometry.raw_shape, err: geometry.shape_error = nil) {…}
Renders a string using the font
Inputs:
self: Pointer to the font
_str: String to render
_renderOpt: Rendering options
allocator: Allocator to use (default: context.allocator)
Returns:
Pointer to the raw shape containing the rendered geometry
An error if rendering failed
Allocator error if allocation failed
font_render_string2 ¶
font_render_string2 :: proc(_str: string, _renderOpt: font_render_opt2, allocator := context.allocator) -> (res: ^geometry.raw_shape, err: geometry.shape_error = nil) {…}
font_set_scale ¶
Sets the scale of the font
Inputs:
self: Pointer to the font
scale: Scale factor for the font
Returns:
None
Procedure Groups
This section is empty.
Source Files
Generation Information
Generated with odin version dev-v0.0.1 (vendor "odin") Linux_amd64 @ 2026-01-30 10:23:15.876086002 +0000 UTC