---
title: "How do I use a Hindi or other Unicode font in ReportLab PDFs?"  
description: "How do I use a Hindi or other Unicode font in ReportLab PDFs?"  
author: "Eetu Saarinen"  
published: 2026-11-30  
updated: 2026-11-30  
canonical: https://www.mindstick.com/forum/163167/how-do-i-use-a-hindi-or-other-unicode-font-in-reportlab-pdfs  
category: "python"  
tags: ["python", "ReportLab", "pdf"]  
reading_time: 2 minutes  

---

# How do I use a Hindi or other Unicode font in ReportLab PDFs?

I generate PDF invoices with ReportLab. When I add Hindi text, it shows as black boxes, and when I register a Hindi font, the letters appear but the matras and joined letters are in the wrong positions. How do I print Hindi correctly with ReportLab?

## Replies

### Reply by Vignesh Natarajan

There are two separate problems here.

### 1. Black boxes: font not registered

ReportLab's built-in fonts (Helvetica, Times) only contain Latin characters. You must register a TrueType font that includes Devanagari, such as Noto Sans Devanagari, Mukta or Hind:

```
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
pdfmetrics.registerFont(TTFont("NotoDeva", "NotoSansDevanagari-Regular.ttf"))
```

Then use "NotoDeva" as the font name in your canvas calls or paragraph styles. Keep the font file in your project and use a full path in production.

### 2. Wrong matras and conjuncts: text shaping

Devanagari needs "complex text shaping": the font's rules move the i-matra before the consonant, form half-letters and conjuncts, and position marks above and below. Classic ReportLab simply placed characters one after another, so Hindi looked broken.

Recent ReportLab versions (4.x) added text shaping support through HarfBuzz. To use it:

- Upgrade: pip install -U reportlab uharfbuzz
- Check the ReportLab release notes and user guide for your version on how to turn shaping on for a font, since the setting has changed between releases.
- Test with words that have the i-matra and conjuncts, such as kitab, shiksha and prakash written in Devanagari.

If your version cannot shape Devanagari correctly, other options are:

- Generate the invoice as HTML and convert it with WeasyPrint, which uses HarfBuzz and handles Hindi well.
- Use a headless browser (Playwright or Chrome) to print HTML to PDF.

Whatever method you use, embed the font (TrueType fonts are embedded automatically in ReportLab) so the PDF looks the same on every computer.


---

Original Source: https://www.mindstick.com/forum/163167/how-do-i-use-a-hindi-or-other-unicode-font-in-reportlab-pdfs

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
