/** * @file text.h * @brief Declares the public text API. */ #ifndef _TEXT_H_ #define _TEXT_H_ #include /** * @brief Text loadfont. * @param name Registry key or human-readable object name. * @param filepath Path to the requested file. * @param size Requested font size. * @return `NULL` on success, otherwise an error context owned by the caller. * @throws AKERR_KEY When the corresponding validation or operation fails. * @throws AKERR_NULLPOINTER When the corresponding validation or operation fails. * @throws AKGL_ERR_SDL When the corresponding validation or operation fails. */ akerr_ErrorContext AKERR_NOIGNORE *akgl_text_loadfont(char *name, char *filepath, int size); /** * @brief Text rendertextat. * @param font Font used to render the text. * @param text UTF-8 text to render. * @param color Text color. * @param wraplength Maximum rendered line width; zero disables wrapping. * @param x Horizontal destination coordinate. * @param y Vertical destination coordinate. * @return `NULL` on success, otherwise an error context owned by the caller. * @throws AKERR_NULLPOINTER When the corresponding validation or operation fails. */ akerr_ErrorContext AKERR_NOIGNORE *akgl_text_rendertextat(TTF_Font *font, char *text, SDL_Color color, int wraplength, int x, int y); #endif // _TEXT_H_