From df05f9d1494d3a62a5b301f6f2db3410f21be458 Mon Sep 17 00:00:00 2001 From: Gerry Agbobada Date: Sun, 24 May 2020 14:03:34 +0200 Subject: ttf: Add more bindings. Bindings added: * TTF_FontAscent * TTF_FontDescent * TTF_FontLineSkip * TTF_SizeUTF8 * TTF_GlyphIsProvided * TTF_GetFontStyle * TTF_SetFontStyle --- sdl2/bindings/ttf.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'sdl2/bindings') diff --git a/sdl2/bindings/ttf.scm b/sdl2/bindings/ttf.scm index fb3b717..1accf6c 100644 --- a/sdl2/bindings/ttf.scm +++ b/sdl2/bindings/ttf.scm @@ -42,6 +42,13 @@ RETURN-TYPE and accept arguments of ARG-TYPES." (define-public name (sdl-ttf-func return-type func-name arg-types))) +;; Font style bitmask. +;; If no bit is set in the mask, that means the style is "normal" +(define-public SDL_TTF_STYLE_BOLD #x01) +(define-public SDL_TTF_STYLE_ITALIC #x02) +(define-public SDL_TTF_STYLE_UNDERLINE #x04) +(define-public SDL_TTF_STYLE_STRIKETHROUGH #x08) + (define-foreign ttf-init int "TTF_Init" '()) @@ -57,9 +64,30 @@ RETURN-TYPE and accept arguments of ARG-TYPES." (define-foreign ttf-font-height int "TTF_FontHeight" '(*)) +(define-foreign ttf-font-ascent + int "TTF_FontAscent" '(*)) + +(define-foreign ttf-font-descent + int "TTF_FontDescent" '(*)) + +(define-foreign ttf-font-line-skip + int "TTF_FontLineSkip" '(*)) + +(define-foreign ttf-size-utf8 + int "TTF_SizeUTF8" '(* * * *)) + +(define-foreign ttf-glyph-is-provided + int "TTF_GlyphIsProvided" (list '* uint16)) + (define-foreign ttf-glyph-metrics int "TTF_GlyphMetrics" (list '* uint16 '* '* '* '* '*)) +(define-foreign ttf-get-font-style + int "TTF_GetFontStyle" '(*)) + +(define-foreign ttf-set-font-style + void "TTF_SetFontStyle" (list '* int)) + (define-foreign ttf-render-text-solid '* "TTF_RenderText_Solid" (list '* '* sdl-color)) -- cgit v1.2.3