Bug summary
After upgrading from Matplotlib 3.9.4 to 3.11.0, PDF files generated with the default
DejaVu Sans font and pdf.fonttype = 42 became significantly larger.
Additionally, words containing the character sequence fl (for example, Ecoflow)
are rendered with a ligature, while this did not happen with Matplotlib 3.9.x.
The same code, data, and font are used in both versions.
Expected behavior
- PDF size should remain similar to Matplotlib 3.9.4.
- The text
Ecoflow should be rendered as separate f and l glyphs.
- Only the required font subset should be embedded.
Actual behavior
With Matplotlib 3.11.0:
- PDF size increases.
- The sequence
fl is rendered as a ligature.
- The issue only occurs when using
pdf.fonttype = 42.
Working configuration:
- Python: 3.9.13
- Matplotlib: 3.9.4
Affected configuration:
- Python: 3.14.6
- Matplotlib: 3.11.0
Code for reproduction
import matplotlib
from matplotlib.figure import Figure
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['pdf.compression'] = 9
fig = Figure()
ax = fig.subplots()
ax.set_title("Ecoflow")
fig.savefig("ligature-bug.pdf")
Actual outcome
Expected outcome
Additional information
No response
Operating system
Debian
Matplotlib Version
3.11.0
Matplotlib Backend
agg
Python version
Python 3.14.6
Jupyter version
No response
Installation
pip
Bug summary
After upgrading from Matplotlib 3.9.4 to 3.11.0, PDF files generated with the default
DejaVu Sansfont andpdf.fonttype = 42became significantly larger.Additionally, words containing the character sequence
fl(for example,Ecoflow)are rendered with a ligature, while this did not happen with Matplotlib 3.9.x.
The same code, data, and font are used in both versions.
Expected behavior
Ecoflowshould be rendered as separatefandlglyphs.Actual behavior
With Matplotlib 3.11.0:
flis rendered as a ligature.pdf.fonttype = 42.Working configuration:
Affected configuration:
Code for reproduction
Actual outcome
Expected outcome
Additional information
No response
Operating system
Debian
Matplotlib Version
3.11.0
Matplotlib Backend
agg
Python version
Python 3.14.6
Jupyter version
No response
Installation
pip