Skip to content

Commit 0211860

Browse files
authored
Merge pull request #10086 from anntzer/deprecate-svgfont
Deprecate support for "svg fonts" font embedding.
2 parents 8249f8a + 5072e59 commit 0211860

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/matplotlib/rcsetup.py

+10-2
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
@@ -563,8 +564,15 @@ def validate_negative_linestyle_legacy(s):
563564
'center'], ignorecase=True)
564565

565566

566-
validate_svg_fonttype = ValidateInStrings('svg.fonttype',
567-
['none', 'path', 'svgfont'])
567+
def validate_svg_fonttype(s):
568+
if s in ["none", "path"]:
569+
return s
570+
if s == "svgfont":
571+
cbook.warn_deprecated(
572+
"2.2", "'svgfont' support for svg.fonttype is deprecated.")
573+
return s
574+
raise ValueError("Unrecognized svg.fonttype string '{}'; "
575+
"valid strings are 'none', 'path'")
568576

569577

570578
def validate_hinting(s):

0 commit comments

Comments
 (0)