benoitkugler / textlayout

Fonts and text layout for Golang
MIT License
47 stars 7 forks source link

When `langStr` is `utf-8`, NewOTTagsFromScriptAndLanguage fails #26

Closed rznewswav closed 1 year ago

rznewswav commented 1 year ago

I was loading a font, but I cannot share it here. However, upon debugging, I found out that languageToString will return utf-8, and the loop will fail because of the s+1 expression.

https://github.com/benoitkugler/textlayout/blob/9459f671349eb2b463ea5dcfc8739e793b07a323/harfbuzz/ot_tag.go#L309-L317

rznewswav commented 1 year ago

ok found solution to define environment variable LC_ALL to en_US.UTF-8 instead

benoitkugler commented 1 year ago

See also https://github.com/go-text/typesetting/issues/64