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

Skip to content

Commit 5072e59

Browse files
committed
Deprecate support for svg fonts.
1 parent d24aea7 commit 5072e59

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import warnings
2525
import re
2626

27+
from matplotlib import cbook
2728
from matplotlib.cbook import mplDeprecation, deprecated, ls_mapper
2829
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
2930
from matplotlib.colors import is_color_like
@@ -570,8 +571,15 @@ def validate_corner_mask(s):
570571
'center'], ignorecase=True)
571572

572573

573-
validate_svg_fonttype = ValidateInStrings('svg.fonttype',
574-
['none', 'path', 'svgfont'])
574+
def validate_svg_fonttype(s):
575+
if s in ["none", "path"]:
576+
return s
577+
if s == "svgfont":
578+
cbook.warn_deprecated(
579+
"2.2", "'svgfont' support for svg.fonttype is deprecated.")
580+
return s
581+
raise ValueError("Unrecognized svg.fonttype string '{}'; "
582+
"valid strings are 'none', 'path'")
575583

576584

577585
def validate_hinting(s):

0 commit comments

Comments
 (0)