--- id: mplfonts version: "0.0.11" license: MIT license_treatment: permissive maintenance: active --- # mplfonts — Fonts manager for matplotlib License: permissive · Maintenance: active · Downloads: 128.0K/mo ## 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 above — 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 pip install mplfonts uv add mplfonts 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_current - Install friction: low - Maintenance: active - Downloads: 128.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags matplotlib cjk font support, chinese japanese korean text plotting, matplotlib font manager, tofu character rendering fix, cjk fonts matplotlib, font installation matplotlib, unicode text matplotlib, matplotlib-fonts, cjk-rendering, font-management [View on SkillFed](https://skillfed.io/packages/mplfonts) · [View on PyPI](https://pypi.org/project/mplfonts/)