From 86ffca0024326110962f0880727f4eb84e6a48d1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 11:13:20 -0300 Subject: sketchbook: frames for ffmpeg (--export, on a clock of its own), text sizes, a font from the environment Co-Authored-By: Claude Fable 5.2 --- vendor/text.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vendor/text.h') diff --git a/vendor/text.h b/vendor/text.h index bf4f363..9cd445a 100644 --- a/vendor/text.h +++ b/vendor/text.h @@ -6,5 +6,9 @@ eight-pixel ASCII advance and a 16-pixel line box); fallback uses Fontconfig. */ bool sk_text_draw(SDL_Renderer *, float x, float y, float scale, const char *utf8, size_t len, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +/* What sk_text_draw gives the text at `scale`: its advance width and the + height of its line box, in logical units. False if it cannot be laid out. */ +bool sk_text_measure(SDL_Renderer *, float scale, const char *utf8, size_t len, + float *width, float *height); void sk_text_begin_frame(SDL_Renderer *); #endif -- cgit v1.3