mplfonts
Fonts manager for matplotlib
What it is and what it does
mplfonts is a font manager for Matplotlib that solves the "tofu" problem—the display of placeholder boxes instead of actual characters—when plotting with CJK text. It provides both a command-line interface and a Python API to manage fonts. The package comes bundled with several open-source CJK typefaces (Noto Sans/Serif CJK SC, Source Han Serif/Mono SC) and handles Matplotlib configuration automatically during initialization.
You install it once with `mplfonts init`, which sets up your Matplotlib configuration for CJK support, then use the `use_font()` function in your plotting scripts to switch between available fonts. The tool also lets you install custom fonts from your system and list all available typefaces. It depends on Matplotlib, NumPy, fontmeta for font metadata, and fire for its CLI.
Use it for:
- Plotting scientific data with Chinese, Japanese, or Korean labels and titles in Jupyter notebooks or scripts.
- Creating publication-ready visualizations with CJK text without manual font configuration.
- Switching between multiple CJK typefaces (serif vs. sans-serif, different regional variants) within a single project.
- Installing and managing custom fonts alongside Matplotlib's built-in typefaces via command line.
- Automating font setup in data analysis pipelines that generate multilingual reports.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Manages Matplotlib fonts and solves CJK (Chinese, Japanese, Korean) character rendering by providing a command-line tool and Python API to install, list, and switch between fonts including bundled open-source CJK typefaces.
Yes. If you plot with CJK text in Matplotlib, this package eliminates a common pain point with a single initialization command and minimal dependencies. The MIT license, active maintenance, low install friction, and zero known vulnerabilities make it a safe, practical choice. Install it if you need CJK rendering; skip it if you only use Latin-script languages.
Install
mplfonts on PyPI
pip
pip install mplfontsuv
uv add mplfontspoetry
poetry add mplfontsInstalling mplfonts
Before you install
Low friction: pure Python wheel with four straightforward runtime dependencies (fire, fontmeta, matplotlib, numpy). Repository is active with recent commits and no archived status.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install mplfonts
mplfonts init
from mplfonts import use_font
use_font('Noto Serif CJK SC')
# matplotlib plotting code here
Requires Python 3.9 or later; mplfonts init modifies your matplotlibrc configuration file.
Verify before relying
- Whether bundled CJK fonts (Noto Sans/Serif CJK SC, Source Han Serif/Mono SC) are automatically downloaded during installation or require separate setup.
- Whether the package works on all major operating systems (Windows, macOS, Linux) or has platform-specific limitations.
- Performance impact of font switching on large-scale plotting workflows.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — fire, fontmeta, matplotlib, numpy |
| Maintenance | actively maintained — 139 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 128,022/month — #11,723 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mplfonts-0.0.11-py3-none-any.whl
Keywords: matplotlib, fonts, manager
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
koreanize-matplotlibAutomatically configures matplotlib to display…
permissive · top 15,000 on PyPI
matplotlib-fontjaEnables Japanese text rendering in matplotlib…
permissive · top 15,000 on PyPI
japanize-matplotlibEnables matplotlib to display Japanese text in…
permissive · top 15,000 on PyPI
mplhep-dataDistributes fonts and data files for the mplhep…
permissive · top 15,000 on PyPI
pymupdf-fontsProvides a collection of optional fonts…
unclear · top 15,000 on PyPI
fontbakeryFont Bakery is a command-line tool that checks…
unclear · top 15,000 on PyPI
rendercv-fontsProvides a collection of fonts packaged for use…
permissive · top 15,000 on PyPI
pyfigletRenders ASCII text as ASCII art using a variety…
permissive · top 5,000 on PyPI
mplhepmplhep provides matplotlib styling and helper…
permissive · top 15,000 on PyPI
zhonZhon provides character constants and regular…
permissive · top 15,000 on PyPI