system_defaultfont(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

✨ 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:

  1. call this function directly, or
  2. get it set indirectly β€” through the first render_text call that passes an explicit font πŸ‘‘

here's the arg breakdown, no cap:

  • fontres β€” a string reference to a valid file inside the SYS_FONT_RESOURCE namespace πŸ“
  • fontsz β€” the size argument, exactly as it's used in render_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 ⭐

  1. this is also implicitly updated in LWA arcan builds if it receives a FONTHINT event 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 that fonth goes from 0 (disabled) and 1 (light) onward, and that fallback glyphs 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