subha-v / StorybookImages

Translates storybooks from English to low-resource languages
1 stars 1 forks source link

Fixing Cryllic/Complicated Language Text Rendering #2

Open subha-v opened 2 years ago

subha-v commented 2 years ago

For cryllic text/more complicated languages, the text is actually broken! Apparently Pillows (the python package for images), has support for this using the module "raqm" but I haven't really been able to get it working in my project... (hindi_font = ImageFont.truetype('./src/fonts/BalooTammudu2-VariableFont_wght.ttf', 60, layout_engine=ImageFont.LAYOUT_RAQM)) is what I'm using so far, but when doing features.check("raqm") it's saying "False" which means for some reason I don't have the feature even though it's installed in my libraries when I checked.

image

subji6 commented 2 years ago

A few questions?

  1. "the text is actually broken". can you provide details on what is broken?
  2. "Apparently Pillows (the python package for images), has support for this using the module "raqm" but I haven't really been able to get it working in my project... " Also, details on the failure/error messages will be valuable.
subha-v commented 2 years ago
  1. The issue is that the subscripts and superscripts are not displaying correctly. Sometimes they are not rendering at all.
  2. Mostly it's saying the module wagon is not installed and when I try running it using raqm it doesn't provide different results
subha-v commented 2 years ago

Actually, the issue is resolved now! I was able to solve this by correctly installing the package.

subji6 commented 2 years ago

Awesome. I feel relieved since I could not spend time on it though it was on my mind . I am really glad that you are able to figure this on your own.