From 698a12c762a5d9977b84313080cd0a7a805d60c1 Mon Sep 17 00:00:00 2001 From: Travis Harrison Date: Thu, 17 Oct 2024 06:53:06 -0500 Subject: [PATCH] add cgraph setters for fontname (#89) --- cgraph/attribute.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cgraph/attribute.go b/cgraph/attribute.go index b18f16f..005b5b8 100644 --- a/cgraph/attribute.go +++ b/cgraph/attribute.go @@ -740,6 +740,30 @@ func (e *Edge) SetFontColor(v string) *Edge { return e } +// SetFontName +// Font used for text. +// https://graphviz.gitlab.io/_pages/doc/info/attrs.html#a:fontname +func (g *Graph) SetFontName(v string) *Graph { + g.SafeSet(string(fontNameAttr), v, "Times-Roman") + return g +} + +// SetFontName +// Font used for text. +// https://graphviz.gitlab.io/_pages/doc/info/attrs.html#a:fontname +func (n *Node) SetFontName(v string) *Node { + n.SafeSet(string(fontNameAttr), v, "Times-Roman") + return n +} + +// SetFontName +// Font used for text. +// https://graphviz.gitlab.io/_pages/doc/info/attrs.html#a:fontname +func (e *Edge) SetFontName(v string) *Edge { + e.SafeSet(string(fontNameAttr), v, "Times-Roman") + return e +} + // SetFontSize // Font size, in points, used for text. // https://graphviz.gitlab.io/_pages/doc/info/attrs.html#a:fontsize