A question about fonts

Eirik Byrkjeflot Anonsen eirik at opera.com
Thu Mar 10 06:20:38 PST 2011


"Nicolas Mailhot" <nicolas.mailhot at laposte.net> writes:

>> I don't think fontconfig will solve the problem on its own.  I think the
>> application will actually have to do the job of switching between fonts,
>> but fontconfig can provide some information to help the application do a
>> better job.
>
> fonctonfig provides the info for higher level libs (pango, harfbuzz) to do the
> switching. An app should never implement a switching logic directly (that
> confuses users when different app make different switching decisions instead
> of relying on system libraries)

That's a nice theory, but not very useful for applications that had
their text layout and rendering engines written before pango/harfbuzz
became universally available "system libraries".

Seriously though, I think this is a good plan.  Doing font switching,
glyph shaping etc. correctly is a major pain and tends to involve user
configuration anyway.  Getting all of that done by a system library
would be great.

But there are some obstacles.  First of all, the API of such a system
library must provide the functionality needed by the applications in
such a way that the applications can effectively make use of it.  Maybe
pango/harfbuzz does that.  I don't know, I haven't had the time to look
into it yet.

And even if that is true, I expect rewriting applications to make use of
this API is a non-trivial amount of work.  And if the application will
also support systems that may not have pango/harfbuzz available, the
application will still have to carry its own implementation around as
well.

But yes, I seriously look forward to the day we start using a system
library for this.

eirik



More information about the xorg mailing list