bangla-render: Correct Bengali text rendering for Matplotlib & Seaborn using Qt/HarfBuzz

High-quality visualization is an essential component of data analysis in Bengali, including social media monitoring, educational dashboards, and research plots. However, the widely used Matplotlib library lacks OpenType shaping support, resulting in incorrect rendering of Bengali text; dependent vowels, reph, and conjunct consonants are often displayed in an incorrect sequence or remain uncomposed. As a result, plot titles, axis labels, and heatmap annotations in Bengali are often unreadable, forcing practitioners to rely on manual image editing or non-Unicode font hacks. This paper introduces bangla-render , an open-source Python library for correct Bengali text rendering in Matplotlib and Seaborn using Qt’s HarfBuzz-based text layout engine. Our approach renders Unicode Bengali strings to a QImage , converts them to an RGBA NumPy array, and inserts them as high-resolution raster images through Matplotlib’s AnnotationBbox . The library exposes a high-level API for Bengali titles, axis labels, tick labels, annotations, and heatmap cell text, together with an event-driven layout engine that automatically reduces label overlap across single- and multi-subplot figures. An LRU render cache reduces repeated-label latency by approximately 4 × . We demonstrate the library on standard 2D plots, Seaborn heatmaps, and confusion matrices for Bengali text classification tasks, and verify correct operation on hosted notebook environments including Kaggle and Google Colab. In a 20-string correctness evaluation covering dependent vowels, reph forms, conjunct consonants, and multi-conjunct clusters, default Matplotlib rendered 1/20 strings correctly, whereas bangla-render rendered 20/20 correctly in the tested environment. The rendering pipeline is language-agnostic and has also been verified for Hindi (Devanagari) and Tamil. The software is cross-platform, pip-installable, and aims to fill a long-standing gap in the Python scientific ecosystem for Bengali users.

Authors

Institutions

Publication Details

Journal
SoftwareX
Published
2026-04-16
DOI
https://doi.org/10.1016/j.softx.2026.102649
Primary Topic
Data Visualization and Analytics
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

bangla-render: Correct Bengali text rendering for Matplotlib & Seaborn using Qt/HarfBuzz

Mrinal Basak Shuvo
SoftwareX
Data Visualization and Analytics
article

bangla-render: Correct Bengali text rendering for Matplotlib & Seaborn using Qt/HarfBuzz

Mrinal Basak Shuvo
article en

Abstract

High-quality visualization is an essential component of data analysis in Bengali, including social media monitoring, educational dashboards, and research plots. However, the widely used Matplotlib library lacks OpenType shaping support, resulting in incorrect rendering of Bengali text; dependent vowels, reph, and conjunct consonants are often displayed in an incorrect sequence or remain uncomposed. As a result, plot titles, axis labels, and heatmap annotations in Bengali are often unreadable, forcing practitioners to rely on manual image editing or non-Unicode font hacks. This paper introduces bangla-render , an open-source Python library for correct Bengali text rendering in Matplotlib and Seaborn using Qt’s HarfBuzz-based text layout engine. Our approach renders Unicode Bengali strings to a QImage , converts them to an RGBA NumPy array, and inserts them as high-resolution raster images through Matplotlib’s AnnotationBbox . The library exposes a high-level API for Bengali titles, axis labels, tick labels, annotations, and heatmap cell text, together with an event-driven layout engine that automatically reduces label overlap across single- and multi-subplot figures. An LRU render cache reduces repeated-label latency by approximately 4 × . We demonstrate the library on standard 2D plots, Seaborn heatmaps, and confusion matrices for Bengali text classification tasks, and verify correct operation on hosted notebook environments including Kaggle and Google Colab. In a 20-string correctness evaluation covering dependent vowels, reph forms, conjunct consonants, and multi-conjunct clusters, default Matplotlib rendered 1/20 strings correctly, whereas bangla-render rendered 20/20 correctly in the tested environment. The rendering pipeline is language-agnostic and has also been verified for Hindi (Devanagari) and Tamil. The software is cross-platform, pip-installable, and aims to fill a long-standing gap in the Python scientific ecosystem for Bengali users.

SoftwareXVol. 34
Hajee Mohammad Danesh Science and Technology University (BD)
Life below water
Openalex Percentile: Top 12%
Data Visualization and Analytics
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.