Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/matplotlib/backends/backend_macosx.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
else:
family = prop.get_family()
weight = prop.get_weight()
# transform weight into string for the native backend
if weight >= 700:
weight = 'bold'
else:
weight = 'normal'
style = prop.get_style()
points = prop.get_size_in_points()
size = self.points_to_pixels(points)
Expand All @@ -159,6 +164,11 @@ def get_text_width_height_descent(self, s, prop, ismath):
return width, height, descent
family = prop.get_family()
weight = prop.get_weight()
# transform weight into string for the native backend
if weight >= 700:
weight = 'bold'
else:
weight = 'normal'
style = prop.get_style()
points = prop.get_size_in_points()
size = self.points_to_pixels(points)
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ def set_weight(self, weight):
except ValueError:
if weight not in weight_dict:
raise ValueError("weight is invalid")
weight = weight_dict[weight]
self._weight = weight

def set_stretch(self, stretch):
Expand Down