target_fonthint(3)

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

πŸ’– target_fonthint β€” the Arcan Lua API page, bestie edition πŸ’–

okay so this is target_fonthint(3) from the Arcan Lua API and it's literally the glow-up your frameserver text deserves ✨

🌸 NAME 🌸

target_fonthint β€” send font drawing hints to a target frameserver. that's it, that's the vibe πŸŽ€

✨ SYNOPSIS ✨

the return values first, because yes she gives back:

bool:state, int:cellw, int:cellh

and here are all four ways to call her (pick your fighter):

target_fonthint( vid:dst, string:font, number:size_mm, int:hint )
target_fonthint( vid:dst, string:font, number:size_mm, int:hint,
int:cont )
target_fonthint( vid:dst, number:size_mm, int:hint )
target_fonthint( vid:dst, number:size_mm, int:hint, int:cont )

πŸ¦‹ DESCRIPTION πŸ¦‹

so target_fonthint sends a hint β€” and optionally a descriptor pointing at the specified font resource over in the ARCAN_SYS_FONT namespace β€” all about how text rendered by the frameserver should be drawn into the specified segment. main character energy for your glyphs, fr fr πŸ’…

the size_mm argument sets the desired 'normal' font size, in mm. and if the underlying display pixel density changes? that's not her job, use target_displayhint for that πŸ‘‘

now the strength hints to anti-aliasing go like this:

  • 0 β€” disabled
  • 1 β€” monospace
  • 2 β€” weak
  • 3 β€” medium
  • 4 β€” strong

and if bit 8 is set (+ 256) she'll try and apply subpixel hinting 🌈

big caveat bestie: it is still up to the renderer in the receiving frameserver to actually respect these flags, and to match any rendering properties with corresponding displayhints so that the sizes match up. you can hint all you want, but the renderer has to cooperate 😭

if the cont option is set to 1, this font is intended to be chained as a fallback for the case of missing glyphs in previously supplied fonts. backup font behavior, we love to see it 🫢

and what does she return? true if the font was found and was forwarded correctly to the client β€” plus the estimated cell width/height that will currently be used for size calculations of server-side text in monospaced form with the supplied fonts. so you get state, cellw, cellh and you're set ⭐


πŸŽ€ NOTES πŸŽ€

  1. if -1 is used for size_mm and/or strength, the recipient should keep the currently hinted size. no changes, no stress πŸ’€
  2. to translate from the Postscript 'point size' to millimeter, multiply with the constant FONT_PT_SZ. math but make it cute 🧚
  3. the actual font size will also vary with the density of the output segment. that density can be expressed via the target_displayhint function. density is lowkey the main character here πŸ‘‘
  4. currently set as the default (using system_defaultfont). that's the whole note. iconic brevity πŸ’œ

πŸ”₯ EXAMPLE πŸ”₯

function target_fonthint0()
      local fsrv = launch_avfeed(function(source, status)
      end);
      target_fonthint(fsrv, "default.ttf", 10, 1);
      target_fonthint(fsrv, 1, 0);
end

look at her go 😭 two calls, one with the font name and one without, both slaying ✨

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page, bestie!! brought to you by targetcontrol, dated October 2026 β€” same manual name, same date, zero cap πŸ«ΆπŸ’…πŸŒΈ

πŸ“¦ where this page comes from