Skip to content

Missing kerning in PDFs with Type 42 font #20614

Closed
@sauerburger

Description

@sauerburger

Bug report

Bug summary

Text in PDF files created with the rcParams["pdf.fonttype"] = 42 setting does not have any kerning. This can lead to text overflowing the legend box.

Code for reproduction

import matplotlib.pyplot as plt
from matplotlib import rcParams

rcParams["pdf.fonttype"] = 42

plt.plot([0, 1], [0, 1], label="Hello AVATAVATAVATAVATAVATAVAT")
plt.legend()

plt.savefig("kern42.pdf")

Actual outcome
kern42_pdf
kern42.pdf

Expected outcome
kern42_pdf
kern42.pdf

Matplotlib version

  • Operating system: Debian 11
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): 3.4.2
  • Matplotlib backend (print(matplotlib.get_backend())): TkAgg (PS I assume)
  • Python version: 3.9.2
  • I've installed Matplotlib with pip in a virtualenv

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions