Skip to content

Commit

Permalink
ttf: binded TTF_FontFaceStyleName in sdl_ttf.go (#553)
Browse files Browse the repository at this point in the history
Binded TTF_FontFaceStyleName to FaceStyleName() on the Font struct.
Note: TTF_FontFaceStyleName was not supported until SDL_ttf 2.0.4.
  • Loading branch information
SimpleClips authored Feb 2, 2023
1 parent e9259e7 commit d92a98e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ttf/sdl_ttf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d92a98e

Please sign in to comment.