fontspec icon indicating copy to clipboard operation
fontspec copied to clipboard

`Extension = .xyz` needed unnecessarily

Open wspr opened this issue 7 years ago • 1 comments
trafficstars

Description

It looks like I incorrectly strip off extensions when I shouldn't be when Extension = .xyz is NOT included.

Check/indicate

  • [x] Relevant for XeTeX
  • [x] Relevant for LuaTeX
  • [ ] Issue tracker has been searched for similar issues?
  • [x] Links to <tex.stackexchange.com> discussion if appropriate: https://tex.stackexchange.com/a/446756/179

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures[DejaVu]
  {
    UprightFont = DejaVuSerif.ttf,
    ItalicFont = DejaVuSerif-Italic.ttf,
    BoldFont = DejaVuSerif-Bold.ttf,
    BoldItalicFont = DejaVuSerif-BoldItalic.ttf
  }
\setmainfont{DejaVu}
\begin{document}
This is a test.
\end{document}

Workaround

\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures[DejaVu]
  {
    Extension = .ttf,
    UprightFont = DejaVuSerif,
    ItalicFont = DejaVuSerif-Italic,
    BoldFont = DejaVuSerif-Bold,
    BoldItalicFont = DejaVuSerif-BoldItalic
  }
\setmainfont{DejaVu}
\begin{document}
This is a test.
\end{document}

wspr avatar Aug 20 '18 02:08 wspr

XeLaTeX cannot compile the workaround if dejavu package is not installed, while DejaVu Serif is installed in system directory.

$ fc-list | grep DejaVuSerif
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-BoldItalic.ttf: DejaVu Serif,DejaVu Serif Condensed:style=Condensed Bold Italic,Bold Italic
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed.ttf: DejaVu Serif,DejaVu Serif Condensed:style=Condensed,Book
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-Italic.ttf: DejaVu Serif,DejaVu Serif Condensed:style=Condensed Italic,Italic
/usr/share/fonts/truetype/dejavu/DejaVuSerif-BoldItalic.ttf: DejaVu Serif:style=Bold Italic
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-Bold.ttf: DejaVu Serif,DejaVu Serif Condensed:style=Condensed Bold,Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Italic.ttf: DejaVu Serif:style=Italic
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book
$ xelatex workaround.tex
! omitted
(/usr/local/texlive/2018/texmf-dist/tex/latex/fontspec/fontspec.cfg)))kpathsea:make_tex: Invalid filename `[DejaVuSerif.ttf]/OT', contains '['


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "DejaVuSerif" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  
                                                  
l.12 \begin
           {document}
?

XeLaTeX can compile if the line Extension = .ttf, is removed; LuaLaTeX can compile regardless of the line.

If dejavu is installed, both of XeLaTeX and LuaLaTeX can compile regardless of the Extension. But if not specified, LuaLaTeX seems to use font distributed by TeX Live instead of system-installed one.

My environment:

  • XeLaTeX: 3.14159265-2.6-0.99999 (TeX Live 2018)
  • LuaLaTeX: 1.07.0 (TeX Live 2018)
  • fontspec: 2018/07/30 vv2.6h

e-kwsm avatar Aug 22 '18 01:08 e-kwsm

This has now been fixed (I hope)

wspr avatar Apr 27 '24 07:04 wspr