Esempio n. 1
0
File: ttf.go Progetto: Zwobot/Go-SDL
// Sets the rendering style of the font.
func (f *Font) SetStyle(style int) {
	sdl.GlobalMutex.Lock()
	f.mutex.Lock()

	C.TTF_SetFontStyle(f.cfont, C.int(style))

	f.mutex.Unlock()
	sdl.GlobalMutex.Unlock()
}
Esempio n. 2
0
File: ttf.go Progetto: henkman/Go2D
func (f *Font) SetStyle(_bold bool, _italic bool, _underline bool) {
	var flags int

	if _bold {
		flags |= C.TTF_STYLE_BOLD
	}
	if _italic {
		flags |= C.TTF_STYLE_ITALIC
	}
	if _underline {
		flags |= C.TTF_STYLE_UNDERLINE
	}

	if flags == 0 {
		flags = C.TTF_STYLE_NORMAL
	}

	C.TTF_SetFontStyle(f.Get(), C.int(flags))
}
Esempio n. 3
0
// SetStyle (https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf_22.html#SEC22)
func (f *Font) SetStyle(style int) {
	C.TTF_SetFontStyle(f.f, C.int(style))
}
Esempio n. 4
0
File: ttf.go Progetto: badgerodon/go
func (this Font) SetStyle(style FontStyle) {
	c_font := (*C.TTF_Font)(this.Ptr)
	c_style := C.int(style)
	C.TTF_SetFontStyle(c_font, c_style)
}
Esempio n. 5
0
File: ttf.go Progetto: beoran/fungo
// Set the style of the font
func TTFSetFontStyle(font *C.TTF_Font, style int) {
	C.TTF_SetFontStyle(font, C.int(style))
}