[Scribus] font manager
Craig Ringer
craig
Wed Nov 23 20:08:02 CET 2005
Creolophus WC wrote:
>Hi,
>
>I would like to know, if there are any font managers, like Suitcase,
>in Linux (preferably free!)
>
>
Not just the same, no. The font management capabilites are mostly on the
level of the Windows Explorer font installation / Mac OS X font library.
>if not, is it difficult to write one?
>
>
First, what do you really need this for?
Please consider that it's just less important to reduce the number of
fonts loaded at any one time on Linux. For most applications fonts are
scanned by fc-cache to generate a database of font information, which
applications then load on start-up. This is extremely fast even with
many thousands of fonts. In general, little or no memory is actually
used by this until / unless a font is actually loaded and used by the
application. Some apps that do their own font handling, like Scribus,
may have longer startup times with many more fonts, but there's ongoing
work to improve this. In my view, you'd be better off helping improve
the font cache in Scribus rather than writing a font manager.
If your goal is to be able to add more fonts at runtime, I don't know if
this is possible with most applications, as they initialize Fontconfig
at load time (generally via the toolkit). You might be able to enhance
toolkits to use inotify to watch .fonts.conf and re-scan, I guess, at
least to add fonts. Removing fonts would be much harder. That goes for
Scribus too, though in fact, Scribus can already add and remove fonts
with no documents open. Teaching Scribus to be able to add new fonts
with a document open probably wouldn't be too hard (if you're feeling
handy with C++) but the innards will need a LOT of work before it'll be
able to handle the _unloading_ of a font while a document is open.
That's because Scribus doesn't currently know when a font is no longer
in use.
It's worth noting that Linux systems have no significant limit on the
number of fonts you can have available. There's little reason to use a
Suitcase-style font manager in my view; at most I'd want a more
convenient interface for adding new "temporary" fonts. That might be
best done as a Scribus plugin. Don't expect most applications to be able
to support this at all, except through toolkit modifications.
As for the difficulty of it, it depends on exactly what you want. If you
want to maintain sets of fonts from different directories or maintain
font groups that apps notice changes to when re-loaded, then no it's
trivial - all you'd need to do is alter .fonts.conf . Heck, it can
probably be done with a tree of symlinks or hardlinks. Temporary fonts
would be similarly trivial - a directory "Temporary" with symlinks to
the fonts you currently want to load. If, however, you want to cause
apps that are already running to re-scan their available font lists,
you're in for some work, as outlined above. Get familiar with freetype,
fontconfig, Qt, gtk+, and so on.
When it comes to Scribus, it's known that Scribus would benefit from
better font unloading capabilities anyway, as this can be a major source
of resource use growth, especially if someone is working with many large
unicode fonts. I'm not aware of anyone making it a priority though, and
I personally think there are any number of more important things.
If there's anything I haven't covered, please explain more clearly what
problem you would be trying to solve, and what your goals are.
--
Craig Ringer
More information about the scribus
mailing list