summaryrefslogtreecommitdiff
path: root/src/modules/asc/asc.c
AgeCommit message (Collapse)Author
2023-11-03modules/*: drop til_setup_t.free_func() NULL setup checksVito Caputo
Trivial cleanup. These are unnecessary nowadays since til_setup_free() won't invoke the free_func() on a NULL setup, and everything uses til_setup_free() to free a til_setup_t.
2023-10-04modules/asc: turn into a "built-in" moduleVito Caputo
This deviates from the established pattern of all built-in modules being in til_builtins.c, but that's ok. The main impetus for this is to just get asc out of rotation for randomized compose layers, since it's so uninteresting. But it's also valid as a built-in since it's primarily for diagnostic purposes anyways.
2023-10-03modules/asc: add justify= and [hv]offset= settingsVito Caputo
justify= now supports "aligned" and "offsetted", justify=aligned being the existing behavior where you would specify halign={left,right,center} and valign={top,bottom,center}. When justify=offsetted is specified however, {valign=,halign=} are unused and instead {hoffset=,voffset=} are expected, as either hoffset=auto/voffset=auto for automagic offsetting according to the x/y coords, or explicit offsetting using -1..+1 normalized fractional values serving as coordinates within the rendered text's rectangle where to anchor the x/y coordinate. By using halign=auto,valign=auto one can carelessly vary the x/y coordinates using the taps (i.e. via rkt) without having to deal with justification concerns (modulo large texts that can't possibly fit), as the offsets will automatically adapt according to the coordinates.
2023-10-03libs/txt,modules/*: rename txt_render_fragment()Vito Caputo
Mechanical rename to txt_render_fragment_aligned(), updating all existing call sites accordingly. This is a preparatory commit for introducing an offsetted variant of txt_render_fragment() (txt_render_fragment_offsetted()). No functional difference, purely naming changes.
2023-10-03modules/asc: tap x/y coordinatesVito Caputo
Nothing terribly exciting, the string can now be moved dynamically via taps in the usual manner. When nobody's driving the taps they just use the setting, still defaulting to 0,0 (centered).
2023-10-03modules/asc: implement a simple ascii text moduleVito Caputo
This just binds the simple libs/txt/txt.c stuff to a rendering module, exposing the minimal options as settings. It's handy for testing libs/txt/txt.c, and introduces a module requiring free-form strings potentially including newlines be handled properly as settings values. This latter aspect is important for improving settings syntax, any improvements must handle these more complicated scenarios and now there's a good test case for exercising those nuances. I suppose there might also be use in the creative process if you want a text element but haven't got around to hacking up a prettier module for it yet. Just use this one temporarily. See commit for some remaining TODO items.
© All Rights Reserved