Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PGF-related test failures on Mac OS-X #2097

Closed
mdboom opened this issue May 31, 2013 · 21 comments · Fixed by #2829
Closed

PGF-related test failures on Mac OS-X #2097

mdboom opened this issue May 31, 2013 · 21 comments · Fixed by #2829
Assignees
Milestone

Comments

@mdboom
Copy link
Member

mdboom commented May 31, 2013

These were reported by @r-owen in the process of making osx binaries for 1.3.0rc2. @pwuertz: do you have any ideas? Something to do with the TeX environment?

======================================================================
ERROR: matplotlib.tests.test_backend_pgf.test_pathclip
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/tests/test_backend_pgf.py", line 45, in backend_switcher
    result = func(*args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/tests/test_backend_pgf.py", line 145, in test_pathclip
    plt.savefig(os.path.join(result_dir, "pgf_pathclip.pdf"))
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/pyplot.py", line 561, in savefig
    return fig.savefig(*args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/figure.py", line 1410, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backend_bases.py", line 2220, in print_figure
    **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 864, in print_pdf
    self._print_pdf_to_fh(fh, *args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 822, in _print_pdf_to_fh
    self.print_pgf(fname_pgf, *args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 804, in print_pgf
    self._print_pgf_to_fh(fh, *args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 784, in _print_pgf_to_fh
    RendererPgf(self.figure, fh),
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 409, in __init__
    self.latexManager = LatexManagerFactory.get_latex_manager()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 223, in get_latex_manager
    new_inst = LatexManager()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 309, in __init__
    raise LatexError("LaTeX returned an error, probably missing font or 
error in preamble:\n%s" % stdout)
LatexError: LaTeX returned an error, probably missing font or error in 
preamble:
This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012)
 restricted \write18 enabled.
**entering extended mode
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, 
nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, 
ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, 
czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, 
finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, 
greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, 
malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, 
italian, 
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, 
nynorsk,
 polish, portuguese, romanian, romansh, russian, sanskrit, serbian, 
serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, 
uppersorbian, 
welsh, loaded.

*(/usr/local/texlive/2012/texmf-dist/tex/latex/base/minimal.cls
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
)
(Please type a command or say `\end')
*
*(/usr/local/texlive/2012/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3names.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/etex-pkg/etex.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/color.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/latexconfig/color.cfg)
(/usr/local/texlive/2012/texmf-dist/tex/xelatex/xetex-def/xetex.def))
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/latexconfig/graphics.cfg))
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3basics.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3expan.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3tl.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3seq.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3int.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3quark.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3prg.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3clist.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3token.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3prop.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3msg.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3file.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3skip.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3keys.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3fp.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3box.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3coffins.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3color.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3luatex.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3packages/xparse/xparse.st
y)
(/usr/local/texlive/2012/texmf-dist/tex/latex/fontspec/fontspec-patches.s
ty
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/fixltx2e.sty)
*************************************************
* LaTeX warning: "xparse/redefine-command"
* 
* Redefining document command \oldstylenums with arg. spec. 'm' on line 
107.
*************************************************
) 
(/usr/local/texlive/2012/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/local/texlive/2012/texmf-dist/tex/latex/euenc/eu1lmr.fd))
(/usr/local/texlive/2012/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/tipa/t3enc.def
(/usr/local/texlive/2012/texmf-dist/tex/latex/euenc/eu1lmss.fd))
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/keyval.sty)))
(/usr/local/texlive/2012/texmf-dist/tex/latex/fontspec/fontspec.cfg)))

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "Bitstream Vera Serif" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

<*> \setmainfont{Bitstream Vera Serif}

No pages of output.
Transcript written on texput.log.


======================================================================
ERROR: matplotlib.tests.test_backend_pgf.test_mixedmode
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/tests/test_backend_pgf.py", line 45, in backend_switcher
    result = func(*args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/tests/test_backend_pgf.py", line 157, in test_mixedmode
    compare_figure('pgf_mixedmode.pdf')
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/tests/test_backend_pgf.py", line 56, in compare_figure
    plt.savefig(actual)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/pyplot.py", line 561, in savefig
    return fig.savefig(*args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/figure.py", line 1410, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backend_bases.py", line 2220, in print_figure
    **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 864, in print_pdf
    self._print_pdf_to_fh(fh, *args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 822, in _print_pdf_to_fh
    self.print_pgf(fname_pgf, *args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 804, in print_pgf
    self._print_pgf_to_fh(fh, *args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 784, in _print_pgf_to_fh
    RendererPgf(self.figure, fh),
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 409, in __init__
    self.latexManager = LatexManagerFactory.get_latex_manager()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 223, in get_latex_manager
    new_inst = LatexManager()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac
kages/matplotlib/backends/backend_pgf.py", line 309, in __init__
    raise LatexError("LaTeX returned an error, probably missing font or 
error in preamble:\n%s" % stdout)
LatexError: LaTeX returned an error, probably missing font or error in 
preamble:
This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012)
 restricted \write18 enabled.
**entering extended mode
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, 
nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, 
ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, 
czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, 
finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, 
greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, 
malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, 
italian, 
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, 
nynorsk,
 polish, portuguese, romanian, romansh, russian, sanskrit, serbian, 
serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, 
uppersorbian, 
welsh, loaded.

*(/usr/local/texlive/2012/texmf-dist/tex/latex/base/minimal.cls
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
)
(Please type a command or say `\end')
*
*(/usr/local/texlive/2012/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3names.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/etex-pkg/etex.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/color.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/latexconfig/color.cfg)
(/usr/local/texlive/2012/texmf-dist/tex/xelatex/xetex-def/xetex.def))
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/latexconfig/graphics.cfg))
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3basics.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3expan.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3tl.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3seq.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3int.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3quark.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3prg.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3clist.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3token.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3prop.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3msg.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3file.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3skip.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3keys.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3fp.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3box.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3coffins.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3color.sty)
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3kernel/l3luatex.sty))
(/usr/local/texlive/2012/texmf-dist/tex/latex/l3packages/xparse/xparse.st
y)
(/usr/local/texlive/2012/texmf-dist/tex/latex/fontspec/fontspec-patches.s
ty
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/fixltx2e.sty)
*************************************************
* LaTeX warning: "xparse/redefine-command"
* 
* Redefining document command \oldstylenums with arg. spec. 'm' on line 
107.
*************************************************
) 
(/usr/local/texlive/2012/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/local/texlive/2012/texmf-dist/tex/latex/euenc/eu1lmr.fd))
(/usr/local/texlive/2012/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/tipa/t3enc.def
(/usr/local/texlive/2012/texmf-dist/tex/latex/euenc/eu1lmss.fd))
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/keyval.sty)))
(/usr/local/texlive/2012/texmf-dist/tex/latex/fontspec/fontspec.cfg)))

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "Bitstream Vera Serif" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

<*> \setmainfont{Bitstream Vera Serif}

No pages of output.
Transcript written on texput.log.
@pwuertz
Copy link
Contributor

pwuertz commented May 31, 2013

It looks like XeTeX cannot find the Bitstream Vera Serif system font. The odd thing about this is that the backend shouldn't have selected a font that isn't in the list of system fonts. I'm retrieving that list from font_manager.findSystemFonts().

Is it possible that findSystemFonts includes the fonts provided by the matplotlib package? These are probably unknown to the OS and thus not available to XeTeX.

@pwuertz
Copy link
Contributor

pwuertz commented May 31, 2013

However, if Bitstream Vera Serif is indeed a regular system font there is something wrong with the TeX environment.

@jenshnielsen
Copy link
Member

I have seen this issue too on OSX. Installing bitstream vera true type fonts makes the test pass. So yes the problem is that a non system available font is selected.

@pwuertz
Copy link
Contributor

pwuertz commented May 31, 2013

Ok, then it is a question of whether matplotlib fonts should show up in font_manager.findSystemFonts() or not.

@pwuertz
Copy link
Contributor

pwuertz commented Jun 2, 2013

@jenshnielsen Are you able to confirm that Bitstream Vera Serif is in the list retrieved from font_manager.findSystemFonts() on a system without this font installed?

@jenshnielsen
Copy link
Member

The output of Vera fonts on my mac without any user installed fonts is (here the test failed)

a = font_manager.findSystemFonts()
matching = [s for s in a if "Vera" in s]
matching = 
['/usr/X11R6/lib/X11/fonts/TTF/VeraBd.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraBI.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraSe.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraMoBI.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraMoIt.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraBd.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraMono.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraMoBd.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraSe.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraIt.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraMoIt.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraMoBd.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraMono.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraIt.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/Vera.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraBI.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraSeBd.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraSeBd.ttf',
 '/usr/X11/lib/X11/fonts/TTF/Vera.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraMoBI.ttf']

I guess these fonts may be installed by Xquarts ? Which I have installed but XeTeX does not use them.

With user installed fonts. Here the tests pass.

['/usr/X11R6/lib/X11/fonts/TTF/VeraBd.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraBI.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraMoIt.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraSe.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraMoBI.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraMono.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraBI.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraSeBd.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraBd.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraBd.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraMono.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraSe.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraMoIt.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraMoBd.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraSe.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraIt.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraMoBd.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraMoIt.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraMoBd.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraMono.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraIt.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/Vera.ttf',
 '/Users/jenshnielsen/Library/Fonts/Vera.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraBI.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraMoBI.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraSeBd.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraIt.ttf',
 '/usr/X11R6/lib/X11/fonts/TTF/VeraSeBd.ttf',
 '/usr/X11/lib/X11/fonts/TTF/Vera.ttf',
 '/usr/X11/lib/X11/fonts/TTF/VeraMoBI.ttf']

I have not tried to uninstall Xquarts

@jenshnielsen
Copy link
Member

The X11 fonts are not install into the Mac OS Font viewer "Font Book". I can't remember how XeTeX findes the fonts but this might be the explanation?

@pwuertz
Copy link
Contributor

pwuertz commented Jun 2, 2013

This could indeed explain the issue. XeTeX uses OS-native methods for finding fonts. If OSX applications don't know about X11 fonts then XeTeX won't find them neither. I was thinking about using fontconfig to retrieve the list of system fonts. Do you know if the fc-list command is always available on OSX? Is it safe to assume that it's always present on Linux?

@ghost ghost assigned pwuertz Jun 2, 2013
@jenshnielsen
Copy link
Member

I have fc-list which does not fine the X11 fonts. That seems like a good solution. But it is installed by fontconfig from homebrew as a dependency of pango so I don't think we can rely on that being available all the time.

@mdboom
Copy link
Member Author

mdboom commented Jun 4, 2013

findSystemFonts is a poorly named function. It's really intended to find more than just fonts that ship with matplotlib.

We do have win32InstalledFonts and OSXInstalledFonts however, so maybe we should add a function that wraps those that only returns "os findable" fonts and use that.

@jenshnielsen
Copy link
Member

Yes that works as expected and does not return the X11 fonts.

a = font_manager.OSXInstalledFonts()
matching = [s for s in a if "Vera" in s]
['/Users/jenshnielsen/Library/Fonts/Vera.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraBd.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraBI.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraIt.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraMoBd.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraMoBI.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraMoIt.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraMono.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraSe.ttf',
 '/Users/jenshnielsen/Library/Fonts/VeraSeBd.ttf']

@pwuertz
Copy link
Contributor

pwuertz commented Jun 4, 2013

Ok, I'm going to prepare a patch that replaces findSystemFonts by win32InstalledFonts for win32 and a fc-list call for other systems. I think it's safe to assume that fontconfig is installed on unixoid systems, especially when a LaTeX distribution is present.

@dmcdougall
Copy link
Member

@pwuertz Does 9ccacff fix the issue? If so, I'm not sure it has been made into a pull request. Would you be able to do that so we can test it?

@dmcdougall
Copy link
Member

I'm moving this out of blocker status, and into a v1.3 bugfix release milestone.

@mdboom
Copy link
Member Author

mdboom commented Sep 17, 2013

Closed by #2117.

@mdboom mdboom closed this as completed Sep 17, 2013
@pwuertz pwuertz reopened this Sep 17, 2013
@a59
Copy link

a59 commented Jan 3, 2014

What is the status of fixing this?

@aldanor
Copy link

aldanor commented Feb 7, 2014

Same question; pgf still fails badly on OS X.

@tacaswell
Copy link
Member

@pwuertz Can your re-base this commit (https://github.com/pwuertz/matplotlib/commit/9ccacffe81e0d4a48e4a4b19064460b94c6f77c9) on current master and push it back up? There is something very fishy going on with github here.

@pwuertz
Copy link
Contributor

pwuertz commented Feb 21, 2014

I put the PR back up (#2829). As mentioned before, I still have no clue if it is safe to assume that fc-list is always present on OSX systems with latex installed.

@tacaswell tacaswell modified the milestones: v1.4.0, v1.3.x Feb 26, 2014
tacaswell added a commit that referenced this issue Apr 17, 2014
(fix #2097) PGF: get fonts from fc-list, use builtin fonts for tests
@nicola
Copy link

nicola commented Mar 29, 2015

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "Bitstream Vera Serif" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

<*> \setmainfont{Bitstream Vera Serif}

:(

@pwuertz
Copy link
Contributor

pwuertz commented Mar 29, 2015

@nicola Is this an error from running the pgf tests? As far as I can see I removed any dependency on system fonts alltogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants