Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How to convert encoded Preeti font text to unicode leaving English words as it is in Python?

$
0
0

I am trying to convert Preeti font text to unicode. I am using Python and npTTF2UTF library. It works most of the time but it also converts English words like 'Microwave' into unicode equivalent. How can I avoid that?

Here is my code:

import npttf2utfmapper = npttf2utf.FontMapper("npttf2utf-main/src/npttf2utf/map.json")text = ''' cGo g]6js{;Fu cfj4 x"g] :yfg, tl/sf / lsl;d like (Microwave/Satellite/Cable etc.)  '''converted_text = mapper.map_to_unicode(word, from_font="Preeti", unescape_html_input=False, escape_html_output=False)  print(converted_text)

I get:अन्यनेटवर्कसँगआवद्धहूनेस्थान, तरिकारकिसिमष्पिभ९ःष्अचयधबखभरक्बतभििष्तभरऋबदभिभतअ।०

I don't want the text after 'lsl;d'(किसिम) converted into unicode. How can I do so?


Viewing all articles
Browse latest Browse all 23131

Trending Articles