[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cairo font configuration
From: |
David Chisnall |
Subject: |
Re: Cairo font configuration |
Date: |
Sun, 26 Nov 2017 12:13:01 +0000 |
On 26 Nov 2017, at 11:48, Fred Kiefer <address@hidden> wrote:
>
> Of course cairo uses fontconfig when available. The problem Sergei and
> Riccardo are talking about really exists and it is caused by a known bug in
> the cairo handing of fixed fonts. That is the reason why terminal gets
> mentioned. There fixed fonts are still popular.
> The issue is cairo is reusing and scaling a fixed font even if there is a
> proper version available for the required size. The only workaround I see,
> beside fixing inside of cairo, is to not reuse fixed fonts. But this is to
> costly, rather we would need our own cache for these fonts, duplicating the
> cairo code.
> I could send you references of the relevant cairo and GNUstep code as soon as
> I am back home.
As I recall from looking at the Cairo back end code, a big part of the problem
is that we are using the wrong API. Cairo exposes two APIs for dealing with
fonts. The ‘toy’ API, which is intended for simple demos and things that only
need a small amount of text rendering, and the more complex API that exposes
all of the details of fonts and is intended to be used in conjunction with
Harfbuzz or similar. We use the toy API. The real fix is to move to the
complete API and integrate Harfbuzz, but this is a nontrivial amount of work.
In semi-related news, I was recently looking at Sile to see if it would be
possible to use as an NSTypesetter implementation. Sile is written in Lua and
provides the same basic model as the OpenStep text system (boxes, runs, and so
on) and implements all of the algorithms from the TeX papers. It ought to be
fairly easy to wire it up to the text system and get LaTeX-quality text
rendering, but unfortunately it’s somewhat lacking in documentation.
David