Hi there,

I was told by David Carlisle on https://tex.stackexchange.com that the xetex mailing list may be a good place to ask my question:

When generating documents in Khmer, we noticed that some ligatures do not work. We found that turning off XeTeXlinebreaklocale fixes all ligatures, however this causes problems with linebreaks, and lines extend past the right margin if there aren't any zero width spaces between words. (In Khmer words within the same sentence or phrase are generally run together with no spaces between them.)

Our objective is to have all ligatures work, and to use XeTeXlinebreaklocale at the same time.

Please note that we are not looking for a manual workaround for this particular example. We are looking for a fix to the root cause that we can then use in our automated system where we cannot fix individual instances of this problem.

My question at https://tex.stackexchange.com/questions/425652/khmer-ligatures-break-if-xetexlinebreaklocale-is-turned-on includes screenshots of the generated output for both MWEs:


MWE 1: XeTeXlinebreaklocale turned off, ligatures work (text in red), however text runs into right margin.

\documentclass[12pt]{article}

%\XeTeXlinebreaklocale "km"
\usepackage{color}
\usepackage{fontspec}
\setmainfont[Ligatures=Required]{Khmer OS Content}

\begin{document}
មានមនុស្សម្នាក់ដែលបានធ្វើការមួយដែលអាចដឹងបាន នោះគឺជាកា{\color{red}ស្រ្តូ}នៅទីនេះ។ បាទ អ្នកទាំងអស់គ្នា។ គាត់បានចុះទៅទីនោះ។ ហើយពួកនាយទុនមានអស់ទាំងព្រនង់ ហើយនឹងអ្វីៗដែល… វាគឺឋិតនៅក្នុងស្តង់ដាមាស ដូចជាសហរដ្ឋអាមេរិកដែរ។ តើគាត់បានធ្វើអ្វី? គាត់បានទិញអស់ទាំងបណ្ណ័ភាគហ៊ុន។ គឺរកលុយតាមគ្រប់ទាំងវិធីដែលគាត់អាចធ្វើទៅបាន។ បន្ទាប់មកតើគាត់ធ្វើអ្វីទៀត? គាត់ក៏បានក្លែងបន្លំក្រដាស់ប្រាក់ ហើយបានប្ដូរវា។ ហើយក៏ដាក់ទៅវិញ។ នេះហើយគឺជាអ្វីតែមួយដែលជាតិសាសន៍នេះអាចធ្វើបាន។
\end{document}


MWE 2: XeTeXlinebreaklocale set to "km", line breaks work, however some ligatures are broken (text in red).

\documentclass[12pt]{article}

\XeTeXlinebreaklocale "km"
\usepackage{color}
\usepackage{fontspec}
\setmainfont[Ligatures=Required]{Khmer OS Content}

\begin{document}
មានមនុស្សម្នាក់ដែលបានធ្វើការមួយដែលអាចដឹងបាន នោះគឺជាកា{\color{red}ស្រ្តូ}នៅទីនេះ។ បាទ អ្នកទាំងអស់គ្នា។ គាត់បានចុះទៅទីនោះ។ ហើយពួកនាយទុនមានអស់ទាំងព្រនង់ ហើយនឹងអ្វីៗដែល… វាគឺឋិតនៅក្នុងស្តង់ដាមាស ដូចជាសហរដ្ឋអាមេរិកដែរ។ តើគាត់បានធ្វើអ្វី? គាត់បានទិញអស់ទាំងបណ្ណ័ភាគហ៊ុន។ គឺរកលុយតាមគ្រប់ទាំងវិធីដែលគាត់អាចធ្វើទៅបាន។ បន្ទាប់មកតើគាត់ធ្វើអ្វីទៀត? គាត់ក៏បានក្លែងបន្លំក្រដាស់ប្រាក់ ហើយបានប្ដូរវា។ ហើយក៏ដាក់ទៅវិញ។ នេះហើយគឺជាអ្វីតែមួយដែលជាតិសាសន៍នេះអាចធ្វើបាន។
\end{document}


Setup:

* TexShop 3.62 on Mac
* Typesetting it as XeLatex with XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) * Font Khmer OS Content: https://drive.google.com/file/d/1YuoheWcKu9jS0cyZ-LU9g2ohicCMd5yX/view?usp=sharing


My question is whether there is a way to change our setup so that both XeTeXlinebreaklocale and ligatures work?

Thank you for your help

Jo Hund



--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
 http://tug.org/mailman/listinfo/xetex

Reply via email to