2

I'm using xelatex the create a PDF from a tex file.
Normally I use the command:

\setmainfont{DejaVu Sans}
\newfontfamily{\hebrewfont}{DejaVu Sans}

Which successfully loads the font.
Though when I try a different font it fails to load it. The code:

\setmainfont{Nachlieli CLM}
\newfontfamily{\hebrewfont}{Nachlieli CLM}

Yields:

   (... Omitted for brevity ...)
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/babel-

hebrewalph.def))kpathsea:make_tex: Invalid fontname `Nachlieli CLM', contains ' '

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

l.11 \setmainfont{Nachlieli CLM}

? 
kpathsea:make_tex: Invalid fontname `Nachlieli CLM', contains ' '

(... Omitted for brevity ...)

What is missing?
I'm using the font "Nachlieli CLM" with LibreOffice all the time. Using Ubuntu 14.

Edit #1:
Perhaps important - the "full" tex code is:

\usepackage{polyglossia}
\setmainlanguage{hebrew}

\setmainfont{Nachlieli CLM}
\newfontfamily{\hebrewfont}{Nachlieli CLM}
2
  • Please tell us a bit more about the font "Nachlieli CLM". E.g., is it a system font, or is it a font that you installed on your own?
    – Mico
    Apr 20, 2016 at 7:48
  • @Mico I think that it is a system font but not sure. How do I check that? (I don't remember installing font at all, except for probably the fonts that tex use, via the Ubuntu Software Center)
    – Dor
    Apr 20, 2016 at 7:49

1 Answer 1

0

You can just write the name of your ttf (instead of font family name)

\usepackage{fontspec}
\setmainfont[
    %Path = C:/Users/font/, %address of your fonts
    Extension = .ttf,
    BoldFont = *-Bold,
    ItalicFont = *-Oblique,
    BoldItalicFont = *-BoldOblique,
]{DejaVuSans}
%\newfontfamily{\myfont}[
    %ame as in main font
%]{myfont}

If it still cannot find font, it means that font is not located in system $PATH, so you must specify address, or just put those fonts in the same directory, where is your .tex file.

8
  • 1
    How do I find the name of the ttf of the "Nachlieli CLM" font?
    – Dor
    Apr 20, 2016 at 8:23
  • If the font is in your system, then it should have "nachlieli" in its name. Or you can search web for this font. normally they are in .rar or .zip
    – Giorgi
    Apr 20, 2016 at 8:31
  • I've already searched it in /usr/share and ~ but failed to find it. I thought that maybe it has a different name. Where else could it be stored? The libreoffice program uses it..
    – Dor
    Apr 20, 2016 at 8:33
  • Unlike windows linux stores system fonts in various places. I think you should search it in $PATH address. If I remember correctly command: echo $PATH shows system paths.
    – Giorgi
    Apr 20, 2016 at 8:41
  • I executed sudo find / -iname 'nachlieli' but it didn't find anything.
    – Dor
    Apr 20, 2016 at 8:48

Not the answer you're looking for? Browse other questions tagged .