Example #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
}
Example #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()
}
Example #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)
}