File tree 1 file changed +19
-4
lines changed
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.
2
4
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
+ """
5
18
6
19
from matplotlib import rcParams
7
- import pylab
8
20
21
+ rcParams ['backend' ] = 'pdf'
9
22
rcParams ['pdf.use14corefonts' ] = True
10
23
rcParams ['font.family' ] = 'sans-serif'
11
24
rcParams ['font.size' ] = 8
12
25
rcParams ['font.sans-serif' ] = ['Helvetica' ]
13
26
27
+ import pylab
28
+
14
29
title = u'Test PDF backend with option use14corefonts=True'
15
30
16
31
text = u'''A three-line text positioned just above a blue line
You can’t perform that action at this time.
0 commit comments