예제 #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)
}