Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I can not get fontconfig, which XeLaTeX relies on, to recognize fonts that are in the Fonts folder as shortcuts (to fonts in other folders). fc-cache and fc-list ignore the shortcuts, which do not appear using the dir command.

Am I doing something wrong?

share|improve this question
3  
You may modify fonts.conf directly. –  Leo Liu Feb 23 '12 at 4:53
    
@LeoLiu Please write a short answer. –  lockstep May 5 '12 at 22:44
    
@lockstep: done. –  Leo Liu May 6 '12 at 4:32
add comment

1 Answer

up vote 3 down vote accepted

You can modify the configuration file fonts.conf of fontconfig library.

TeX Live

For TeX Live 2011, if you install it in e.g. C:\texlive, open C:\texlive\2011\texmf-var\fonts\conf\fonts.conf, there should be these lines:

<!--
    Find fonts in these directories

        You can add other directories if you have additional fonts.
        Example:
<dir>C:/Windows/fonts</dir>
<dir>c:/usr/local/share/texmf/fonts/opentype/dnscreen/hiragino</dir>
<dir>c:/usr/local/share/texmf/fonts/opentype/adobe/kozuka</dir>

-->

<dir>C:/Windows/fonts</dir>
<dir>C:/texlive/2011/texmf-dist/fonts/opentype</dir>
<dir>C:/texlive/2011/texmf-dist/fonts/truetype</dir>

You can add some lines as you wish.

MiKTeX

If you are using MiKTeX (installed in C:\miktex for example), you can see C:\miktex\fontconfig\config\fonts.conf and follow guide lines in the comments of the file. In fact, you should then open localfonts.conf to see the predefined directories, and then create a localfonts2.conf to add your own paths.

In fonts.conf:

<!--
    DO NOT EDIT THIS FILE.
    IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
    LOCAL CHANGES BELONG IN 'local.conf'.

    The intent of this standard configuration file is to be adequate for
    most environments.  If you have a reasonably normal environment and
    have found problems with this configuration, they are probably
    things that others will also want fixed.  Please submit any
    problems to the fontconfig bugzilla system located at fontconfig.org

    Note that the normal 'make install' procedure for fontconfig is to
    replace any existing fonts.conf file with the new version.  Place
    any local customizations in local.conf which this file references.

    Keith Packard
-->

<!-- Font directory list -->

    <include>C:\miktex/fontconfig/config/localfonts.conf</include>

And this is localfonts.conf:

<?xml version="1.0" encoding="UTF-8"?>

<!--
  DO NOT EDIT THIS FILE! It will be replaced when MiKTeX is updated.
  Instead, edit the configuration file localfonts2.conf.
-->

<fontconfig>
<include>localfonts2.conf</include>
<dir>C:\Windows\Fonts</dir>
<dir>C:\miktex\fonts\type1</dir>
<dir>C:\miktex\fonts\opentype</dir>
</fontconfig>
share|improve this answer
    
This is not the answer I was hoping for but that is a failing of XeLaTeX. –  Emre May 6 '12 at 6:46
    
@Emre: The problem is that shortcuts are different with symbolic links. You can also use mklink command for the fonts, like Linux users do. Anyway, this is how fontconfig library work, XeTeX could do nothing about it. –  Leo Liu May 6 '12 at 8:37
    
I do not understand. Windows applications don't complain about linked fonts. –  Emre May 7 '12 at 7:09
2  
@LeoLiu The placement of the fontconfig files that you described didn't apply to my MiKTeX 2.9 (Win 7-64) Admin installation, I had to change the localfonts2.conf file in C:\Users\doncherry\AppData\Roaming\MiKTeX\2.9\fontconfig\config, see tex.stackexchange.com/questions/84223/…. (I don't know if this'll apply to other users' systems as well, so I leave adapting the answer up to you.) –  doncherry Nov 26 '12 at 6:09
1  
BTW as it seems, there is now a dummy localfonts2.conf created. I have such a file with no meaningful entries. –  Speravir Nov 27 '12 at 0:21
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.