all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* LuaTeX/luaotfload doesn't find any fonts (using fontspec) on Guix?
@ 2024-05-07 16:34 Benjamin Slade
  2024-05-07 17:25 ` Nicolas Goaziou via
  0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Slade @ 2024-05-07 16:34 UTC (permalink / raw)
  To: help-guix

I'm having trouble using LuaTeX on Guix.

luaotfload doesn't seem to be able to find any fonts, whether system-wide or local (when used with fontspec). I get messages like:

      luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font "Cardo" not found.
        luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
        ! Package fontspec Error: The font "Cardo" cannot be found.

I don't have this issue on other distros, or on Guix when using XeTeX instead of LuaTeX.

Is there some additional setup or configuration (or another package ?) that I need on Guix to get LuaTeX/luatofload to work properly ? (pathing issues of some sort ?)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LuaTeX/luaotfload doesn't find any fonts (using fontspec) on Guix?
  2024-05-07 16:34 LuaTeX/luaotfload doesn't find any fonts (using fontspec) on Guix? Benjamin Slade
@ 2024-05-07 17:25 ` Nicolas Goaziou via
  2024-05-09 15:23   ` Benjamin Slade
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou via @ 2024-05-07 17:25 UTC (permalink / raw)
  To: Benjamin Slade; +Cc: help-guix

Hello,

Benjamin Slade <beoram@gmail.com> writes:

> I'm having trouble using LuaTeX on Guix.
>
> luaotfload doesn't seem to be able to find any fonts, whether system-wide or local (when used with fontspec). I get messages like:
>
>       luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font "Cardo" not found.
>         luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
>         ! Package fontspec Error: The font "Cardo" cannot be found.
>
> I don't have this issue on other distros, or on Guix when using XeTeX instead of LuaTeX.
>
> Is there some additional setup or configuration (or another package ?)
> that I need on Guix to get LuaTeX/luatofload to work properly ?
> (pathing issues of some sort ?)

I compiled successfully the following document (test-font.tex):

--8<---------------cut here---------------start------------->8---
\documentclass[11pt,a4paper]{amsart}
\usepackage{unicode-math}
\setmathfont{Asana Math}
\setmainfont{Droid Serif}
\begin{document}
\[(D_e\Phi_{\gamma(s)})^{-1}(\gamma'(s))=\varphi'(s)(D_e\Phi_{\alpha(\varphi(s))})^{-1}(\alpha'(\varphi(s)))\]
\end{document}
--8<---------------cut here---------------end--------------->8---

using the following command:

  guix shell texlive-scheme-small texlive-collection-luatex texlive-droid texlive-asana-math texlive-unicode-math -- lualatex test-font.tex

However, I don't think it takes into consideration the specified fonts.
In the same environment, `luaotfload-tool --help' reports

--8<---------------cut here---------------start------------->8---
The font database will be saved to
   {/gnu/store/f1hdawmb5401cldyl6f27lvc3hvxbw8l-profile/share/texmf-dist/luatex-cache/generic/names/luaotfload-names.lua.gz
   {/gnu/store/f1hdawmb5401cldyl6f27lvc3hvxbw8l-profile/share/texmf-dist/luatex-cache/generic/names/luaotfload-names.luc

-------------------------------------------------------------------------------
                                   FONT CACHE

  --cache=<directive>          operate on font cache, where <directive> is
                               "show", "purge", or "erase"

The font cache will be written to
   {/gnu/store/f1hdawmb5401cldyl6f27lvc3hvxbw8l-profile/share/texmf-dist/luatex-cache/generic/fonts/
--8<---------------cut here---------------end--------------->8---

This doesn't seem good as the store is not writable.

I read[¹] that "texmf.cnf" and "texmfcnf.lua" might be misconfigured. In
particular, `kpsewhich -var-value=TEXMFCACHE' reports a store location.
At the very least, I think TEXMFCACHE in "texmf.cnf" should be set to
$TEXMFVAR instead of $TEXMFSYSVAR;$TEXMFVAR as it is the case currently.
I'm not sure it will help, tho.

Regards,


[¹]  <https://tex.stackexchange.com/questions/691039/luaotfload-no-writeable-cache-path-error/691047>

-- 
Nicolas Goaziou




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LuaTeX/luaotfload doesn't find any fonts (using fontspec) on Guix?
  2024-05-07 17:25 ` Nicolas Goaziou via
@ 2024-05-09 15:23   ` Benjamin Slade
  2024-05-09 16:21     ` Nicolas Goaziou via
  0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Slade @ 2024-05-09 15:23 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: help-guix

On Tue, 07 May 2024 19:25:35 +0200 (1 day, 21 hours, 55 minutes ago), Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> Hello,

Hi Nicolas,

Thanks for this! 

....
> This doesn't seem good as the store is not writable.

> I read[¹] that "texmf.cnf" and "texmfcnf.lua" might be misconfigured. In
> particular, `kpsewhich -var-value=TEXMFCACHE' reports a store location.
> At the very least, I think TEXMFCACHE in "texmf.cnf" should be set to
> $TEXMFVAR instead of $TEXMFSYSVAR;$TEXMFVAR as it is the case currently.
> I'm not sure it will help, tho.

I will try to see if there is anything that can be done in terms of local/home configuration.

I wonder if there's a reasonable upstream/Guix fix for the luatex package definition.

I would really like to be able to get this working; I do a lot of work which requires LuaTeX and being able to work with additional fonts, and currently this means I cannot do this work on any of my Guix machines, it seems.

best,
 —Benjamin
 --
 '(Dr Benjamin Slade (he/him)
     (website . <https://lambda-y.net>)     
     `(pgp_fp: ,(B20E 444C FA80 B5F8 15FA  4AD8 6FBF CD68 3B05 2B84))
       "sent by [mu4e] 1.12.5 in [Emacs] 30.0.50 with [org-msg] on [EndeavourOS] [Linux]")


[mu4e] <https://www.djcbsoftware.nl/code/mu/mu4e.html>

[Emacs] <https://www.gnu.org/software/emacs/>

[org-msg] <https://github.com/jeremy-compostella/org-msg>

[EndeavourOS] <https://endeavouros.com/>

[Linux] <https://opensource.com/resources/linux>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LuaTeX/luaotfload doesn't find any fonts (using fontspec) on Guix?
  2024-05-09 15:23   ` Benjamin Slade
@ 2024-05-09 16:21     ` Nicolas Goaziou via
  2024-05-14 17:35       ` Nicolas Goaziou via
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou via @ 2024-05-09 16:21 UTC (permalink / raw)
  To: Benjamin Slade; +Cc: help-guix

Hello,

Benjamin Slade <beoram@gmail.com> writes:

>> This doesn't seem good as the store is not writable.
>
>> I read[¹] that "texmf.cnf" and "texmfcnf.lua" might be misconfigured. In
>> particular, `kpsewhich -var-value=TEXMFCACHE' reports a store location.
>> At the very least, I think TEXMFCACHE in "texmf.cnf" should be set to
>> $TEXMFVAR instead of $TEXMFSYSVAR;$TEXMFVAR as it is the case currently.
>> I'm not sure it will help, tho.
>
> I will try to see if there is anything that can be done in terms of
> local/home configuration.
>
> I wonder if there's a reasonable upstream/Guix fix for the luatex
> package definition.

What I wrote above is actually wrong. $TEXMFSYSVAR does not point to the
store, but to "{/gnu/...", which means "lualatex" creates a "{"
directory in the current working directory. It is silly (and has been
reported already[¹]), but at least the cache can be written to the disk.

I'm not sure yet there's a problem on the Guix side. Font configuration
can be tricky.

[¹]  <https://issues.guix.gnu.org/64772>

Regards,
-- 
Nicolas Goaziou




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LuaTeX/luaotfload doesn't find any fonts (using fontspec) on Guix?
  2024-05-09 16:21     ` Nicolas Goaziou via
@ 2024-05-14 17:35       ` Nicolas Goaziou via
  2024-05-14 22:13         ` Benjamin Slade
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou via @ 2024-05-14 17:35 UTC (permalink / raw)
  To: Benjamin Slade; +Cc: help-guix

Hello,

I forgot to send a carbon copy to help-guix ML in my last answer, so
I include it here.

Nicolas Goaziou via <help-guix@gnu.org> writes:

> Benjamin Slade <beoram@gmail.com> writes:
>
>>> This doesn't seem good as the store is not writable.
>>
>>> I read[¹] that "texmf.cnf" and "texmfcnf.lua" might be misconfigured. In
>>> particular, `kpsewhich -var-value=TEXMFCACHE' reports a store location.
>>> At the very least, I think TEXMFCACHE in "texmf.cnf" should be set to
>>> $TEXMFVAR instead of $TEXMFSYSVAR;$TEXMFVAR as it is the case currently.
>>> I'm not sure it will help, tho.
>>
>> I will try to see if there is anything that can be done in terms of
>> local/home configuration.
>>
>> I wonder if there's a reasonable upstream/Guix fix for the luatex
>> package definition.
>
> What I wrote above is actually wrong. $TEXMFSYSVAR does not point to the
> store, but to "{/gnu/...", which means "lualatex" creates a "{"
> directory in the current working directory. It is silly (and has been
> reported already[¹]), but at least the cache can be written to the disk.
>
> I'm not sure yet there's a problem on the Guix side. Font configuration
> can be tricky.

Actually, the problem is on the Guix side, and it will be solved in the
"tex-team" branch.

Meanwhile, the solution is to set OSFONTDIR environment variable to
'{$XDG_DATA_DIRS}'.

With it, the following "test.tex" document compiles correctly:

--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Fantasque Sans Mono}
\begin{document}
Test \textbf{Test} \textit{Test}
\end{document}
--8<---------------cut here---------------end--------------->8---

in the following environment

  guix shell --pure texlive-collection-latex texlive-fontspec fontconfig font-fantasque-sans

with the following command

  export OSFONTDIR='{$XDG_DATA_DIRS}'; lualatex test.tex

Thank you for the bug report!

Regards,
-- 
Nicolas Goaziou




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: LuaTeX/luaotfload doesn't find any fonts (using fontspec) on Guix?
  2024-05-14 17:35       ` Nicolas Goaziou via
@ 2024-05-14 22:13         ` Benjamin Slade
  0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Slade @ 2024-05-14 22:13 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: help-guix

Many thanks, Nicolas. I'll try that out!

On Tue, 14 May 2024 19:35:58 +0200 (4 hours, 36 minutes, 43 seconds ago), Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> Hello,

> I forgot to send a carbon copy to help-guix ML in my last answer, so
> I include it here.

> Nicolas Goaziou via <help-guix@gnu.org> writes:

> > Benjamin Slade <beoram@gmail.com> writes:
> >
> >>> This doesn't seem good as the store is not writable.
> >>
> >>> I read[¹] that "texmf.cnf" and "texmfcnf.lua" might be misconfigured. In
> >>> particular, `kpsewhich -var-value=TEXMFCACHE' reports a store location.
> >>> At the very least, I think TEXMFCACHE in "texmf.cnf" should be set to
> >>> $TEXMFVAR instead of $TEXMFSYSVAR;$TEXMFVAR as it is the case currently.
> >>> I'm not sure it will help, tho.
> >>
> >> I will try to see if there is anything that can be done in terms of
> >> local/home configuration.
> >>
> >> I wonder if there's a reasonable upstream/Guix fix for the luatex
> >> package definition.
> >
> > What I wrote above is actually wrong. $TEXMFSYSVAR does not point to the
> > store, but to "{/gnu/...", which means "lualatex" creates a "{"
> > directory in the current working directory. It is silly (and has been
> > reported already[¹]), but at least the cache can be written to the disk.
> >
> > I'm not sure yet there's a problem on the Guix side. Font configuration
> > can be tricky.

> Actually, the problem is on the Guix side, and it will be solved in the
> "tex-team" branch.

> Meanwhile, the solution is to set OSFONTDIR environment variable to
> '{$XDG_DATA_DIRS}'.

> With it, the following "test.tex" document compiles correctly:

> --8<---------------cut here---------------start------------->8---
> \documentclass{article}
> \usepackage{fontspec}
> \setmainfont{Fantasque Sans Mono}
> \begin{document}
> Test \textbf{Test} \textit{Test}
> \end{document}
> --8<---------------cut here---------------end--------------->8---

> in the following environment

>   guix shell --pure texlive-collection-latex texlive-fontspec fontconfig
> font-fantasque-sans

> with the following command

>   export OSFONTDIR='{$XDG_DATA_DIRS}'; lualatex test.tex

> Thank you for the bug report!

> Regards,
> -- 
> Nicolas Goaziou



best,
 —Benjamin
 --
 '(Dr Benjamin Slade (he/him)
     (website . <https://lambda-y.net>)     
     `(pgp_fp: ,(B20E 444C FA80 B5F8 15FA  4AD8 6FBF CD68 3B05 2B84))
       "sent by [mu4e] 1.12.5 in [Emacs] 30.0.50 with [org-msg] on [CachyOS] ([Linux])")


[mu4e] <https://www.djcbsoftware.nl/code/mu/mu4e.html>

[Emacs] <https://www.gnu.org/software/emacs/>

[org-msg] <https://github.com/jeremy-compostella/org-msg>

[CachyOS] <https://cachyos.org>

[Linux] <https://opensource.com/resources/linux>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-14 22:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-07 16:34 LuaTeX/luaotfload doesn't find any fonts (using fontspec) on Guix? Benjamin Slade
2024-05-07 17:25 ` Nicolas Goaziou via
2024-05-09 15:23   ` Benjamin Slade
2024-05-09 16:21     ` Nicolas Goaziou via
2024-05-14 17:35       ` Nicolas Goaziou via
2024-05-14 22:13         ` Benjamin Slade

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.