[BUG] Cannot proceed without the font: [...].woff2 problem

David Carlisle d.p.carlisle at gmail.com
Wed Apr 2 18:00:40 CEST 2025


woff fonts are a version of OpenType for web browsers, they do not work
with xetex.

It probably would be possible to make fontspec filter them out and offer a
different error message
but tex-live list isn't the place for package enhancement requests,
they can only distribute what the package authors provide (fontspec is at
https://github.com/latex3/fontspec/issues
)

(You could change the error at the point in dvipdfmx where you show but I
think the real problem is earlier, fontspec has trusted fontconfig

Arguably it is user error when you installed the font in a directory
indexed by fontconfig as it's unlikely to be usable by any application
that's using fontconfig to find the files, see also

https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/92


David


On Wed, 2 Apr 2025 at 16:42, Nikolay Shaplov <dhyan at nataraj.su> wrote:

> Some users (me included) reports getting error message
>
> xdvipdfmx:fatal: Cannot proceed without the font:
> /home/nataraj/.local/share/
> fonts/Gilroy-Regular.woff2
>
> wile running xelatex utility. File /home/nataraj/.local/share/fonts/Gilroy-
> Regular.woff2 actually exists, and this confuses most of all.
>
> Users at https://bbs.archlinux.org/viewtopic.php?id=263072 also report
> same
> thing.
>
> I managed to figure out how to reproduce it, and how to work it around.
> But I
> am not able to fix it. I hope you will do it.
>
> How to reproduce:
>
> 1. Take test.tex from the attachment.
> 2. Download  Gilroy font from  https://xfonts.pro/font-family/gilroy (Or
> find
> it in ant other place. We need .woff2 format here)
> 3. Put all content of font.zip into ~/.local/share/fonts or where ever
> user's
> font should be placed in your system
> 4. Run fc-cache -f -v to make sure fonts are properly indexed (Or similar
> thing for non-debian systems)
> 5. Run
>    xelatex test
> 6. Get an error
>
> xdvipdfmx:fatal: Cannot proceed without the font:
> /home/nataraj/.local/share/
> fonts/Gilroy-Regular.woff2
>
> This /home/nataraj/.local/share/fonts/Gilroy-Regular.woff2 file actually
> exists
> and this confuses a lot.
>
> What Causes The Bug:
>
> texk/dvipdfm-x/dvi.c has a code
>
>   if ((path = dpx_find_dfont_file(filename)) != NULL &&
>
>       (fp = MFOPEN(path, "rb")) != NULL)
>
>     is_dfont = 1;
>
>   else if ((path = dpx_find_type1_file(filename)) != NULL)
>
>     is_type1 = 1;
>
>   else if (((path = dpx_find_opentype_file(filename)) == NULL
>
>          && (path = dpx_find_truetype_file(filename)) == NULL)
>
>          || (fp = MFOPEN(path, "rb")) == NULL) {
>
>     ERROR("Cannot proceed without the font: %s", filename);
>
>   }
>
> It tries to open font file this way or that way and if there is no success
> it
> throws an error.
>
> Suggestion how to fix it:
>
> 1. I guess .woff2 fonts should be ignored at all, if they can't be
> properly
> loaded. (I actually do not know what is woff2 and how it should work, the
> only
> thing I know: it does not work)
>
> 2. If there is still font file that can't be loaded, you should have
> different
> error texts for cases: "can't open a font file", and "Font file format is
> not
> supported", so people were not confused anymore if they have some broken
> font
> file, or font-file with unsupported version or something.
>
> Since I do not understand many things here I will dare not suggesting a
> patch.
>
> Workaround:
>
> I've just deleted all .woff and .woff2 files from ~/.local/share/fonts and
> everything started working for me.
>
> I hope somebody will manage to fix that, and there won't be any problems
> with
> that strange error message
>
> --
> Nikolay Shaplov aka Nataraj
> Fuzzing Engineer at Postgres Professional
> Matrix IM: @dhyan:nataraj.su
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex-live/attachments/20250402/bc647b56/attachment.htm>


More information about the tex-live mailing list.