Пример #1
0
func (self *Canvas) SetFont(font string) error {
	cFont := C.CString(font)
	defer C.free(unsafe.Pointer(cFont))

	if C.DrawSetFont(self.drawing, cFont) == C.MagickFalse {
		return fmt.Errorf("Could not set font: %s", self.Error())
	}

	return nil
}
Пример #2
0
// Sets the fully-sepecified font to use when annotating with text.
func (dw *DrawingWand) SetFont(fontName string) error {
	csFontName := C.CString(fontName)
	defer C.free(unsafe.Pointer(csFontName))
	C.DrawSetFont(dw.dw, csFontName)
	return dw.GetLastError()
}
Пример #3
0
// Sets canvas' default font name
func (self *Canvas) SetFontName(font string) {
	self.text.Font = font
	cfont := C.CString(font)
	defer C.free(unsafe.Pointer(cfont))
	C.DrawSetFont(self.drawing, cfont)
}