Saving to svg fails with use of textcomp character

Bug #1438278 reported by Christopher Barrington-Leigh on 2015-03-30
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
matplotlib
New
Unknown
matplotlib (Ubuntu)
Undecided
Unassigned

Bug Description

The following code (under standard packages of Ubuntu 15.04)

from pylab import *
pp={'text.usetex': True,
           'text.latex.unicode': True,
           }
rcParams.update(pp)

plot(1,1)
ylabel(r'\textwon')
savefig('tmp.pdf')
print('Saved pdf')
savefig('tmp.png')
print('Saved png')
savefig('tmp.svg')
print('Saved svg')

gives output:

Saved pdf
Saved png
/usr/lib/python2.7/dist-packages/matplotlib/textpath.py:387: UserWarning: The glyph (142) of font (/usr/share/texmf/fonts/type1/public/cm-super/sfrm3583.pfb) cannot be converted with the encoding. Glyph may be wrong
  "be wrong" % (glyph, font_bunch.filename))
Saved svg

While the files pdf and png have the \textwon character properly rendered, it is missing from the svg.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: python-matplotlib 1.4.2-3.1
ProcVersionSignature: Ubuntu 3.19.0-10.10-generic 3.19.2
Uname: Linux 3.19.0-10-generic x86_64
ApportVersion: 2.16.2-0ubuntu5
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Mar 30 11:24:28 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-03-28 (1 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Beta amd64 (20150325)
SourcePackage: matplotlib
UpgradeStatus: No upgrade log present (probably fresh install)

Behaviour is even worse after my upgrade 16.04:

The following crashes ipython:

pp={'text.usetex': True, 'text.latex.unicode': True,}
rcParams.update(pp)
plot(1,1)
ylabel(r'\textwon')

ragnaroknroll (ragnaroknroll) wrote :

I can confirm that this bug is affecting me too on Linux Mint 18.1 using matplotlib 2.0. Some glyphs cannot be successfully converted when saving as SVG with text.usetex set to True. Surprisingly, setting svg.fonttype from path to none does not solve this problem either. A fix would be much appreciated.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in matplotlib (Ubuntu):
status: New → Confirmed
Changed in matplotlib:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.