Use font-size in texts of svg context
This commit is contained in:
parent
90f962641f
commit
3af25f5588
2 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue