Bug 187403 - print/texlive-base: TeXLive does not register opentype fonts for use by fontspec
Summary: print/texlive-base: TeXLive does not register opentype fonts for use by fontspec
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-09 20:40 UTC by Roger Leigh
Modified: 2018-01-22 13:39 UTC (History)
3 users (show)

See Also:


Attachments
Example configuration to register OpenType fonts. (178 bytes, application/xml)
2015-08-17 16:28 UTC, Roger Leigh
no flags Details
Patch to fix install issue (1.52 KB, patch)
2018-01-18 07:09 UTC, berend
no flags Details | Diff
Updated patch to add fontconfig support (2.36 KB, patch)
2018-01-22 13:36 UTC, Roger Leigh
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Leigh 2014-03-09 20:40:01 UTC
On a Linux system running TeXLive 2013:

$ ls -l /etc/fonts/conf.d/09-texlive.conf
lrwxrwxrwx 1 root root 62 Aug  8  2013 /etc/fonts/conf.d/09-texlive.conf -> /opt/texlive/2013/texmf-var/fonts/conf/texlive-fontconfig.conf

Having the fonts registered with fontconfig is necessary for XeTeX/XeLaTeX to be able to find and use OpenType/TrueType fonts such as TeX Gyre, which are provided by TeXLive.

Example test case:
--------------------[test.tex]-----------------------------------
\documentclass{beamer}

\usepackage{fontspec}
\setsansfont{TeX Gyre Heros}

\begin{document}

\begin{frame}[plain]
  \titlepage
\end{frame}

\end{document}
-----------------------------------------------------------------

With print/texlive-full installed:

--------------------[run]----------------------------------------
% xelatex test.tex
This is XeTeX, Version 3.1415926-2.5-0.9999 (Web2C 2013/dev)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,
 polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian,
welsh, loaded.
(/usr/local/share/texmf-dist/tex/latex/beamer/beamer.cls
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasercs.sty)
Document Class: beamer 2011/09/12 development version 3.20 A class for typesett
ing presentations (rcs-revision 70f9d8411e54)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasemodes.sty
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasedecode.sty))
(/usr/local/share/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbaseoptions.sty
(/usr/local/share/texmf-dist/tex/latex/graphics/keyval.sty))
(/usr/local/share/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/share/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/local/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/local/share/texmf-dist/tex/latex/base/size11.clo)
(/usr/local/share/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(/usr/local/share/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/share/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/share/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/share/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/local/share/texmf-dist/tex/xelatex/xetex-def/xetex.def)))
(/usr/local/share/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(/usr/local/share/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/usr/local/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
(/usr/local/share/texmf-dist/tex/latex/ms/everyshi.sty))
(/usr/local/share/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex))
(/usr/local/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
(/usr/local/share/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
(/usr/local/share/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
)) (/usr/local/share/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg)
(/usr/local/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def
(/usr/local/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def)

(/usr/local/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-
dvi.def)))
(/usr/local/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.te
x)
(/usr/local/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.te
x)) (/usr/local/share/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/local/share/texmf-dist/tex/latex/latexconfig/color.cfg))
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.t
ex)
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometri
c.code.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.
tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.c
ode.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.te
x)
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.t
ex)
(/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.te
x))) (/usr/local/share/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex))
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex)

(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.co
de.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.t
ex)
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex)

(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.cod
e.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.
code.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex
)
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.c
ode.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex)
 (/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex)
 (/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.te
x))
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex)

(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.cod
e.tex)
(/usr/local/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.te
x))) (/usr/local/share/texmf-dist/tex/latex/pgf/utilities/xxcolor.sty)
(/usr/local/share/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/local/share/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(/usr/local/share/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(/usr/local/share/texmf-dist/tex/latex/oberdiek/kvoptions.sty)
(/usr/local/share/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/local/share/texmf-dist/tex/xelatex/xetexconfig/hyperref.cfg)
(/usr/local/share/texmf-dist/tex/latex/url/url.sty)

Package hyperref Message: Stopped early.

)

Package hyperref Message: Driver (autodetected): hxetex.

(/usr/local/share/texmf-dist/tex/latex/hyperref/hxetex.def
(/usr/local/share/texmf-dist/tex/latex/hyperref/puenc.def)
(/usr/local/share/texmf-dist/tex/generic/oberdiek/stringenc.sty)
(/usr/local/share/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))
(/usr/local/share/texmf-dist/tex/generic/oberdiek/se-ascii-print.def)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbaserequires.sty
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasecompatibility.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasefont.sty
(/usr/local/share/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/share/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/share/texmf-dist/tex/latex/sansmathaccent/sansmathaccent.sty))
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasetranslator.sty
(/usr/local/share/texmf-dist/tex/latex/beamer/translator/translator.sty
(/usr/local/share/texmf-dist/tex/latex/beamer/translator/translator-language-ma
ppings.tex))) (/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasemisc.sty)
 (/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasetwoscreens.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbaseoverlay.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasetitle.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasesection.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbaseframe.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbaseverbatim.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbaseframesize.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbaseframecomponents.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasecolor.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasenotes.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasetoc.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasetemplates.sty
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbaseauxtemplates.sty
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbaseboxes.sty)))
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbaselocalstructure.sty
(/usr/local/share/texmf-dist/tex/latex/tools/enumerate.sty))
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasenavigation.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasetheorems.sty
(/usr/local/share/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/share/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/share/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/share/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/share/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/share/texmf-dist/tex/latex/amscls/amsthm.sty))
(/usr/local/share/texmf-dist/tex/latex/beamer/beamerbasethemes.sty))
(/usr/local/share/texmf-dist/tex/latex/beamer/themes/theme/beamerthemedefault.s
ty
(/usr/local/share/texmf-dist/tex/latex/beamer/themes/font/beamerfontthemedefaul
t.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/themes/color/beamercolorthemedefa
ult.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/themes/inner/beamerinnerthemedefa
ult.sty)
(/usr/local/share/texmf-dist/tex/latex/beamer/themes/outer/beamerouterthemedefa
ult.sty))) (/usr/local/share/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/share/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3names.sty
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty))
(/usr/local/share/texmf-dist/tex/latex/etex-pkg/etex.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3basics.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3expan.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3tl.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3seq.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3int.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3quark.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3prg.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3clist.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3token.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3prop.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3msg.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3file.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3skip.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3keys.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3fp.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3box.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3coffins.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3color.sty)
(/usr/local/share/texmf-dist/tex/latex/l3kernel/l3luatex.sty))
(/usr/local/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/local/share/texmf-dist/tex/latex/fontspec/fontspec-patches.sty
(/usr/local/share/texmf-dist/tex/latex/base/fixltx2e.sty)
*************************************************
* LaTeX warning: "xparse/redefine-command"
*
* Redefining document command \oldstylenums with arg. spec. 'm' on line 107.
*************************************************
) (/usr/local/share/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/share/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/share/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/local/share/texmf-dist/tex/latex/euenc/eu1lmr.fd))
(/usr/local/share/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/local/share/texmf-dist/tex/latex/tipa/t3enc.def
(/usr/local/share/texmf-dist/tex/latex/euenc/eu1lmss.fd)))
(/usr/local/share/texmf-dist/tex/latex/fontspec/fontspec.cfg)))kpathsea: Invalid fontname `TeX Gyre Heros', contains ' '


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

l.4 \setsansfont{TeX Gyre Heros}

? q
OK, entering \batchmodekpathsea: Invalid fontname `TeX Gyre Heros', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros/B', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros/I', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros/BI', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros:', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros:', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros:', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros:', contains ' '
kpathsea: Invalid fontname `TeX Gyre Heros:', contains ' '
sorilea%
-----------------------------------------------------------------



Regards,
Roger Leigh

Fix: 

texmf-var/fonts/conf/texlive-fontconfig.conf is installed by TeXLive when installed by hand, but not installed by the FreeBSD port.  Ideally, this should be installed and then a symlink added to e.g. /usr/local/etc/fonts/conf.d/09texlive which links to the texlive font configuration.  Then, "fc-cache -fsrv" needs running to update the font cache.  After this is done, xelatex should then be able to run without error (since it can find and use the fonts).
How-To-Repeat: Save test file above and run command as above to reproduce.
Comment 1 Edwin Groothuis freebsd_committer 2014-03-09 21:43:50 UTC
Responsible Changed
From-To: freebsd-ports-bugs->hrs

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Roger Leigh 2015-08-17 16:28:36 UTC
Created attachment 159959 [details]
Example configuration to register OpenType fonts.

Example configuration to register OpenType fonts.  If this is dropped into /usr/local/etc/fonts/fonts/conf.d and "fc-cache -frsv" is run, it will register all texlive-provided OpenType fonts.  The same thing could be done for TrueType and/or Type 1 fonts if desired.

If for example, the package providing the opentype directory under texmf/fonts could provide this file, and all packages providing fonts could run fc-cache, this would mean the texlive-provided fonts would work out of the box with e.g xetex/xelatex.
Comment 3 Roger Leigh 2015-08-17 16:33:51 UTC
Note I'm not sure if this is the proper place for the file in the fontconfig sequence (46), but it works for me.
Comment 4 Walter Schwarzenfeld freebsd_triage 2018-01-13 19:59:58 UTC
Not clear if this is solved. If it is so, please close the  PR.
Comment 5 Roger Leigh 2018-01-16 16:39:04 UTC
I've reopened this because it's still present and unaddressed (just checked to confirm).  Not sure why it was closed given that it's clearly still present based on the information provided here.

TeXLive needs to install a font configuration file into /usr/local/fonts/conf.d so that xetex can find the tex fonts via fontconfig.  I provided an example file right here as an attachment.  That's all that's needed to resolve this--just install this as part of the appropriate package (likely the one containing the opentype fonts).
Comment 6 berend 2018-01-18 07:09:07 UTC
Created attachment 189878 [details]
Patch to fix install issue

Thanks for providing all I needed to create this patch! Please check it out.
Comment 7 Walter Schwarzenfeld freebsd_triage 2018-01-18 08:04:33 UTC
Sorry, I erronousely closed it.
Comment 8 Roger Leigh 2018-01-22 13:36:53 UTC
Created attachment 189965 [details]
Updated patch to add fontconfig support

I found a few problems with the original patch (INSTALL_DATA used where INSTALL is needed; config file not included, etc.), so this patch contains everything I needed to successfully build and install the updated texlive-base (tested with poudriere).


Note that followup work includes:
- fc-cache needs running as a post-install step for each tex package providing opentype fonts
- tex-xetex is missing a dependency on tex-dvipdfmx which is required to create PDFs with the correct fonts using xelatex; without it fonts are missing from the created PDF
Comment 9 Roger Leigh 2018-01-22 13:39:10 UTC
The tex-xetex issue was already reported in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=187403