package vendor:sdl3/ttf

⌘K
Ctrl+K
or
/

    Overview

    Bindings for SDL3 TTF.

    Index

    Variables (0)

    This section is empty.

    Procedures (118)
    Procedure Groups (0)

    This section is empty.

    `#config` values (1)

    Types

    CopyOperation ¶

    CopyOperation :: struct {
    	cmd:         DrawCommand,
    	text_offset: i32,
    	glyph_font:  ^Font,
    	glyph_index: u32,
    	src:         sdl3.Rect,
    	dst:         sdl3.Rect,
    	reserved:    rawptr,
    }

    Direction ¶

    Direction :: enum i32 {
    	INVALID, 
    	LTR     = 4, 
    	RTL, 
    	TTB, 
    	BTT, 
    }

    Related Procedures With Parameters

    Related Procedures With Returns

    DrawCommand ¶

    DrawCommand :: enum i32 {
    	NOOP, 
    	FILL, 
    	COPY, 
    }

    DrawOperation ¶

    DrawOperation :: struct #raw_union {
    	cmd:  DrawCommand,
    	fill: FillOperation,
    	copy: CopyOperation,
    }

    FillOperation ¶

    FillOperation :: struct {
    	cmd:  DrawCommand,
    	rect: sdl3.Rect,
    }

    FontStyle ¶

    FontStyle :: enum u32 {
    	BOLD, 
    	ITALIC, 
    	UNDERLINE, 
    	STRIKETHROUGH, 
    }

    FontStyleFlags ¶

    FontStyleFlags :: distinct bit_set[FontStyle; u32]

    GPUAtlasDrawSequence ¶

    GPUAtlasDrawSequence :: struct {
    	atlas_texture: ^sdl3.GPUTexture,
    	xy:            [^]sdl3.FPoint `fmt:"v,num_vertices"`,
    	uv:            [^]sdl3.FPoint `fmt:"v,num_vertices"`,
    	num_vertices:  i32,
    	indices:       [^]i32 `fmt:"v,num_indices"`,
    	num_indices:   i32,
    	image_type:    ImageType,
    	next:          ^GPUAtlasDrawSequence,
    }

    GPUTextEngineWinding ¶

    GPUTextEngineWinding :: enum i32 {
    	INVALID           = -1, 
    	CLOCKWISE         = 0, 
    	COUNTER_CLOCKWISE = +1, 
    }

    Hinting ¶

    Hinting :: enum i32 {
    	INVALID        = -1, 
    	NORMAL, 
    	LIGHT, 
    	MONO, 
    	NONE, 
    	LIGHT_SUBPIXEL, 
    }
     

    NOTE: This is called TTF_HintingFlags but its not a bit_set so the "flags" doesn't really make sense, its just the hinting.

    HorizontalAlignment ¶

    HorizontalAlignment :: enum i32 {
    	INVALID = -1, 
    	LEFT, 
    	CENTER, 
    	RIGHT, 
    }

    ImageType ¶

    ImageType :: enum i32 {
    	INVALID, 
    	ALPHA, 
    	COLOR, 
    	SDF, 
    }

    Related Procedures With Parameters

    SubString ¶

    SubString :: struct {
    	flags:         SubStringFlags,
    	offset:        i32,
    	length:        i32,
    	line_index:    i32,
    	cluster_index: i32,
    	rect:          sdl3.Rect,
    }

    Related Procedures With Parameters

    SubStringFlags ¶

    SubStringFlags :: distinct bit_field u32 {
    	direction:  u8 | 8,
    	text_start: bool | 1,
    	line_start: bool | 1,
    	line_end:   bool | 1,
    	text_end:   bool | 1,
    }

    TextData ¶

    TextData :: struct {
    	font:                ^Font,
    	color:               sdl3.FColor,
    	needs_layout_update: bool,
    	layout:              ^TextLayout,
    	x:                   i32,
    	y:                   i32,
    	w:                   i32,
    	h:                   i32,
    	num_ops:             i32,
    	ops:                 [^]DrawOperation `fmt:"v,num_ops"`,
    	num_clusters:        i32,
    	clusters:            [^]SubString `fmt:"v,num_clusters"`,
    	props:               sdl3.PropertiesID,
    	needs_engine_update: bool,
    	engine:              ^TextEngine,
    	engine_text:         rawptr,
    }

    Constants

    FONT_WEIGHT_BLACK ¶

    FONT_WEIGHT_BLACK :: 900
     

    Black (900) named font weight value

    FONT_WEIGHT_BOLD ¶

    FONT_WEIGHT_BOLD :: 700
     

    Bold (700) named font weight value

    FONT_WEIGHT_EXTRA_BLACK ¶

    FONT_WEIGHT_EXTRA_BLACK :: 950
     

    ExtraBlack (950) named font weight value

    FONT_WEIGHT_EXTRA_BOLD ¶

    FONT_WEIGHT_EXTRA_BOLD :: 800
     

    ExtraBold (800) named font weight value

    FONT_WEIGHT_EXTRA_LIGHT ¶

    FONT_WEIGHT_EXTRA_LIGHT :: 200
     

    ExtraLight (200) named font weight value

    FONT_WEIGHT_LIGHT ¶

    FONT_WEIGHT_LIGHT :: 300
     

    Light (300) named font weight value

    FONT_WEIGHT_MEDIUM ¶

    FONT_WEIGHT_MEDIUM :: 500
     

    Medium (500) named font weight value

    FONT_WEIGHT_NORMAL ¶

    FONT_WEIGHT_NORMAL :: 400
     

    Normal (400) named font weight value

    FONT_WEIGHT_SEMI_BOLD ¶

    FONT_WEIGHT_SEMI_BOLD :: 600
     

    SemiBold (600) named font weight value

    FONT_WEIGHT_THIN ¶

    FONT_WEIGHT_THIN :: 100
     

    Thin (100) named font weight value

    PROP_FONT_CREATE_EXISTING_FONT ¶

    PROP_FONT_CREATE_EXISTING_FONT :: "SDL_ttf.font.create.existing_font"

    PROP_FONT_CREATE_FACE_NUMBER ¶

    PROP_FONT_CREATE_FACE_NUMBER :: "SDL_ttf.font.create.face"

    PROP_FONT_CREATE_FILENAME_STRING ¶

    PROP_FONT_CREATE_FILENAME_STRING :: "SDL_ttf.font.create.filename"

    PROP_FONT_CREATE_HORIZONTAL_DPI_NUMBER ¶

    PROP_FONT_CREATE_HORIZONTAL_DPI_NUMBER :: "SDL_ttf.font.create.hdpi"

    PROP_FONT_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN ¶

    PROP_FONT_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN :: "SDL_ttf.font.create.iostream.autoclose"

    PROP_FONT_CREATE_IOSTREAM_OFFSET_NUMBER ¶

    PROP_FONT_CREATE_IOSTREAM_OFFSET_NUMBER :: "SDL_ttf.font.create.iostream.offset"

    PROP_FONT_CREATE_IOSTREAM_POINTER ¶

    PROP_FONT_CREATE_IOSTREAM_POINTER :: "SDL_ttf.font.create.iostream"

    PROP_FONT_CREATE_SIZE_FLOAT ¶

    PROP_FONT_CREATE_SIZE_FLOAT :: "SDL_ttf.font.create.size"

    PROP_FONT_CREATE_VERTICAL_DPI_NUMBER ¶

    PROP_FONT_CREATE_VERTICAL_DPI_NUMBER :: "SDL_ttf.font.create.vdpi"

    PROP_GPU_TEXT_ENGINE_ATLAS_TEXTURE_SIZE ¶

    PROP_GPU_TEXT_ENGINE_ATLAS_TEXTURE_SIZE :: "SDL_ttf.gpu_text_engine.create.atlas_texture_size"

    PROP_GPU_TEXT_ENGINE_DEVICE ¶

    PROP_GPU_TEXT_ENGINE_DEVICE :: "SDL_ttf.gpu_text_engine.create.device"

    PROP_RENDERER_TEXT_ENGINE_ATLAS_TEXTURE_SIZE ¶

    PROP_RENDERER_TEXT_ENGINE_ATLAS_TEXTURE_SIZE :: "SDL_ttf.renderer_text_engine.create.atlas_texture_size"

    PROP_RENDERER_TEXT_ENGINE_RENDERER ¶

    PROP_RENDERER_TEXT_ENGINE_RENDERER :: "SDL_ttf.renderer_text_engine.create.renderer"

    SDL3_TTF_WASM_LIB ¶

    SDL3_TTF_WASM_LIB :: #config(SDL3_TTF_WASM_LIB, "env.o")
    -define:SDL3_TTF_WASM_LIB="env.o"

    Variables

    This section is empty.

    Procedures

    AddFallbackFont ¶

    AddFallbackFont :: proc "c" (font: ^Font, fallback: ^Font) -> bool ---

    AppendTextString ¶

    AppendTextString :: proc "c" (text: ^Text, string: [^]u8, length: uint) -> bool ---

    CopyFont ¶

    CopyFont :: proc "c" (existing_font: ^Font) -> ^Font ---

    CreateText ¶

    CreateText :: proc "c" (engine: ^TextEngine, font: ^Font, text: [^]u8, length: uint) -> ^Text ---

    DeleteTextString ¶

    DeleteTextString :: proc "c" (text: ^Text, offset, length: i32) -> bool ---

    DrawSurfaceText ¶

    DrawSurfaceText :: proc "c" (text: ^Text, x, y: i32, surface: ^sdl3.Surface) -> bool ---

    ExpandString ¶

    @(require_results)
    ExpandString :: proc "c" (str: string) -> ([^]u8, uint) {…}

    GetFontDPI ¶

    GetFontDPI :: proc "c" (font: ^Font, hdpi: ^i32, vdpi: ^i32) -> bool ---

    GetFreeTypeVersion ¶

    GetFreeTypeVersion :: proc "c" (major, minor, patch: ^i32) ---

    GetGlyphImage ¶

    GetGlyphImage :: proc "c" (font: ^Font, ch: u32, image_type: ^ImageType) -> ^sdl3.Surface ---

    GetGlyphImageForIndex ¶

    GetGlyphImageForIndex :: proc "c" (
    	font:        ^Font, 
    	glyph_index: u32, 
    	image_type:  ^ImageType, 
    ) -> ^sdl3.Surface ---

    GetGlyphKerning ¶

    GetGlyphKerning :: proc "c" (font: ^Font, previous_ch: u32, ch: u32, kerning: ^i32) -> bool ---

    GetGlyphMetrics ¶

    GetGlyphMetrics :: proc "c" (
    	font:                   ^Font, 
    	ch:                     u32, 
    	minx, maxx, miny, maxy, 
    	advance:                ^i32, 
    ) -> bool ---

    GetHarfBuzzVersion ¶

    GetHarfBuzzVersion :: proc "c" (major, minor, patch: ^i32) ---

    GetNextTextSubString ¶

    GetNextTextSubString :: proc "c" (
    	text:      ^Text, 
    	#by_ptr substring: SubString, 
    	next:      ^SubString, 
    ) -> bool ---

    GetPreviousTextSubString ¶

    GetPreviousTextSubString :: proc "c" (
    	text:      ^Text, 
    	#by_ptr substring: SubString, 
    	previous:  ^SubString, 
    ) -> bool ---

    GetStringSize ¶

    GetStringSize :: proc "c" (font: ^Font, text: [^]u8, length: uint, w, h: ^i32) -> bool ---

    GetStringSizeWrapped ¶

    GetStringSizeWrapped :: proc "c" (
    	font:       ^Font, 
    	text:       [^]u8, 
    	length:     uint, 
    	wrap_width: i32, 
    	w, 
    	h:          ^i32, 
    ) -> bool ---

    GetTextColor ¶

    GetTextColor :: proc "c" (text: ^Text, r, g, b, a: ^u8) -> bool ---

    GetTextColorFloat ¶

    GetTextColorFloat :: proc "c" (text: ^Text, r, g, b, a: ^f32) -> bool ---

    GetTextSubString ¶

    GetTextSubString :: proc "c" (text: ^Text, offset: i32, substring: ^SubString) -> bool ---

    GetTextSubStringForLine ¶

    GetTextSubStringForLine :: proc "c" (text: ^Text, line: i32, substring: ^SubString) -> bool ---

    GetTextSubStringForPoint ¶

    GetTextSubStringForPoint :: proc "c" (text: ^Text, x, y: i32, substring: ^SubString) -> bool ---

    GetTextSubStringsForRange ¶

    GetTextSubStringsForRange :: proc "c" (
    	text:           ^Text, 
    	offset, length: i32, 
    	count:          ^i32, 
    ) -> [^]^SubString ---

    GetTextWrapWidth ¶

    GetTextWrapWidth :: proc "c" (text: ^Text, wrap_width: ^i32) -> bool ---

    InsertTextString ¶

    InsertTextString :: proc "c" (text: ^Text, offset: i32, string: [^]u8, length: uint) -> bool ---

    MeasureString ¶

    MeasureString :: proc "c" (
    	font:            ^Font, 
    	text:            [^]u8, 
    	length:          uint, 
    	max_width:       i32, 
    	measured_width:  ^i32, 
    	measured_length: ^uint, 
    ) -> bool ---

    OpenFontIO ¶

    OpenFontIO :: proc "c" (src: ^sdl3.IOStream, closeio: bool, ptsize: f32) -> ^Font ---

    RenderGlyph_Blended ¶

    RenderGlyph_Blended :: proc "c" (font: ^Font, ch: u32, fg: sdl3.Color) -> ^sdl3.Surface ---

    RenderGlyph_LCD ¶

    RenderGlyph_LCD :: proc "c" (font: ^Font, ch: u32, fg, bg: sdl3.Color) -> ^sdl3.Surface ---

    RenderGlyph_Shaded ¶

    RenderGlyph_Shaded :: proc "c" (font: ^Font, ch: u32, fg, bg: sdl3.Color) -> ^sdl3.Surface ---

    RenderGlyph_Solid ¶

    RenderGlyph_Solid :: proc "c" (font: ^Font, ch: u32, fg: sdl3.Color) -> ^sdl3.Surface ---

    RenderText_Blended ¶

    RenderText_Blended :: proc "c" (
    	font:   ^Font, 
    	text:   [^]u8, 
    	length: uint, 
    	fg:     sdl3.Color, 
    ) -> ^sdl3.Surface ---

    RenderText_Blended_Wrapped ¶

    RenderText_Blended_Wrapped :: proc "c" (
    	font:       ^Font, 
    	text:       [^]u8, 
    	length:     uint, 
    	fg:         sdl3.Color, 
    	wrap_width: i32, 
    ) -> ^sdl3.Surface ---

    RenderText_LCD ¶

    RenderText_LCD :: proc "c" (
    	font:   ^Font, 
    	text:   [^]u8, 
    	length: uint, 
    	fg, 
    	bg:     sdl3.Color, 
    ) -> ^sdl3.Surface ---

    RenderText_LCD_Wrapped ¶

    RenderText_LCD_Wrapped :: proc "c" (
    	font:       ^Font, 
    	text:       [^]u8, 
    	length:     uint, 
    	fg, bg:     sdl3.Color, 
    	wrap_width: i32, 
    ) -> ^sdl3.Surface ---

    RenderText_Shaded ¶

    RenderText_Shaded :: proc "c" (
    	font:   ^Font, 
    	text:   [^]u8, 
    	length: uint, 
    	fg, 
    	bg:     sdl3.Color, 
    ) -> ^sdl3.Surface ---

    RenderText_Shaded_Wrapped ¶

    RenderText_Shaded_Wrapped :: proc "c" (
    	font:       ^Font, 
    	text:       [^]u8, 
    	length:     uint, 
    	fg, bg:     sdl3.Color, 
    	wrap_width: i32, 
    ) -> ^sdl3.Surface ---

    RenderText_Solid ¶

    RenderText_Solid :: proc "c" (
    	font:   ^Font, 
    	text:   [^]u8, 
    	length: uint, 
    	fg:     sdl3.Color, 
    ) -> ^sdl3.Surface ---

    RenderText_Solid_Wrapped ¶

    RenderText_Solid_Wrapped :: proc "c" (
    	font:        ^Font, 
    	text:        [^]u8, 
    	length:      uint, 
    	fg:          sdl3.Color, 
    	wrap_Length: i32, 
    ) -> ^sdl3.Surface ---

    SetFontLanguage ¶

    SetFontLanguage :: proc "c" (font: ^Font, language_bcp47: cstring) -> bool ---

    SetFontLineSkip ¶

    SetFontLineSkip :: proc "c" (font: ^Font, lineskip: i32) ---

    SetFontOutline ¶

    SetFontOutline :: proc "c" (font: ^Font, outline: i32) -> bool ---

    SetFontSDF ¶

    SetFontSDF :: proc "c" (font: ^Font, enabled: bool) -> bool ---

    SetFontScript ¶

    SetFontScript :: proc "c" (font: ^Font, script: u32) -> bool ---

    SetFontSize ¶

    SetFontSize :: proc "c" (font: ^Font, ptsize: f32) -> bool ---

    SetFontSizeDPI ¶

    SetFontSizeDPI :: proc "c" (font: ^Font, ptsize: f32, hdpi: i32, vdpi: i32) -> bool ---

    SetTextColor ¶

    SetTextColor :: proc "c" (text: ^Text, r, g, b, a: u8) -> bool ---

    SetTextColorFloat ¶

    SetTextColorFloat :: proc "c" (text: ^Text, r, g, b, a: f32) -> bool ---

    SetTextScript ¶

    SetTextScript :: proc "c" (text: ^Text, script: u32) -> bool ---

    SetTextString ¶

    SetTextString :: proc "c" (text: ^Text, string: [^]u8, length: uint) -> bool ---

    SetTextWrapWidth ¶

    SetTextWrapWidth :: proc "c" (text: ^Text, wrap_width: i32) -> bool ---

    TagToString ¶

    TagToString :: proc "c" (tag: u32, string: [^]u8, size: uint) ---

    Procedure Groups

    This section is empty.

    `#config` values

    Source Files

    Generation Information

    Generated with odin version dev-2026-10 (vendor "odin") Windows_amd64 @ 2026-10-12 23:22:57.846843600 +0000 UTC