Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Windows: generating font cache is slow (apparent hang on first run) #135

Open
fair2003 opened this issue Jan 16, 2019 · 7 comments
Open
Labels

Comments

@fair2003
Copy link

On my computer with Windows 10, pdf2djvu only works in version 8.0 or lower. I do not know why.

@jwilk
Copy link
Member

jwilk commented Jan 22, 2019

What do you mean exactly by “does not work”? What are the symptoms?

I'm afraid I don't have access to a Windows 10 machine at the moment to try it out myself. ☹

@fair2003
Copy link
Author

It shows only:

C:\pdf2djvu_0.9.12\pdf2djvu -o 001.djvu 001.pdf
001.pdf:

and nothing else happens.

If I use pdf2djvu_0.8 or lower, everything works fine.

I noticed that when after some time I back to version 9.12, it works too. So newer versions work, but only after some time. At the beginning, something is stuttering. Maybe it is related to permissions in Windows 10?

@jwilk
Copy link
Member

jwilk commented Jun 10, 2019

I've observed similar behavior on a Windows 7 machine.

I think this is what's going on:

  1. fontconfig takes very long to build the font cache. This makes it look like the conversion hanged on the first page.

  2. Once the cache is built, further conversions proceed without extra delay.

fontconfig stores the font cache in:

C:\Users\username\AppData\Local\fontconfig\cache

@fair2003, could you delete this directory (or rename is to something else) and see if this makes the apparent hang re-appear?

@fair2003
Copy link
Author

Sorry, I do not have such directory on Windows 10: C:\Users\username\AppData\Local\fontconfig\

@jwilk
Copy link
Member

jwilk commented Jun 12, 2019

Hmm, I guess the application data directory is somewhere else on your system.
The location of this directory should in the LOCALAPPDATA environment variable.
So you can do this: open file explorer, type %LOCALAPPDATA%\fontconfig in the location bar and press enter.

@fair2003
Copy link
Author

I recently reinstalled the system and that is why I did not have this directory. After running pdf2djvu the directory was created. Yes, you are right. Once the cache is built, further conversions proceed without extra delay.

@jwilk jwilk changed the title pdf2djvu does not work on Windows 10 Windows: generating font cache is slow (apparent hang on first run) Jun 15, 2019
@jwilk
Copy link
Member

jwilk commented Aug 9, 2022

Possible work-around: remove the line

<dir>WINDOWSFONTDIR</dir>

from etc\fonts\fonts.conf.
This means pdf2djvu won't use system fonts, but hopefully that shouldn't matter most of the time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants