示例#1
0
文件: canvas.go 项目: phacops/canvas
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)
}