devanagari

Devanagari text rendering improperly in PyGame

余生颓废 提交于 2019-12-05 01:17:31
We have a small web app that we want to convert into something native. Right now, it's got a lot of moving parts (the backend, the browser etc.) and we'd like to convert it into a single tight application. We decided to use PyGame to do this and it's been fine so far except for a font rendering issue. The string I'd like to render is कोझिकोड. This, correctly rendered looks like . The specific code points are \u0915 \u094b \u091d \u093f \u0915 \u094b and \u0921 Now, this looks fine in my editor and my browser but when I try to render it in PyGame, I get this . Basically, the vowel sign (\u093f

Combining Devanagari characters

狂风中的少年 提交于 2019-11-28 06:21:13
I have something like a = "बिक्रम मेरो नाम हो" I want to achieve something like a[0] = बि a[1] = क्र a[3] = म but as म takes 4 bytes while बि takes 8 bytes I am not able to get to that straight. So what could be done to achieve that? In Python. The algorithm for splitting text into grapheme clusters is given in Unicode Annex 29 , section 3.1. I'm not going to implement the full algorithm for you here, but I'll show you roughly how to handle the case of Devanagari, and then you can read the Annex for yourself and see what else you need to implement. The unicodedata module contains the

Combining Devanagari characters

≯℡__Kan透↙ 提交于 2019-11-27 05:39:37
问题 I have something like a = "बिक्रम मेरो नाम हो" I want to achieve something like a[0] = बि a[1] = क्र a[3] = म but as म takes 4 bytes while बि takes 8 bytes I am not able to get to that straight. So what could be done to achieve that? In Python. 回答1: The algorithm for splitting text into grapheme clusters is given in Unicode Annex 29, section 3.1. I'm not going to implement the full algorithm for you here, but I'll show you roughly how to handle the case of Devanagari, and then you can read