[XeTeX] changing font location

Tschijnmo Tschau tschijnmotschau at gmail.com
Mon Sep 5 01:11:48 CEST 2011


Dear All

I am new to XeTeX and really feel exciting about it. But when I try to
use the fontspec package to free one of my LaTeX class for routine
course assignments of the classical but a little uniform-looking
computer modern fonts, some problems is encountered.

On my laptop the class files works really well. All the font are
selected by font name and all my fonts are installed in
/usr/share/fonts. But when I wanted to port the class file to a server
of our research group where I usually put my works in, error message
was given saying the font xxx cannot be found. On the server I do not
have the root privilege and all the fonts are installed in
~/share/font. I have changed the configuration file for fontconfig so
all the fonts can be seen by fc-list.

In the fontspec manual it is indicated that the "selection by font
name" only works when fonts "exists in a standard fonts location",
where I do not have write permission. But I worry swapping to the
selection by file name scheme and giving the path explicitly might
make the class file less portable. So I wonder if there can be a
method to add some additional paths into the list of "standard fonts
location" so that the original class file can be ported with little
change. Is there really a way to do that? Thank you so much for your
help!

Regards

Tschijnmo TSCHAU

P. S.
Operating system of the sever: RHEL 5.7, TeX distribution TeXlive
2011, which is installed in ~/opt/texlive/2011, additional fonts in
~/share/fonts, Error message:

kpathsea: Invalid fontname `Gentium Book Basic', contains ' '

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "Gentium Book Basic" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.85 ...amily\mainFont{\@mainFontName}


code:
\newcommand{\@mainFontName}{Gentium Book Basic}
\newfontfamily\mainFont{\@mainFontName}



More information about the XeTeX mailing list