示例#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))
}