target_fonthint(3)
π 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β disabled1β monospace2β weak3β medium4β 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 π
- if
-1is used forsize_mmand/orstrength, the recipient should keep the currently hinted size. no changes, no stress π - to translate from the Postscript 'point size' to millimeter, multiply with the constant
FONT_PT_SZ. math but make it cute π§ - the actual font size will also vary with the density of the output segment. that density can be expressed via the
target_displayhintfunction. density is lowkey the main character here π - 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 π
system_defaultfont(3)β go read that one too, iykyk π
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
- 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