Esempio n. 1
0
func (f *Font) GetTextWidth(text string) int {
	ctext := C.CString(text)
	defer C.free(unsafe.Pointer(ctext))
	var i int

	i = int(C.al_get_text_width((*C.ALLEGRO_FONT)(f), ctext))

	return i
}
Esempio n. 2
0
func (f *Font) GetTextWidth(text string) int32 {
	t := C.CString(text)
	defer C.free(unsafe.Pointer(t))
	return int32(C.al_get_text_width((*C.ALLEGRO_FONT)(unsafe.Pointer(f)), t))
}