How to handle Unicode strings in a XeLaTeX document?

the previous question led me to XeLaTex (it was about LaTeX and Unicode). So I have this document:

\documentclass[a4paper]{article}
\usepackage[cm-default]{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Arial}
\begin{document}
গ a ä ͷ 
\end{document}

      

With the "Arial" font, only a and ä are displayed, the other two characters are just a field. If I remove the \ setmainfont command, only the a character is displayed. If I change "Arial" to "Linux Libertine" I get an error:

Invalid font name 'Linux Libertine': contains'

This is annoying because the WikiPedia-Example on XeLaTeX has a font name containing spaces.

What do I need to do to make all the specified characters appear in my pdf document?

+2


source to share


5 answers


If the fonts are installed correctly, they should work as expected (at least they work for me). However, neither Arial nor Linux Libertine contains all four characters. Especially the first character is only supported by a small number of fonts (see this list ). The following example uses Code2000 and displays all characters correctly:



\documentclass[a4paper]{article}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont{Code2000}
\begin{document}
গ a ä ͷ 
\end{document}

      

+1


source


But I see; I had to try your example. The OpenType font name is not Linux Libertine

as well Linux Libertine O

. Alternatively, you can use the PostScript name:

\setmainfont{LinLibertineO}

      



However, this font does not have all of these four characters. You might have a hard time finding one that does.

+1


source


Apparently you need your font to support your Unicode characters. TeX Gyre Pagella as suggested here works for me for some Central European diacritics and Cyrillic.

0


source


Sorry guys to answer so late, but I actually did what I wanted:

http://www.julianmoritz.de/dl/poster.pdf

Hello!

0


source


you probably won't be able to download TeX Gyre Pagella from XeTeX or XeLaTeX. Go back to regular LaTeX and do this in your preamble:

\usepackage[T1]{fontenc}
\usepackage{tgpagella}

      

-1


source







All Articles