Example #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
}
Example #2
0
File: ttf.go Project: 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
}
Example #3
0
File: ttf.go Project: 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
}
Example #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
}
Example #5
0
func (f *Font) FaceFamilyName() string {
	_fname := C.TTF_FontFaceFamilyName(f.f)
	fname := C.GoString(_fname)
	C.free(unsafe.Pointer(_fname))
	return fname
}
Example #6
0
File: ttf.go Project: beoran/fungo
// Font family name
func TTFFontFamilyName(font *C.TTF_Font) string {
	return C.GoString(C.TTF_FontFaceFamilyName(font))
}
Example #7
0
File: ttf.go Project: willemvds/sdl
func (f *Font) FaceFamilyName() string {
	return C.GoString(C.TTF_FontFaceFamilyName(f.c))
}