Skip to content

raylib.LoadFontFromImage

JoeStrout edited this page Apr 29, 2026 · 3 revisions

Load an Image font file (XNA style)

Parameters

Parameter Default Value Note
image
key Color{255, 0, 255, 255}
firstChar 32

Return value

Condition Return Value
(always) map

Notes

Example

// Load a bitmap font from an image using magenta as the key color
img = raylib.LoadImage("resources/font_atlas.png")
font = raylib.LoadFontFromImage(img, "#FF00FF", 32)
if raylib.IsFontValid(font) then
    raylib.DrawTextEx font, "Bitmap font!", [10, 10], 16, 1, raylib.WHITE
    raylib.UnloadFont font
end if
raylib.UnloadImage img

Clone this wiki locally