Indic languages in DirectGUI

conjunct consonants in hindi is not properly displayed.

# -*- coding: utf-8 -*-
from direct.showbase.ShowBase import ShowBase
from direct.gui.DirectGui import DirectLabel
from panda3d.core import *
import panda3d

panda3d.core.load_prc_file_data('', 'text-encoding utf8')
class HindiTextApp(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)

        # Load a Devanagari font (Make sure the font file is in your project directory)
        hindi_font = loader.loadFont("NotoSansDevanagari-Regular.ttf")  # Or any other Devanagari font

        # Create a DirectLabel with Hindi text
        self.label = DirectLabel(
            text="मैं किसी का हिंदी में अभिवादन कैसे करूं?",
            text_font=hindi_font,
            scale=0.13,
            text_fg=(0, 1, 0, 1),  # Green text
            frameColor=(0, 0, 0, 0),  # Transparent background
            pos=(0, 0, 0)
        )
        #print(cpMgr)
        #print(ConfigVariableString('text-encoding'))

app = HindiTextApp()
app.run()

NotoSansDevanagari-Regular.ttf (215.9 KB)

1 Like

This might be worth filing as a bug on Panda’s GitHub “issues” page:

1 Like

ok.

1 Like

Setting text-use-harfbuzz true in Config.prc solves the problem.

2 Likes