Fonts with XeLaTeX : tips and troubleshooting

  • First, one thing about fonts with XeLaTeX. How do I know what fonts I could use for the language I want to typeset ? Open a terminal (with ubuntu, enter alt+f2, and enter gnome-terminal in the prompt), and copy the following :

    fc-list :lang=en

    It will give you all fonts with their style that you can use for each language you specify. If you want to specify another language, then replace the “en” after “lang=” with any other language. For example, if i want to know what are the japanese fonts I can use, I replace “en” with “ja”, it returns :

    $ fc-list :lang=ja
    YOzFontNF:style=Bold
    YOzFont:style=Regular
    YOzFontEF:style=Bold
    YOzFontCF:style=Bold
    YOzFontAF:style=Bold
    IPA X0208 P明朝,IPAX0208PMincho:style=Regular
    YOzFontN90:style=Regular
    YOzFontNF:style=Italic
    YOzFontEF90:style=Regular
    YOzFontEF:style=Italic
    YOzFontAF:style=Italic
    YOzFontCF:style=Italic
    YOzFont:style=Bold
    YOzFontE:style=Regular
    YOzFontF:style=Regular
    YOzFontA:style=Regular
    YOzFontC:style=Regular
    YOzFontN:style=Regular
    YOzFontEF90:style=Bold
    文泉驛等寬正黑,WenQuanYi Zen Hei Mono,文泉驿等宽正黑:style=中等,Medium
    文泉驛等寬微米黑,WenQuanYi Micro Hei Mono,文泉驿等宽微米黑:style=Regular
    YOzFontEF90:style=Bold Italic
    YOzFontA90:style=Italic
    IPA X0208 Pゴシック,IPAX0208PGothic:style=Regular
    YOzFont90:style=Italic
    YOzFont:style=Italic
    YOzFontC90:style=Italic
    YOzFont:style=Bold Italic
    YOzFontE90:style=Italic
    YOzFont90:style=Bold Italic
    YOzFontNF90:style=Bold
    YOzFontF90:style=Italic
    YOzFontCF90:style=Regular
    YOzFontF:style=Bold Italic
    YOzFontE:style=Bold Italic
    YOzFontNF90:style=Italic
    YOzFontC:style=Bold Italic
    YOzFontA:style=Bold Italic
    YOzFontN:style=Bold Italic
    さざなみ明朝,Sazanami Mincho:style=Regular,Mincho-Regular
    YOzFontEF:style=Bold Italic
    YOzFontAF:style=Bold Italic
    YOzFontCF:style=Bold Italic
    YOzFontNF:style=Bold Italic
    Takao P明朝,TakaoPMincho:style=Regular
    文泉驛正黑,WenQuanYi Zen Hei,文泉驿正黑:style=中等,Medium
    YOzFontN90:style=Italic
    IPAexゴシック,IPAexGothic:style=Regular
    YOzFontEF90:style=Italic
    YOzFontCF90:style=Bold Italic
    東風ゴシック,Kochi Gothic:style=標準,Regular
    YOzFontNF:style=Regular
    YOzFontAF:style=Regular
    YOzFontCF:style=Regular
    YOzFontEF:style=Regular
    東風明朝,Kochi Mincho:style=標準,Regular
    IPA X0208 UIゴシック,IPAX0208UIGothic:style=Regular
    YOzFontAF90:style=Regular
    Takaoゴシック,TakaoGothic:style=Regular
    YOzFont90:style=Regular
    IPA X0208 明朝,IPAX0208Mincho:style=Regular
    YOzFontAF90:style=Bold
    YOzFontN90:style=Bold
    IPAゴシック,IPAGothic:style=Regular
    YOzFontCF90:style=Italic
    YOzFontN90:style=Bold Italic
    YOzFontAF90:style=Bold Italic
    文泉驛微米黑,WenQuanYi Micro Hei,文泉驿微米黑:style=Regular
    YOzFontA90:style=Bold Italic
    IPA Pゴシック,IPAPGothic:style=Regular
    YOzFontC90:style=Bold
    YOzFontC90:style=Bold Italic
    YOzFontA90:style=Bold
    IPA X0208 ゴシック,IPAX0208Gothic:style=Regular
    YOzFontE90:style=Bold Italic
    YOzFontF90:style=Bold
    YOzFontNF90:style=Bold Italic
    YOzFontF90:style=Bold Italic
    Takao Pゴシック,TakaoPGothic:style=Regular
    YOzFontE90:style=Bold
    TakaoExゴシック,TakaoExGothic:style=Regular
    YOzFont90:style=Bold
    YOzFontC90:style=Regular
    YOzFontCF90:style=Bold
    YOzFontA90:style=Regular
    YOzFontF:style=Italic
    YOzFontN:style=Bold
    YOzFontE:style=Italic
    YOzFontC:style=Italic
    YOzFontA:style=Italic
    YOzFontN:style=Italic
    YOzFontF:style=Bold
    YOzFontE:style=Bold
    YOzFontC:style=Bold
    YOzFontA:style=Bold
    IPAex明朝,IPAexMincho:style=Regular
    IPA明朝,IPAMincho:style=Regular
    TakaoEx明朝,TakaoExMincho:style=Regular
    Takao明朝,TakaoMincho:style=Regular
    YOzFontF90:style=Regular
    YOzFontAF90:style=Italic
    YOzFontNF90:style=Regular
    IPA P明朝,IPAPMincho:style=Regular
    YOzFontE90:style=Regular

    If you don’t know how you could know what is the abbreviation for your language, then copy the following line in your terminal :

    ls /usr/share/locale

    It will return all locales :

    The locales show you the abbreviation for each language, which you can use with the “fc-list :lang=*” command. For example, if I want to know the fonts for arabic :

    fc-list :lang=ar
    Times New Roman:style=Normal,obyčejné,Standard,Κανονικά,Regular,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,thường,Arrunta
    Nazli:style=Bold
    Scheherazade:style=Regular
    PakType Naqsh:style=Regular
    FreeSerifb:style=Regular
    Times New Roman:style=Negreta,tučné,fed,Fett,Έντονα,Bold,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiona,Negrito,Полужирный,Fet,Kalın,Krepko,đậm,Lodia
    FreeSerif:style=Mittel,µεσαία,Medium,Normal,Gemiddeld,navadno
    Courier New:style=Normal,obyčejné,Standard,Κανονικά,Regular,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,thường,Arrunta
    PakType Tehreer:style=Regular
    KacstOne:style=Medium
    MPH 2B ダマセ,MPH 2B Damase,MPH 2B 大媽賊,MPH 2B 다마세,MPH 2B 大妈贼:style=Regular
    Arial:style=Normal,obyčejné,Standard,Κανονικά,Regular,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,thường,Arrunta
    DejaVu Sans,DejaVu Sans Condensed:style=Condensed,Book
    Homa:style=Regular
    DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
    Courier New:style=Negreta,tučné,fed,Fett,Έντονα,Bold,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kalın,Krepko,đậm,Lodia
    RupeeTechFat:style=Regular
    DejaVu Sans:style=Bold
    DejaVu Sans:style=Book
    Arial:style=Negreta,tučné,fed,Fett,Έντονα,Bold,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kalın,Krepko,đậm,Lodia
    Titr:style=Bold
    Nazli:style=Regular
    DejaVu Sans Mono:style=Book
    DejaVu Sans Mono:style=Bold

  • Secondly, if you use XeLaTeX for the first time with, let say, Ubuntu 10.04, you are likely to get a problem with your fonts. Indeed, with Ubuntu 10.04 I got error messages when I wanted to use TeX Gyre Pagella. Here is a post to show you how to solve this problem if you get it. Notice that if you have installed TeXlive with your package manager, maybe you won’t get this problem, I don’t know.

    Unfortunately, I am not aware of how XeLaTeX behaves with Microsoft Windows XP, Vista or Seven. For this reason, if you use those operating system, I can try to help you if you post a comment, but I can’t ensure you I can sucessfully help you. If you use a Unix system, then the following method might work, and has been tested with Ubuntu 10.04.

    First, you need to copy texlive-fontconfig.conf in an other part of your system. For this, you need administrator privileges. To do so, you have two ways.

    1. The first way, faster, depends on how you have installed your TeX distribution. If you have installed TeXlive with your package manager (Synaptic or Ubuntu software center in Ubuntu), then copy the following line in a terminal (to run this application, alt+f2 and enter gnome-terminal in the prompt) :
    2. sudo cp /usr/share/texmf-texlive/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf

      Since I don’t have installed TeXlive with my package manager, this line may not be correct. If so, don’t hesitate to leave a comment, I can modify it and tell you how to find the right line by yourself. Otherwise, if you are not familiar with the command line, then use your file manager. For this, type Alt+F2, and in the prompt enter gksu nautilus. Here is a screenshot :

      Then, look at the device section in the panel on your left, and go in the file system section :


      Then, search for the right directory in usr, share, something like texmf-texlive (since I can’t try I am not sure), fonts, conf, and copy texlive-fontconfig.conf. Then return select once again the file system directory, go in etc, fonts, conf.d, past the file in this directory and rename it as 09-texlive.conf. Then run the following line in a terminal :

      sudo fc-cache -fsv

    3. If you have installed TeXlive with the install script install-tl, then copy the following line in your terminal :

      sudo cp /usr/local/texlive/2010/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf

      And this one :

      sudo fc-cache -fsv

    For more details, see the texlive guide, section 3.4.5, p. 14. To do so, type alt+F2, enter texdoc texlive-en in the prompt. Or look here.

Advertisement
  1. September 26th, 2010

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: