From d92a98e6f58de86cd0a09742f1d6a32403cca0fe Mon Sep 17 00:00:00 2001 From: SimpleClips <123908532+SimpleClips@users.noreply.github.com> Date: Wed, 1 Feb 2023 18:33:53 -0800 Subject: [PATCH] ttf: binded TTF_FontFaceStyleName in sdl_ttf.go (#553) Binded TTF_FontFaceStyleName to FaceStyleName() on the Font struct. Note: TTF_FontFaceStyleName was not supported until SDL_ttf 2.0.4. --- ttf/sdl_ttf.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ttf/sdl_ttf.go b/ttf/sdl_ttf.go index 48ca65ab..b69e3a83 100644 --- a/ttf/sdl_ttf.go +++ b/ttf/sdl_ttf.go @@ -349,6 +349,14 @@ func (f *Font) FaceFamilyName() string { return fname } +// FaceStyleName returns the current font face family's style name from the loaded font. +// (https://wiki.libsdl.org/SDL_ttf/TTF_FontFaceStyleName) +func (f *Font) FaceStyleName() string { + _fname := C.TTF_FontFaceStyleName(f.f) + fname := C.GoString(_fname) + return fname +} + // GlyphMetrics contains glyph-specific rendering metrics. type GlyphMetrics struct { MinX, MaxX int