Esempio n. 1
0
// Returns the family name of the font's currently selected face,
// or a blank string if unavailable.
func (f *Font) FamilyName() string {
	if f == nil {
		return "nil"
	}
	p := C.TTF_FontFaceFamilyName(f.cfont)
	if p == nil {
		return ""
	}
	s := C.GoString(p)
	return s
}
Esempio n. 2
0
File: ttf.go Progetto: krig/Go-SDL2
// Returns the family name of the font's currently selected face,
// or a blank string if unavailable.
func (f *Font) FamilyName() string {
	var s string
	if f != nil {
		p := C.TTF_FontFaceFamilyName(f.cfont)
		if p != nil {
			s = C.GoString(p)
		} else {
			s = ""
		}
	} else {
		s = "nil"
	}

	return s
}
Esempio n. 3
0
File: ttf.go Progetto: Zwobot/Go-SDL
// Returns the family name of the font's currently selected face,
// or a blank string if unavailable.
func (f *Font) FamilyName() string {
	var s string
	if f != nil {
		f.mutex.RLock()

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

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

	return s
}
Esempio n. 4
0
// FaceFamilyName (https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf_35.html#SEC35)
func (f *Font) FaceFamilyName() string {
	_fname := C.TTF_FontFaceFamilyName(f.f)
	fname := C.GoString(_fname)
	return fname
}
Esempio n. 5
0
func (f *Font) FaceFamilyName() string {
	_fname := C.TTF_FontFaceFamilyName(f.f)
	fname := C.GoString(_fname)
	C.free(unsafe.Pointer(_fname))
	return fname
}
Esempio n. 6
0
File: ttf.go Progetto: beoran/fungo
// Font family name
func TTFFontFamilyName(font *C.TTF_Font) string {
	return C.GoString(C.TTF_FontFaceFamilyName(font))
}
Esempio n. 7
0
File: ttf.go Progetto: willemvds/sdl
func (f *Font) FaceFamilyName() string {
	return C.GoString(C.TTF_FontFaceFamilyName(f.c))
}