コード例 #1
0
ファイル: ttf.go プロジェクト: jgastal/Go-SDL
// Returns the style name of the font's currently selected face,
// or a blank string if unavailable.
func (f *Font) StyleName() string {
	if f == nil {
		return "nil"
	}
	p := C.TTF_FontFaceStyleName(f.cfont)
	if p == nil {
		return ""
	}
	s := C.GoString(p)
	return s
}
コード例 #2
0
ファイル: ttf.go プロジェクト: krig/Go-SDL2
// Returns the style name of the font's currently selected face,
// or a blank string if unavailable.
func (f *Font) StyleName() string {
	var s string
	if f != nil {
		p := C.TTF_FontFaceStyleName(f.cfont)
		if p != nil {
			s = C.GoString(p)
		} else {
			s = ""
		}
	} else {
		s = "nil"
	}

	return s
}
コード例 #3
0
ファイル: ttf.go プロジェクト: Zwobot/Go-SDL
// Returns the style name of the font's currently selected face,
// or a blank string if unavailable.
func (f *Font) StyleName() string {
	var s string
	if f != nil {
		f.mutex.RLock()

		p := C.TTF_FontFaceStyleName(f.cfont)
		if p != nil {
			s = C.GoString(p)
		} else {
			s = ""
		}

		f.mutex.RUnlock()
	} else {
		s = "nil"
	}

	return s
}
コード例 #4
0
ファイル: ttf.go プロジェクト: beoran/fungo
// Font face stylename
func TTFFontFaceStyleName(font *C.TTF_Font) string {
	return C.GoString(C.TTF_FontFaceStyleName(font))
}
コード例 #5
0
ファイル: ttf.go プロジェクト: willemvds/sdl
func (f *Font) FaceStyleName() string {
	return C.GoString(C.TTF_FontFaceStyleName(f.c))
}