mbutterick/quad

Thai script not displayed correctly

Closed this issue · 6 comments

Consider:

#lang quadwriter/markup

#:font-family "Sarabun"

สวัสดีชาวโลก

where the Sarabun directory/zip can be downloaded from https://fonts.google.com/specimen/Sarabun.

The result of the pdf is

Screen Shot 2020-02-18 at 14 27 27

which shows "สวัสดีชาวโ" instead of "สวัสดีชาวโลก" (the last two characters are missing).

My hypothesis is that "ั" "ี" that appear in "วั" and "ดี" stack on top of the previous character, causing two characters to be missing.

I tested further by trying:

#lang quadwriter/markup

#:font-family "Sarabun"

ฉันสู้ตาย

In the above one, there's "ั", "ั", and "ู" (the last two attach to the top and bottom of "ส" in "สู้"). The result is that three characters are missing, which matches the prediction.

Just to provide a bit of context, in Thai script any consonant can have diacritics (vowels and tone markers) stacked above and below it. There is one position below any consonant, and two above (I think that's the limit, but haven't checked). This stackexchange post provides visual examples.

@sorawee 's hypothesis is that for every diacritic that is used, there is corresponding number of characters missing from the Quad output.

I tried to do some of my own tests but I'm not able to get any sensible output. My pdf (using the same source as above) looks like this:

image

@oldmankit thanks for your help to clarify the issue.

For your problem, according to the documentation, you need to create a directory named "fonts" and extract the font files into a subdirectory "Sarabun" to get the font working. I provided a link to download the font zip above.

Fixed in mbutterick/fontland@5dacd2d
Tested in mbutterick/pitfall@dbaf0c1

(Meaning, you will have to update fontland to get the fix)

Screen Shot 2020-02-19 at Feb 19  1 46 58 PM

@sorawee Thanks very much for your help: yes, that fixes it.