package vendor:fontstash
⌘K
Ctrl+K
or
/
Index
Variables (0)
This section is empty.
Procedure Groups (1)
Types
AlignHorizontal ¶
AlignHorizontal :: enum int { LEFT, CENTER, RIGHT, }
Related Procedures With Parameters
AlignVertical ¶
AlignVertical :: enum int { TOP, MIDDLE, BOTTOM, BASELINE, }
Related Procedures With Parameters
Font ¶
Font :: struct { name: string, // allocated info: stb_truetype.fontinfo, loadedData: []u8, freeLoadedData: bool, // in case you dont want loadedData to be removed ascender: f32, descender: f32, lineHeight: f32, glyphs: [dynamic]Glyph, lut: [256]int, fallbacks: [20]int, nfallbacks: int, }
Related Procedures With Parameters
FontContext ¶
FontContext :: struct { fonts: [dynamic]Font, // always assuming user wants to resize nodes: [dynamic]AtlasNode, // actual pixels textureData: []u8, // allocated using context.allocator width: int, height: int, // 1 / texture_atlas_width, 1 / texture_atlas_height itw: f32, ith: f32, // state states: []State, state_count: int, // used states location: QuadLocation, // dirty rectangle of the texture region that was updated dirtyRect: [4]f32, // callbacks with userData passed userData: rawptr, // called when a texture is expanded and needs handling callbackResize: proc(data: rawptr, w, h: int), // called in state_end to update the texture region that changed callbackUpdate: proc(data: rawptr, dirtyRect: [4]f32, textureData: rawptr), }
Related Procedures With Parameters
- AddFallbackFont
- AddFontMem
- AddFontPath
- BeginState
- ClearState
- Destroy
- EndState
- ExpandAtlas
- GetFontByName
- Init
- LineBounds
- PopState
- PushState
- Reset
- ResetAtlas
- ResetFallbackFont
- SetAlignHorizontal
- SetAlignVertical
- SetBlur
- SetColor
- SetFont
- SetSize
- SetSpacing
- TextBounds
- TextIterInit
- TextIterNext
- ValidateTexture
- VerticalMetrics
- AddFont (procedure groups)
INVALID ¶
INVALID :: TextIter
text iteration with custom settings
Related Procedures With Parameters
Related Procedures With Returns
Constants
AlignHorizontal ¶
AlignHorizontal :: BLUR_APREC
BLUR_ZPREC ¶
BLUR_ZPREC :: 7
HASH_LUT_SIZE ¶
HASH_LUT_SIZE :: 256
INIT_ATLAS_NODES ¶
INIT_ATLAS_NODES :: 256
INIT_GLYPHS ¶
INIT_GLYPHS :: 256
MAX_FALLBACKS ¶
MAX_FALLBACKS :: 20
MAX_STATES ¶
MAX_STATES :: 20
Variables
This section is empty.
Procedures
AddFontMem ¶
AddFontMem :: proc(ctx: ^FontContext, name: string, data: []u8, freeLoadedData: bool, fontIndex: int = 0) -> int {…}
push a font to the font stack optionally init with ascii characters at a wanted size
'fontIndex' controls which font you want to load within a multi-font format such as TTC. Leave it as zero if you are loading a single-font format such as TTF.
Related Procedure Groups
CodepointWidth ¶
only useful for single glyphs where you quickly want the width
EndState ¶
EndState :: proc(using ctx: ^FontContext) {…}
checks for texture updates after potential __getGlyph calls
ExpandAtlas ¶
ExpandAtlas :: proc(ctx: ^FontContext, width, height: int, allocator := context.allocator) -> bool {…}
Font ¶
Font :: SetAlignVertical
FontContext ¶
FontContext :: AddFallbackFont
Init ¶
Init :: proc(ctx: ^FontContext, w, h: int, loc: QuadLocation) {…}
LineBounds ¶
LineBounds :: proc(ctx: ^FontContext, y: f32) -> (miny, maxy: f32) {…}
get top and bottom line boundary
Reset ¶
Reset :: proc(using ctx: ^FontContext) {…}
ResetAtlas ¶
ResetAtlas :: proc(ctx: ^FontContext, width, height: int, allocator := context.allocator) -> bool {…}
ResetFallbackFont ¶
ResetFallbackFont :: proc(ctx: ^FontContext, base: int) {…}
SetAlignVertical ¶
SetAlignVertical :: proc(ctx: ^FontContext, av: AlignVertical) {…}
SetBlur ¶
SetBlur :: proc(ctx: ^FontContext, blur: f32) {…}
SetFont ¶
SetFont :: proc(ctx: ^FontContext, font: int) {…}
SetFont ¶
SetFont :: SetAlignHorizontal
SetSize ¶
SetSize :: proc(ctx: ^FontContext, size: f32) {…}
SetSpacing ¶
SetSpacing :: proc(ctx: ^FontContext, spacing: f32) {…}
TextBounds ¶
TextBounds :: proc(ctx: ^FontContext, text: string, x: f32 = 0, y: f32 = 0, bounds: ^[4]f32 = nil) -> f32 {…}
width of a text line, optionally the full rect
TextIterInit ¶
TextIterInit :: proc(ctx: ^FontContext, x: f32, y: f32, text: string) -> (res: TextIter) {…}
init text iter struct with settings
TextIterNext ¶
TextIterNext :: proc(ctx: ^FontContext, iter: ^TextIter, quad: ^Quad) -> (ok: bool) {…}
step through each codepoint
VerticalMetrics ¶
VerticalMetrics :: proc(using ctx: ^FontContext) -> (ascender, descender, lineHeight: f32) {…}
Procedure Groups
AddFont ¶
AddFont :: proc{ AddFontPath, AddFontMem, }
Source Files
Generation Information
Generated with odin version dev-2026-03 (vendor "odin") Windows_amd64 @ 2026-03-16 21:30:59.231495600 +0000 UTC