File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 1- # encoding: utf-8
1+ # -*- encoding: utf-8 -*-
2+ """
3+ Test the PDF backend with the option use14corefonts=True.
24
3- import matplotlib
4- matplotlib .use ('PDF' )
5+ Font cache issue
6+ ----------------
7+
8+ The font cache doesn't record whether it was build with
9+ pdf.use14corefonts enabled or not, and the font name "Helvetica"
10+ happens to match "Helvetica Narrow", whose metrics are included with
11+ matplotlib, and using that AFM file without including the font itself
12+ breaks the output.
13+
14+ As a workaround, please reset the font cache by deleting
15+ ~/.matplotlib/fontList.cache each time you enable or disable
16+ use14corefonts.
17+ """
518
619from matplotlib import rcParams
7- import pylab
820
21+ rcParams ['backend' ] = 'pdf'
922rcParams ['pdf.use14corefonts' ] = True
1023rcParams ['font.family' ] = 'sans-serif'
1124rcParams ['font.size' ] = 8
1225rcParams ['font.sans-serif' ] = ['Helvetica' ]
1326
27+ import pylab
28+
1429title = u'Test PDF backend with option use14corefonts=True'
1530
1631text = u'''A three-line text positioned just above a blue line
You can’t perform that action at this time.
0 commit comments