Re-create font cache?

Previous topic - Next topic

southwindows

Quote from: utnik on May 31, 2017, 01:03:37 PM
windows may have different font folders (at least one for system wide use and one for every user) – and scribus checks them all...

I'm familiar with the multiple fonts folder setup on Mac OS, and have heard that Linux works that way too (but I have no personal experience with it).  I've been involved in font development for many years, working mainly on Windows and have never heard of anything but the single Windows/Fonts folder as far as the system is concerned; I don't believe there are separate user fonts folders.  Some apps, like Scribus, may look at additional paths but I already eliminated that possibility.

southwindows

Thank you GarryP.

Quote from: GarryP on May 31, 2017, 01:58:24 PM
I have a strong feeling that Scribus itself isn't maintaining a font cache but is using "fontconfig" to do so. 
This would make sense as, since fontconfig stores its data completely separately from Scribus (on Windows in, AppData/Local/fontconfig/cache), uninstalling Scribus makes no difference.

I'm not familiar with fontconfig.  What you say makes sense, but are you sure that fontconfig is used on Windows?  (Cf. my reply to utnik.)  I located a fontconfig cache that was last modified in November 2015 so it doesn't look like it's been used with my recent Scribus testing.

QuoteI think it would be a good idea for Scribus to include a function . . . to destroy its current cache and re-build it from scratch.

This would be useful, not just in cases like this, but also when a user has deleted fonts that they no longer need.
For an application like Scribus, where fonts are its "bread and butter", I don't think this is asking for too much.
I agree completely.

GarryP

southwindows, I have no knowledge of fontconfig either. I simply looked at https://wiki.scribus.net/canvas/Scribus_Dependencies and it was listed there so I - stupidly - assumed it was being used.

However, after a quick look at the Scribus code it looks like fontconfig isn't used for Windows - https://github.com/scribusproject/scribus/blob/d8f82904fed9db843f656caa1fa108db0be60296/CMakeLists.txt line 818+.

(I think the "about string" tells you that fontconfig is used if there's an "F" appended to the end.)

I'm not a Qt/C++ programmer so I don't have the time to dive further down this particular rabbit hole. I could be running around in circles for ages.

You will probably be better off talking to one of the developers - on the mailing list or IRC. They might be able to help you more fully and much more quickly.

southwindows

Garry, thank you again for your efforts.

As far as I personally am concerned, there's no issue (as far as I can tell).  I started out wanting to test the OT features in Scribus and got different results on Win 7, Win 10, and Mac.  That made me think there was something wrong in Scribus' handling of OT or possibly with my font.  After uncovering this weird behavior with the font cache and testing with a renamed font, I'm satisfied that the OT features are working correctly, as is my font.  That's all I need to know.

While most people don't reinstall the same font over and over like I do when developing a font, it certainly can happen (as when an updated version is released).  So it would probably be good to get this problem fixed.  I can file a bug report, unless let's better to proceed in some other way.

GarryP

No problem.

I still think a "refresh cache" button would be a nice thing to have. I can't find a ticket in Mantis for this but that doesn't mean one doesn't already exist.

There's a note here: https://bugs.scribus.net/view.php?id=2128 that mentions "In fact I want to rewrite the whole fonts stuff, also enabling multiple copies of the same font..." but it was written in 2006 so I've no idea if anything will come from it.