Use font-size in texts of svg context

This commit is contained in:
Drahoslav 2017-12-26 19:52:06 +01:00
parent 90f962641f
commit 3af25f5588
2 changed files with 7 additions and 4 deletions

View File

@ -126,12 +126,13 @@ func (gc *GraphicContext) drawString(text string, drawType drawType, x, y float6
// set attrs to text element
svgText.Text = text
svgText.FontSize = gc.Current.FontSize
svgText.X = x
svgText.Y = y
// TODO set font
svgText.FontFamily = "" // TODO set font
// link to group
(*group).Texts = []*Text{&svgText}
group.Texts = []*Text{&svgText}
return 0
}

View File

@ -32,8 +32,10 @@ type Path struct {
type Text struct {
FillStroke
Position
Text string `xml:",innerxml"`
Style string `xml:"style,attr,omitempty"`
FontSize float64 `xml:"font-size,attr,omitempty"`
FontFamily string `xml:"font-family,attr,omitempty"`
Text string `xml:",innerxml"`
Style string `xml:"style,attr,omitempty"`
}
/* shared attrs */