skillfed

mplfonts

Fonts manager for matplotlib

mplfonts v0.0.11 128.0K downloads/30d#11,723 on PyPI91
Permissive license MIT Active released

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 mplfonts

uv

uv add mplfonts

poetry

poetry add mplfonts

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

matplotlib cjk font supportchinese japanese korean text plottingmatplotlib font managertofu character rendering fixcjk fonts matplotlibfont installation matplotlibunicode text matplotlib
matplotlib-fontscjk-renderingfont-management

More Graphics packages