Skip to content

Large TrueType font does not render correctly when saving in .pdf #7937

Closed
@TomDLT

Description

@TomDLT

Bug summary

Large TrueType serif font does not render correctly when saving in .pdf

Interestingly, the bug does not happen when:

  • saving in .png
  • using default font size
  • using sans-serif font
  • using type 3 font

Code for reproduction

import matplotlib as mpl
import matplotlib.pyplot as plt

for param in [3, 42]:
    mpl.rcParams['pdf.fonttype'] = param
    mpl.rcParams["font.family"] = "serif"
    mpl.rcParams["font.size"] = 20

    fig = plt.figure()
    plt.plot([0, 1])
    plt.title('This is the title')

    fig.savefig('save_%d.pdf' % param)
    plt.close(fig)

Actual outcome
save_42.pdf

Expected outcome
save_3.pdf

Matplotlib version

Matplotlib 2.0.0 installed with conda (same behavior with pip)

System version
Linux-3.16.0-4-amd64-x86_64-with-debian-8.7
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.backend: pdftopic: text

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions