Skip to content

Commit 698a12c

Browse files
authored
add cgraph setters for fontname (#89)
1 parent 4b44d4a commit 698a12c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

cgraph/attribute.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,30 @@ func (e *Edge) SetFontColor(v string) *Edge {
740740
return e
741741
}
742742

743+
// SetFontName
744+
// Font used for text.
745+
// https://graphviz.gitlab.io/_pages/doc/info/attrs.html#a:fontname
746+
func (g *Graph) SetFontName(v string) *Graph {
747+
g.SafeSet(string(fontNameAttr), v, "Times-Roman")
748+
return g
749+
}
750+
751+
// SetFontName
752+
// Font used for text.
753+
// https://graphviz.gitlab.io/_pages/doc/info/attrs.html#a:fontname
754+
func (n *Node) SetFontName(v string) *Node {
755+
n.SafeSet(string(fontNameAttr), v, "Times-Roman")
756+
return n
757+
}
758+
759+
// SetFontName
760+
// Font used for text.
761+
// https://graphviz.gitlab.io/_pages/doc/info/attrs.html#a:fontname
762+
func (e *Edge) SetFontName(v string) *Edge {
763+
e.SafeSet(string(fontNameAttr), v, "Times-Roman")
764+
return e
765+
}
766+
743767
// SetFontSize
744768
// Font size, in points, used for text.
745769
// https://graphviz.gitlab.io/_pages/doc/info/attrs.html#a:fontsize

0 commit comments

Comments
 (0)