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

Nikolay Shaplov dhyan at nataraj.su
Wed Apr 2 18:33:12 CEST 2025


Hi! Hope this is right list to report the bug,

I met very confusing error message, while processing .tex file using xelatex. 
It says 

xdvipdfmx:fatal: Cannot proceed without the font: /home/nataraj/.local/share/
fonts/Gilroy-Regular.woff2

Though file actually exists.

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

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. 

Fix Suggestion:

Guys from tex-live at tug.org list told me, that getting font list is a task of 
fontspec package. So I am not asking about it here.
https://tug.org/pipermail/tex-live/2025-April/051434.html

But I guess we can add more helpful error message at dvi.c in the case when 
font file exists, but not supported.

If you like, I can suggest a patch, the code is quite clear here for me...

-- 
Nikolay Shaplov aka Nataraj
Fuzzing Engineer at Postgres Professional
Matrix IM: @dhyan:nataraj.su
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tex
Type: text/x-tex
Size: 114 bytes
Desc: not available
URL: <https://tug.org/pipermail/dvipdfmx/attachments/20250402/f3b15dcb/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://tug.org/pipermail/dvipdfmx/attachments/20250402/f3b15dcb/attachment.sig>


More information about the dvipdfmx mailing list.