La fuente TypeWriter no tiene ningún efecto con el paquete Polyglossia

La fuente TypeWriter no tiene ningún efecto con el paquete Polyglossia

Al utilizar el motor XeLaTeX, MWE1 funciona bien con los paquetes fontspec y ucharclasses. Pero cuando cambio la especificación de fuente a poliglosia (MWE2), no hay ningún efecto de fuente TypeWriter. Además, la primera frase del texto en inglés no está escrita en fuente Times New Roman. ¿Hay alguna solución?

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}

Fuente Khmer OShttp://www.khmeros.info/en/fonts

Respuesta1

Obtengo resultados incorrectos en ambos casos. Al menos en el texto en inglés hay más familias de fuentes involucradas, por lo que necesitas un cambio de fuente un poco más sofisticado. Pruebe esto en su lugar:

\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}

Si tiene una fuente tt dedicada para khmer, puede agregar alguna prueba para la familia actual.

ingrese la descripción de la imagen aquí

información relacionada