MCPcopy Create free account
hub / github.com/tdewolff/canvas / String

Method String

font.go:89–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87}
88
89func (style FontStyle) String() string {
90 var s string
91 switch style.Weight() {
92 case FontThin:
93 s = "Thin"
94 case FontExtraLight:
95 s = "ExtraLight"
96 case FontLight:
97 s = "Light"
98 case FontRegular:
99 s = "Regular"
100 case FontMedium:
101 s = "Medium"
102 case FontSemiBold:
103 s = "SemiBold"
104 case FontBold:
105 s = "Bold"
106 case FontExtraBold:
107 s = "ExtraBold"
108 case FontBlack:
109 s = "Black"
110 default:
111 return "Unknown"
112 }
113 if style.Italic() {
114 s += " Italic"
115 }
116 return s
117}
118
119// FontVariant defines the font variant to be used for the font, such as subscript or smallcaps.
120type FontVariant int

Callers

nothing calls this directly

Calls 2

WeightMethod · 0.95
ItalicMethod · 0.95

Tested by

no test coverage detected