Commit 980fbee
committed
Add missing decode() in svg font embedding path.
Otherwise,
rcParams["svg.fonttype"] = "svgfont"; title("foo"); savefig("/tmp/test.svg")
fails (on Py3) with
File ".../backend_svg.py", line 86, in escape_attrib
s = s.replace("&", "&")
TypeError: a bytes-like object is required, not 'str'
The encoding of entry 1, 0, 0, 4 in the sfnt table is macroman
(https://www.freetype.org/freetype2/docs/reference/ft2-truetype_tables.html#TT_MAC_ID_XXX).
Note that after the fix is applied, the resulting svg file still appears
to be unopenable by inkscape, so the fix is not complete, but hopefully
a step in the correct direction.1 parent 7a6bab7 commit 980fbee
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
| |||
0 commit comments