I am trying to use XeLaTeX to use Devanagari (and Tibetan) script directly in my code. It seems that for some reason, XeLaTeX is not able to recognize the Devanagari characters I put into the .tex file. The problem seems to be something to do with the set up on my system, as others are able to compile the same or similar .tex files with good results. When I compile, however, I just get question marks instead of Devanagari characters. Here is a simple MWE that gives me a row of question marks. "Nakula" is a Devanagari font installed on my system (Mac OS Yosemite):
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\setmainfont{Nakula}
शारदा शारदाम्भोजवदना वदनाम्बुजे।
सर्वदा सर्वदास्माकं संनिधिं संनिधिं क्रियात्।।
\end{document}
Here is an excerpt from the transcript of the compilation, which seems to suggest somehow the font is not being accessed properly. I am certain that normally Nakula does work in this way with XeLaTeX, as I have seen examples others have made using it:
.................................................
. fontspec info: "no-scripts"
.
. Font Nakula does not contain any OpenType `Script' information.
.................................................
\g__fontspec_family_Nakula_int=\count121
.................................................
. fontspec info: "no-font-shape"
.
. Could not resolve font Nakula/BI (it probably doesn't exist).
.................................................
.................................................
. fontspec info: "no-font-shape"
.
. Could not resolve font Nakula/B (it probably doesn't exist).
.................................................
.................................................
. fontspec info: "no-font-shape"
.
. Could not resolve font Nakula/I (it probably doesn't exist).
.................................................
.................................................
. fontspec info: "defining-font"
.
. Font family 'Nakula(0)' created for font 'Nakula' with options
. [Ligatures=TeX].
.
. This font family consists of the following shapes:
.
. * 'normal' with NFSS spec.:
. <->"Nakula/OT:mapping=tex-text;"
.
. * 'small caps' with NFSS spec.:
.
. and font adjustment code:
.
.................................................
[1
]
\XeTeXtracingfonts=1to your document and then check the log for the exact font file used. – Ulrike Fischer Mar 13 '15 at 16:13% !TEX encoding = UTF-8 Unicodeto the file (use the Encoding item in the Macros menu). You can also set the default encoding in the TeXShop preferences. (Restart TeXShop for it to take effect.) – Alan Munn Jun 29 '16 at 23:08