/text-shaping

Test environment for rendering Asian fonts

Primary LanguagePythonMIT LicenseMIT

text-shaping

Test environment for rendering Asian fonts. Select the correct scriptag of 173 scripts and then the correct language tag for one of the 634 possible languages used.

pdf.set_text_shaping(use_shaping_engine=True, script="khmr", language="khm")

Khmer

With Noto fonts the returned width does not match with the actual font width after being processed by a font shaper like harfbuzz. A result with NotoSansKhmer-regular looks like this:

Noto sans

The expected result is shown here with a Google font in Khmer regular:

Google font

Sinhala

Getting there ...