Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc3a4c1

Browse files
committed
Merge 'xwtang/svg-fontweight-fix' into master
This was PR #3346, but merged to master instead of v1.4.x
2 parents 441b971 + 573033d commit cc3a4c1

File tree

3 files changed

+1137
-1
lines changed

3 files changed

+1137
-1
lines changed

lib/matplotlib/backends/backend_svg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,7 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath, mtext=None):
10131013
style['font-size'] = six.text_type(fontsize) + 'px'
10141014
style['font-family'] = six.text_type(fontfamily)
10151015
style['font-style'] = prop.get_style().lower()
1016+
style['font-weight'] = prop.get_weight().lower()
10161017
attrib['style'] = generate_css(style)
10171018

10181019
if mtext and (angle == 0 or mtext.get_rotation_mode() == "anchor"):
@@ -1081,7 +1082,8 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath, mtext=None):
10811082
style = generate_css({
10821083
'font-size': six.text_type(fontsize) + 'px',
10831084
'font-family': font.family_name,
1084-
'font-style': font.style_name.lower()})
1085+
'font-style': font.style_name.lower(),
1086+
'font-weight': font.style_name.lower()})
10851087
if thetext == 32:
10861088
thetext = 0xa0 # non-breaking space
10871089
spans.setdefault(style, []).append((new_x, -new_y, thetext))

0 commit comments

Comments
 (0)