Blog
Jupyter Vietnamese fonts in PDF: fix missing glyphs
If your Vietnamese text turns into boxes or broken characters, the root cause is usually the PDF export path and the font stack. These fixes keep Unicode text intact.
Updated May 19, 2026
Why glyphs disappear in PDF exports
Many Jupyter PDF exports rely on LaTeX. Default TeX fonts do not include all Vietnamese glyphs, so you see missing characters or square boxes. The fastest fix is to use a Unicode font and a renderer that preserves it.
Use a Unicode font in the notebook
- Pick a font with full Vietnamese coverage like Noto Sans, DejaVu Sans, or Times New Roman.
- Apply the font to plots and any custom HTML you inject.
- Make sure the font is installed on the machine doing the export.
Set matplotlib font explicitly
import matplotlib as mpl mpl.rcParams["font.family"] = "DejaVu Sans" mpl.rcParams["axes.unicode_minus"] = False
This ensures charts render Vietnamese characters correctly, even when the notebook is converted outside your local environment.
Prefer HTML to PDF or a Chromium renderer
HTML export keeps Unicode text intact, and Chromium based PDF rendering respects installed system fonts. This often avoids the LaTeX font gap entirely.
Quick validation checklist
- Test one page with Vietnamese headings, body text, and chart labels.
- Check tables, code output, and figure captions for missing glyphs.
- Export a short notebook before committing to a large report.
When you need consistent output
If your team shares notebooks across different machines, use a cloud renderer that bundles fonts and a stable PDF engine. This keeps the output consistent across Windows, macOS, and Linux.