
XeLaTeX 엔진을 사용하는 MWE1은 Fontspec 및 ucharclasses 패키지와 잘 작동합니다. 하지만 글꼴 사양을 폴리글로시아(MWE2)로 변경하면 TypeWriter 글꼴 효과가 없습니다. 또한, 영문 텍스트의 첫 문장이 Times New Roman체로 되어 있지 않습니다. 어떤 수정 사항이 있나요?
MWE1
\documentclass[11pt,a4paper]{article}
\usepackage{fontspec}
\newfontfamily\khmerfont[Script=Khmer,Scale=0.9]{Khmer OS}
\newfontfamily\khmerfonttt[Script=Khmer,Scale=0.9]{Khmer OS}
\newfontfamily\englishfont{Computer Modern Roman}
\usepackage{ucharclasses}
\setTransitionTo{Khmer}{\khmerfont}
\setTransitionFrom{Khmer}{\englishfont}
\usepackage{fancyvrb}
\begin{document}
\noindent What is wrong? តើមានអ្វីប្លែក? What is wrong? តើមានអ្វីប្លែក?
\begin{Verbatim}
What is wrong? តើមានអ្វីប្លែក? What is wrong? តើមានអ្វីប្លែក?
\end{Verbatim}
\end{document}
MWE2
\documentclass[11pt,a4paper]{article}
\usepackage{polyglossia}
\newfontfamily\khmerfont[Script=Khmer,Scale=0.9]{Khmer OS}
\newfontfamily\khmerfonttt[Script=Khmer,Scale=0.9]{Khmer OS}
\newfontfamily\englishfont{Computer Modern Roman}
\setdefaultlanguage[numerals=khmer]{khmer}
\setotherlanguage{english}
\usepackage{ucharclasses}
\setTransitionTo{Khmer}{\khmerfont}
\setTransitionFrom{Khmer}{\englishfont}
\usepackage{fancyvrb}
\begin{document}
\noindent What is wrong? តើមានអ្វីប្លែក? What is wrong? តើមានអ្វីប្លែក?
\begin{Verbatim}
What is wrong? តើមានអ្វីប្លែក? What is wrong? តើមានអ្វីប្លែក?
\end{Verbatim}
\end{document}
크메르 OS 글꼴http://www.khmeros.info/en/fonts
답변1
두 경우 모두 잘못된 결과가 나타납니다. 적어도 영어 텍스트에서는 더 많은 글꼴 계열이 관련되어 있으므로 좀 더 정교한 글꼴 변경이 필요합니다. 대신 이것을 시도해 보세요:
\documentclass[11pt,a4paper]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\newfontfamily\khmerfont[Script=Khmer,Scale=0.9]{Khmer OS}
\setdefaultlanguage[numerals=khmer]{khmer}
\setotherlanguage{english}
\usepackage{ucharclasses}
\makeatletter
\setTransitionTo{Khmer}{%
\global\let\orif@family\f@family
\khmerfont}
\setTransitionFrom{Khmer}{%
\fontfamily{\orif@family}\selectfont}
\makeatother
\usepackage{fancyvrb}
\begin{document}
\noindent What is wrong? តើមានអ្វីប្លែក ? What is wrong? តើមានអ្វីប្លែក?
\begin{Verbatim}
What is wrong? តើមានអ្វីប្លែក? What is wrong? តើមានអ្វីប្លែក?
\end{Verbatim}
\end{document}
크메르어 전용 tt-글꼴이 있는 경우 현재 계열에 대한 몇 가지 테스트를 추가할 수 있습니다.