高棉文字无法在括号内呈现

高棉文字无法在括号内呈现

我正在创建一个文档,其中主要文字是罗马文字,但我使用 内联切换到高棉语(柬埔寨语)\ucharclasses。(使用 排版XeLaTeX)。除非我将高棉语文本放在括号、方括号或引号中,否则这种方法效果很好。以下是 MWE:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily\khmerfamily[Scale=0.8,Script=Khmer]{Khmer Mondulkiri}
\usepackage[Khmer]{ucharclasses}
\setTransitionTo{Khmer}{\khmerfamily}
\setTransitionFrom{Khmer}{\rmfamily}
\begin{document}
Here is a bit of text, ហើយ​អាហ្នឹង​ជាឃ្លាសសេ​ជា​អក្សរ​ខ្មែរ​ដែ។ But if I put a Khmer word in parentheses (អញ្ចឹង) or square brackets [អញ្ចឹង], or quotation marks `អញ្ចឹង'  ``អញ្ចឹង'', it doesn't typeset properly. In the middle of a sentence កណ្ដាល it's fine.
\end{document}  

输出如下:

输出显示渲染高棉文时出现的问题

任何意见都将不胜感激。(我承认我并不真正理解ucharclasses它的工作原理——对我来说它完全是一个黑匣子。)

答案1

您需要使用以下Latin选项加载/激活更多设置:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily\khmerfamily[Scale=0.8,Script=Khmer]{Khmer Mondulkiri}
\usepackage[Latin,Khmer]{ucharclasses}

\setTransitionTo{Khmer}{\khmerfamily}
\setTransitionFrom{Khmer}{\rmfamily}
\begin{document}
Here is a bit of text, ហើយ​អាហ្នឹង​ជាឃ្លាសសេ​ជា​អក្សរ​ខ្មែរ​ដែ។ But if I put a Khmer word in parentheses (អញ្ចឹង) or square brackets [អញ្ចឹង], or quotation marks `អញ្ចឹង'  ``អញ្ចឹង'', it doesn't typeset properly. In the middle of a sentence កណ្ដាល it's fine.
\end{document} 

在此处输入图片描述

相关内容