Skip to content

Commit 39bfc6f

Browse files
committed
Merge pull request matplotlib#120 from pv/svg-case-sensitivity
BUG: backends/svg: ensure that the font-style property is lowercase
2 parents bfe83c7 + 283de6b commit 39bfc6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/backends/backend_svg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def _write_svgfonts(self):
440440
'font-face',
441441
attrib={
442442
'font-family': font.family_name,
443-
'font-style': font.style_name,
443+
'font-style': font.style_name.lower(),
444444
'units-per-em': '72',
445445
'bbox': ' '.join(str(x / 64.0) for x in font.bbox)})
446446
for char in chars:
@@ -896,7 +896,7 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath):
896896
attrib = {}
897897
style['font-size'] = str(fontsize)
898898
style['font-family'] = str(fontfamily)
899-
style['font-style'] = prop.get_style()
899+
style['font-style'] = prop.get_style().lower()
900900
attrib['style'] = generate_css(style)
901901

902902
attrib['transform'] = generate_transform([
@@ -937,7 +937,7 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath):
937937
style = generate_css({
938938
'font-size': str(fontsize),
939939
'font-family': font.family_name,
940-
'font-style': font.style_name})
940+
'font-style': font.style_name.lower()})
941941
if thetext == 32:
942942
thetext = 0xa0 # non-breaking space
943943
spans.setdefault(style, []).append((new_x, -new_y, thetext))

0 commit comments

Comments
 (0)