Font.default() -> Font
raylib's built-in bitmap font. Always available, no load failure.
val font = Font.default()
Font loading, drawing, measurement, UTF-8 + codepoint utilities, string helpers.
Font loading, drawing, measurement, glyph lookup, UTF-8 + codepoint utilities, string helpers. Everything raylib's rtext.c ships.
Font.default() -> Fontraylib's built-in bitmap font. Always available, no load failure.
val font = Font.default()
Font.load(filePath: String) -> FontLoad TTF/OTF/FNT. Check Font.is_valid(f); unload with Font.unload(f).
val font = Font.load("tests/assets/fonts/roboto.ttf")
Font.load_ex(filePath: String, fontSize: Int32, codepoints: [Int32]) -> FontLoad font with specific pixel size + subset of codepoints (smaller atlas). Empty codepoints loads 95 printable ASCII.
val font = Font.load_ex("roboto.ttf", Int32(32), [])
Font.from_image(image: Image, keyColor: Color, firstChar: Int32) -> FontBuild font from an atlas image — keyColor pixels separate glyphs.
val font = Font.from_image(atlas, MAGENTA, Int32(32))
Font.from_memory(file_type, data: [UInt8], data_size, font_size, codepoints: [Int32]) -> FontLoad font from in-memory byte buffer (e.g. embedded resource).
Use this when the font bytes already live in memory, such as embedded assets or data loaded with Files.load_data.
val font = Font.from_memory(".ttf", bytes, Int32(bytes.length), Int32(32), [])
Font.is_valid(font) -> Bool / Font.unload(font)Validity guard + release.
if Font.is_valid(font) { Font.unload(font) }
Font.export_as_code(font, filePath: String) -> Bool / Font.gen_image_atlas(glyphs, fontSize, padding, packMethod) / Font.unload_data(glyphs)Dump font as C source; pack glyphs into a new atlas image; free glyph table.
Font.export_as_code(font, "embedded_font.h")
Draw.text(text, posX, posY, fontSize: Int32, color: Color)Default-font text draw. For loaded fonts use font.draw_ex.
Draw.text("Hello", Int32(200), Int32(280), Int32(24), WHITE)
Font.draw_ex(font, text, position, fontSize, spacing, tint)Draw with specific loaded font at float position + spacing.
Font.draw_ex(font, "hi", pos, Float32(32.0), Float32(2.0), WHITE)
Font.draw_pro(font, text, position, origin, rotation, fontSize, spacing, tint)Draw with rotation around an origin point.
Font.draw_pro(font, "ROTATE", pos, origin, Float32(45.0), Float32(32.0), Float32(0.0), RED)
Font.draw_codepoint(font, codepoint, position, fontSize, tint) / draw_codepoints(font, codepoints: [Int32], ...)Single codepoint or explicit array (skip UTF-8 decoding).
Font.draw_codepoint(font, Int32(0x1F600), pos, Float32(64.0), WHITE)
Text.measure(text: String, fontSize: Int32) -> Int32 / Font.measure_ex(font, text, fontSize, spacing) -> Vector2 / Text.set_line_spacing(spacing: Int32)Default-font width; loaded-font Vector2; line-height override.
val w = Text.measure("PLAY", Int32(48))
Font.get_glyph_index / get_glyph_info / get_glyph_atlas_recPer-codepoint metadata: slot in atlas, full GlyphInfo struct, source rectangle in the atlas texture.
val info = Font.get_glyph_info(font, Int32(0x41))
Text.load_codepoints(text: String) -> [Int32] / Text.load_utf8(codepoints: [Int32]) -> StringDecode UTF-8 string into codepoint array; encode codepoints back to UTF-8.
val cps = Text.load_codepoints("héllo")
Text.codepoint_count(text: String) -> Int32 / codepoint_to_utf8(codepoint: Int32) -> StringCount logical characters (grapheme count ≈ codepoint count); single-codepoint → UTF-8 string.
val n = Text.codepoint_count("こんにちは")
Text.codepoint_at / codepoint_next / codepoint_previous(text, offset) -> (Int32, Int32)Cursor-style UTF-8 iteration. Returns (codepoint, byteCount-consumed).
val (cp, n) = Text.codepoint_next(text, Int32(0))
Text.copy / is_equal / lengthBasic string primitives.
if Text.is_equal(a, b) { }
Text.format_i / format_f / format_sprintf-style formatters for Int32, Float32, String. fmt uses %i / %f / %s.
val s = Text.format_i("score: %i", Int32(score))
Text.subtext / replace / insert / find_indexSubstring extraction / replace / insertion / index search.
val part = Text.subtext(text, Int32(0), Int32(5))
Text.join(parts: [String], delimiter: String) / split(text, delimiter) -> [String]Collection ↔ string conversions.
val parts = Text.split("a,b,c", ",")
Text.to_upper / to_lower / to_pascal / to_snake / to_camelCase conversions (identifier-friendly for code generators).
val id = Text.to_snake("HelloWorld") -- "hello_world"
Text.to_integer(text) -> Int32 / to_float(text) -> Float32String → numeric. Returns 0 on parse failure.
val n = Text.to_integer("42")
Draw.text / Draw.fps.