16
16
import weakref
17
17
18
18
import matplotlib as mpl
19
- from matplotlib import _png , font_manager as fm , rcParams
19
+ from matplotlib import _png , cbook , font_manager as fm , rcParams
20
20
from matplotlib .backend_bases import (
21
21
_Backend , FigureCanvasBase , FigureManagerBase , GraphicsContextBase ,
22
22
RendererBase )
30
30
###############################################################################
31
31
32
32
33
+ @cbook .deprecated
33
34
def get_texcommand ():
34
35
"""Get chosen TeX system from rc."""
35
36
texsystem_options = ["xelatex" , "lualatex" , "pdflatex" ]
@@ -40,7 +41,7 @@ def get_texcommand():
40
41
def get_fontspec ():
41
42
"""Build fontspec preamble from rc."""
42
43
latex_fontspec = []
43
- texcommand = get_texcommand ()
44
+ texcommand = rcParams [ "pgf.texsystem" ]
44
45
45
46
if texcommand != "pdflatex" :
46
47
latex_fontspec .append ("\\ usepackage{fontspec}" )
@@ -126,7 +127,7 @@ def _font_properties_str(prop):
126
127
family = prop .get_family ()[0 ]
127
128
if family in families :
128
129
commands .append (families [family ])
129
- elif family in system_fonts and get_texcommand () != "pdflatex" :
130
+ elif family in system_fonts and rcParams [ "pgf.texsystem" ] != "pdflatex" :
130
131
commands .append (r"\setmainfont{%s}\rmfamily" % family )
131
132
else :
132
133
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