Skip to content

Commit c55e83d

Browse files
hajimehoshiclaude
andcommitted
basicwidget: point SetBold at Weight for reading
TextStyle.SetBold has no Bold getter, as bold is a point on the weight axis rather than a boolean, and a getter would have to invent a threshold for which weights count as bold. Note in its doc comment that TextStyle.Weight reads the weight back, alongside the existing pointer at UnsetWeight for unsetting it. Updates #131 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 6f86d8d commit c55e83d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

basicwidget/textstyle.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ func (s *TextStyle) Weight() (text.Weight, bool) {
118118
}
119119

120120
// SetBold sets the font weight to the bold or the medium weight by setting
121-
// the wght variation axis. Use [TextStyle.UnsetWeight] to unset the weight.
121+
// the wght variation axis. Use [TextStyle.UnsetWeight] to unset the weight
122+
// and [TextStyle.Weight] to read it back.
122123
func (s *TextStyle) SetBold(bold bool) {
123124
weight := text.WeightMedium
124125
if bold {

0 commit comments

Comments
 (0)