system_defaultfont(3)
β¨ system_defaultfont(3) β¨
okay bestie, this one's called system_defaultfont β it sets (or replaces) the current default font π
and it lives in the Arcan Lua API, so yeah, we're doing graphics-adjacent things today π
πΈ NAME πΈ
system_defaultfont β set / replace the current default font, periodt π
π¦ SYNOPSIS π¦
boolres, height, baseline,
system_defaultfont( fontres, fontsz, fonth, fallback )
ok so it returns three things β boolres, height, and baseline β and takes up to four args. slay β¨
π DESCRIPTION π
so here's the vibe: all the text rendering functions need some kind of font to actually, y'know, render text π you can set that default font in two ways, bestie:
- call this function directly, or
- get it set indirectly β through the first
render_textcall that passes an explicit font π
here's the arg breakdown, no cap:
fontresβ a string reference to a valid file inside theSYS_FONT_RESOURCEnamespace πfontszβ the size argument, exactly as it's used inrender_textπfonthβ specifies the anti-aliasing strength (0: disabled,1: light, ...) β¨
and highkey the fun part: you can also specify an additional fallback font π«Ά it covers any missing glyphs that aren't found in fontres. the tradeoff? the downside is that those fallback glyphs might not visually blend with the primary ones in a visually appealing way π but honestly it may still be better than invisible characters π so like... take the win, i guess?
β NOTES β
- this is also implicitly updated in LWA
arcanbuilds if it receives aFONTHINTevent from the display server connection π and here's the catch β there is no event-trigger to detect if that occurs π so you just have to vibe with it, fr fr.
π₯ EXAMPLE π₯
here's the whole thing in action, copy it exactly bestie:
function system_defaultfont0()
system_defaultfont("default.ttf", 12, 0);
end
look at her go π§ font "default.ttf", size 12, anti-aliasing 0. iconic. π
π SEE ALSO π
system β go peek at her too, iykyk πΈ
friendly reminder thatfonthgoes from0(disabled) and1(light) onward, and thatfallbackglyphs may not blend cute with your primary font β but invisible characters are worse, so π
this lil page came to you courtesy of the Arcan Lua API, dated October 2026 π and it's system_defaultfont(3) β mwah, go render something pretty bestie ππ¦β¨
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms