Bug 1104597 - Calibre takes a long time to load when many fonts are installed
Calibre takes a long time to load when many fonts are installed
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: X11 Applications
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Eric Schirra
E-mail List
Depends on:
  Show dependency treegraph
Reported: 2018-08-12 19:07 UTC by Carmen Bianca Bakker
Modified: 2018-08-13 23:05 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Carmen Bianca Bakker 2018-08-12 19:07:15 UTC
When you have many fonts installed, Calibre will take a long time to load as it tries to load them all.  This leads to a long period of 100% CPU usage and upwards of 1 GiB of memory usage.

To reproduce:

zypper install calibre noto-*

The solution is fairly simple.  Normally, Calibre ships some Liberation fonts in /usr/share/calibre/fonts/liberation.  The openSUSE packagers removed those fonts to prevent duplication and linked the liberation folder to /usr/share/fonts/truetype.  As a result, a lot more fonts are being loaded.

My proposed solution is to delete the shipped font files and replace them with individual symbolic links towards the Liberation font files:

rm /usr/share/calibre/fonts/liberation
mkdir /usr/share/calibre/fonts/liberation
ln -s /usr/share/fonts/truetype/Liberation* /usr/share/calibre/fonts/liberation/

I'll try to submit a fix for the Calibre package.
Comment 1 Andreas Stieger 2018-08-13 07:04:29 UTC
assign to maintainers
Comment 2 Eric Schirra 2018-08-13 17:08:55 UTC
Should be fixed now.
And is on the way in build system.
Comment 3 Eric Schirra 2018-08-13 18:21:06 UTC
Revert request and back to old version,
because changes from request does break update of package.
@Carmen: Please fix this, test it before, and make a new request.
Comment 4 Cor Blom 2018-08-13 18:54:30 UTC
Maybe we have the reverse of bug #1022710

There is code in the spec to take care of that. That probably needs to be changed or removed.
Comment 5 Carmen Bianca Bakker 2018-08-13 22:29:37 UTC
I've submitted another attempt at fixing this bug: https://build.opensuse.org/request/show/629083

Everything _works_ as tested, but zypper/RPM complains about conflicting files when converting from a symlink directory to a proper directory.  See also bsc#911756.  The conflict is solved by the pretrans scriptlet.

I don't know how to circumvent the conflict.  Ought I rename the font files, perhaps?  That seems like a dirty hack, but would theoretically circumvent the conflict.

I'll take any input.
Comment 6 Eric Schirra 2018-08-13 23:05:51 UTC
Hello Carmen,

i have accepted your new request.
With rpm -Uvh it runs without errors.