// Returns a TextProperties structure. // Parameters: // read_default: if false, returns an empty structure. // if true, returns a structure set with current canvas settings func (self *Canvas) NewTextProperties(read_default bool) *TextProperties { if read_default == true { cfont := C.DrawGetFont(self.drawing) defer C.free(unsafe.Pointer(cfont)) cfamily := C.DrawGetFontFamily(self.drawing) defer C.free(unsafe.Pointer(cfamily)) csize := C.DrawGetFontSize(self.drawing) cweight := C.DrawGetFontWeight(self.drawing) calignment := C.DrawGetTextAlignment(self.drawing) cantialias := C.DrawGetTextAntialias(self.drawing) ckerning := C.DrawGetTextKerning(self.drawing) antialias := false if cantialias == C.MagickTrue { antialias = true } underColor := C.NewPixelWand() C.DrawGetTextUnderColor(self.drawing, underColor) return &TextProperties{ Font: C.GoString(cfont), Family: C.GoString(cfamily), Size: float64(csize), Weight: uint(cweight), Alignment: Alignment(calignment), Antialias: antialias, Kerning: float64(ckerning), UnderColor: underColor, } } return &TextProperties{ UnderColor: C.NewPixelWand(), } }
// Returns the color of a background rectangle to place under text annotations. func (dw *DrawingWand) GetTextUnderColor() (pw *PixelWand) { pw = NewPixelWand() C.DrawGetTextUnderColor(dw.dw, pw.pw) return }