[Development] Font rendering on X11/Wayland: New FreeType API to toggle LCD filters and stem darkening on a per-font basis, would love a review
Allan Sandfeld Jensen
kde at carewolf.com
Sun Nov 20 18:38:04 CET 2016
On Sunday 20 November 2016, Nikolaus Waxweiler wrote:
> > Anyway, on the API front. Forcing to autohinter is probably not
> > acceptable. So we could enable stem darkening where native available,
> > but then we need to know if what engine a face is using, or better yet
> > specifically if the engine used right now on this face did stem
> > darkening.
>
> I was just thinking. Can Qt mix font rendering modes on a face-by-face
> basis? Even without FT_Face_Option(), you can query the font driver for
> a face and the autohinter for stem darkening as described in [1]. If
> FT_Property_Get returns an error for the property, the driver has no
> means of darkening stems at all. Note that this is a font
> driver/autohinter wide setting, affecting all faces that pass through them.
>
> So, how about something like this: for each face that should be
> rendered, first query the driver (or the autohinter if it's to be used)
> if it supports stem darkening. If so, turn it on while rendering the
> face and use linear alpha blending and gamma correction (maybe with a
> factor of 1.8 like Adobe recommends). If there is no stem darkening
> support, blend naively.
Qt can't do that right now, right now it can only be controlled all or nothing
by QPA platform or font-engine, but controlling it on a face-by-face basis was
exactly the possible solution I was considering, but it requires exposing the
data from the face-specific QFontEngine class to the drawing back-end. At
least for the rasterizing engine. The whole thing first needs some cleanup in
5.9 though, it has been adjusted a bit too much for separate platforms to
match native text rendering, and is not very consistent or elegant at the
moment.
`Allan
More information about the Development
mailing list