font dialog doesn't refresh to show newly installed fonts

Bug #168960 reported by Bug Importer on 2007-10-09
68
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Inkscape
Wishlist
insaner

Bug Description

On Windows, when one installs a font after Inkscape is running, that font
doesn't show up in the selector.

Mrdocs-users (mrdocs-users) wrote :

Originator: NO

This is normal behavior for many graphics applications. On OSX there are
mechanisms to auto activate fonts, but as far as I know not in Windows,
even with 3rd party Font Managers.

Artis Rozentāls (artis) wrote :

GIMP has a "Rescan font list" for this purpose, works like a charm with fontmatrix, Inkscape could only benefit from it.

Changed in inkscape:
status: Invalid → New
Ryan Lerch (ryanlerch) on 2008-03-31
Changed in inkscape:
importance: Undecided → Wishlist
status: New → Confirmed
Eric Schrijver (schrijver) wrote :

When using OS X, fonts installed during the session also don’t show up—while other applications can see the new fonts just fine.

Eric Schrijver (schrijver) wrote :

BTW, @Mr-docs this hasn’t got to do with auto-activation. Auto-activation is about activating fonts that are installed, but temporarily disabled to save system resources. Auto-activation activates them when requested.

Normally when fonts are installed they are also activated, so fixing this doesn’t need to make use of any auto-activation api, Inkscape just needs to poll the system font list.

su_v (suv-lp) on 2011-06-16
tags: removed: win32
insaner (insaner) wrote :

can confirm this in fedora 14 linux, inkscape r11729

insaner (insaner) wrote :

found this, in case its helpful:

http://git.gnome.org/browse/gimp/tree/app/actions/fonts-actions.c

File: app/actions/fonts-actions.c
from gimp project

insaner (insaner) wrote :

hi tavmjong, should we go ahead and assign this to you?

http://inkscape.13.x6.nabble.com/message-for-tavmjong-td4966720.html#a4966754

insaner (insaner) wrote :

Currently working on this with jabiertxo, I am attaching a patch that detects fontconfig updates to the font list. I am in the process of merging this with jabiertxo's code (with some modifications) to update the widgets that use font-instances, which is not yet complete. I am uploading now because I might not have time today to do all the merges, but in the hopes it might be useful for anyone reading this.

Changed in inkscape:
assignee: nobody → insaner (insaner)
insaner (insaner) wrote :

Ok, here's the patch which should solve the issue. This will refresh the font lists for both the font dialog and font toolbar. On my fc17 linux system it takes about 3 seconds to detect a font added to the system (by using konqueror to drop a font into the "fonts:/Personal/" url for example). Also works when removing a font from the system, in which case, if the font was the currently used one, it selects another (the next below it, according to my testing), but if the font is added again, it sets that back.

Please test and let me know if you have any problems, etc. Especially needed are non-linux testers. Thanks.

Please also review and check for any obvious memory leaks, bad coding practices, etc.

Many thanks to jabiertxo for the help and code he provided.

insaner (insaner) wrote :

This patch includes a test button for those who do not have fontconfig running to manually refresh the font list. The code needs to be cleaned up a bit, but the functionality should (hopefully) be there.

insaner (insaner) wrote :

Sorry, it seems the previous patch had a typo that commented out the whole set of changes.. This one should fix that. The button should appear as a die (only distinctive icon I could find for the purpose.. it seems there's no "refresh" icon in icons.svg) in the text toolbar.

insaner (insaner) wrote :

for reference:
https://bugzilla.mozilla.org/show_bug.cgi?id=1162369

> All apps that use FcFontSetList of FcFontList are using rescan interval,
> whether they know it or not.

https://bugzilla.mozilla.org/show_bug.cgi?id=1056479#c63
https://github.com/behdad/fontconfig-monitor/blob/master/fontconfig-monitor.c

I won't be able to test (or write) any code for Windows, so you guys will have to tell me how to proceed. Should we open another bug report for the non-Windows fix? Or can someone provide some testing/code to see if we can get a Windows solution?

ScislaC (scislac) wrote :

insaner: I tested on Ubuntu 15.10 and it does add a newly added font to the list. Yay! Unfortunately it doesn't trigger a refresh of the "search" list too as you can't just type the font name in the Text Tool's "Select font family" box until after restarting Inkscape.

insaner (insaner) wrote :

From the comments in the code itself, I think this might require the rewrite to make the font toolbar use the fontlister code that the font dialog uses. That might be a bit much for me to bite at this time. I will try to see if there are some quick workarounds for that, and maybe file a bug for the rewrite to track that.

insaner (insaner) wrote :

Also, can some Windows users please confirm whether the "manual font refresh" button works or not (at refreshing the font list after a font is installed while inkscape is running) in Windows? OP?

jazzynico (jazzynico) wrote :

Tested on Windows XP, Inkscape trunk rev. 14495.
The patch applies with offsets (93 lines in widgets/text-toolbar.cpp) and the application compiles correctly, but Inkscape crashes immediately at startup with the following error:

----
Program received signal SIGSEGV, Segmentation fault.
0x00710445 in font_factory::Face(_PangoFontDescription*, bool) ()
----

tags: added: bug-migration
grey tomorrow (gtomorrow) wrote :

Hi - thanks for reporting this bug, I've manually migrated it to Inkscape's new
bug tracker on GitLab, and closed it here.

Please feel free to file new bugs about the issues you're seeing at
http://inkscape.org/report .

Moved to: https://gitlab.com/inkscape/inbox/issues/2151
Closed by: https://gitlab.com/greytomorrow

Changed in inkscape:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.