17
17
import weakref
18
18
19
19
import matplotlib as mpl
20
- from matplotlib import _png , font_manager as fm , rcParams
20
+ from matplotlib import _png , cbook , font_manager as fm , rcParams
21
21
from matplotlib .backend_bases import (
22
22
_Backend , FigureCanvasBase , FigureManagerBase , GraphicsContextBase ,
23
23
RendererBase )
29
29
###############################################################################
30
30
31
31
32
+ @cbook .deprecated
32
33
def get_texcommand ():
33
34
"""Get chosen TeX system from rc."""
34
35
texsystem_options = ["xelatex" , "lualatex" , "pdflatex" ]
@@ -39,7 +40,7 @@ def get_texcommand():
39
40
def get_fontspec ():
40
41
"""Build fontspec preamble from rc."""
41
42
latex_fontspec = []
42
- texcommand = get_texcommand ()
43
+ texcommand = rcParams [ "pgf.texsystem" ]
43
44
44
45
if texcommand != "pdflatex" :
45
46
latex_fontspec .append ("\\ usepackage{fontspec}" )
@@ -125,7 +126,7 @@ def _font_properties_str(prop):
125
126
family = prop .get_family ()[0 ]
126
127
if family in families :
127
128
commands .append (families [family ])
128
- elif family in system_fonts and get_texcommand () != "pdflatex" :
129
+ elif family in system_fonts and rcParams [ "pgf.texsystem" ] != "pdflatex" :
129
130
commands .append (r"\setmainfont{%s}\rmfamily" % family )
130
131
else :
131
132
pass # print warning?
@@ -195,7 +196,7 @@ class LatexManagerFactory(object):
195
196
196
197
@staticmethod
197
198
def get_latex_manager ():
198
- texcommand = get_texcommand ()
199
+ texcommand = rcParams [ "pgf.texsystem" ]
199
200
latex_header = LatexManager ._build_latex_header ()
200
201
prev = LatexManagerFactory .previous_instance
201
202
@@ -273,7 +274,7 @@ def __init__(self):
273
274
LatexManager ._unclean_instances .add (self )
274
275
275
276
# test the LaTeX setup to ensure a clean startup of the subprocess
276
- self .texcommand = get_texcommand ()
277
+ self .texcommand = rcParams [ "pgf.texsystem" ]
277
278
self .latex_header = LatexManager ._build_latex_header ()
278
279
latex_end = "\n \\ makeatletter\n \\ @@end\n "
279
280
try :
@@ -877,7 +878,7 @@ def _print_pdf_to_fh(self, fh, *args, **kwargs):
877
878
with codecs .open (fname_tex , "w" , "utf-8" ) as fh_tex :
878
879
fh_tex .write (latexcode )
879
880
880
- texcommand = get_texcommand ()
881
+ texcommand = rcParams [ "pgf.texsystem" ]
881
882
cmdargs = [str (texcommand ), "-interaction=nonstopmode" ,
882
883
"-halt-on-error" , "figure.tex" ]
883
884
try :
0 commit comments