freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] How does one enable the new slight auto-hinting mode?


From: Jan Alexander Steffens
Subject: Re: [ft-devel] How does one enable the new slight auto-hinting mode?
Date: Sat, 29 Apr 2017 21:35:46 +0000

On Sat, Apr 29, 2017 at 9:33 PM Markus Trippelsdorf <address@hidden> wrote:
On 2017.04.29 at 18:11 +0200, Markus Trippelsdorf wrote:
> On 2017.04.29 at 17:50 +0200, Werner LEMBERG wrote:
> >
> > >> But strangely is see no issue related to slight auto-hinting in
> > >> Chromium at all.
> >
> > Interesting.
> >
> > > Here is another example which uses webfonts:
> > > http://ilovetypography.com/2016/04/18/the-first-roman-fonts/
> > > Chromium above, Firefox below: http://imgur.com/a/WNR1R
> >
> > Ouch.  However, I think it is *impossible* to get such a bad result
> > with my change.  Are you sure that Firefox's font cache was refreshed?
>
> Yes. I have deleted the cache, but it make no difference.
>
> > Unfortunately, on my openSUSE box, Firefox seems to use a compiled-in
> > FreeType version, since `ldd' shows nothing (and testing with
> > `LD_PRELOAD' doesn't show a difference).
>
> The firefox binary is just a small wrapper that loads libxul.so.
> On my system:
>
>  % ldd /usr/lib/firefox/libxul.so | grep freety
>         libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007fd9a5aeb000)

Hard setting the autohint_mode to FT_RENDER_MODE_SLIGHT "fixes" the
Firefox problem for me:

diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index b3269d10b839..8cc860093d60 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -249,7 +249,7 @@
       /* different scaling values; this later on enforces recomputation of */
       /* everything related to the current size                            */

-      size_internal->autohint_mode    = FT_LOAD_TARGET_MODE( load_flags );
+      size_internal->autohint_mode    = FT_RENDER_MODE_SLIGHT;
       size_internal->autohint_metrics = size->metrics;

 #ifdef AF_CONFIG_OPTION_TT_SIZE_METRICS

Setting it to FT_RENDER_MODE_LIGHT makes the problem return.

Firefox should never set _SLIGHT. Perhaps what your change does is ensure the preceding check (`size_internal->autohint_mode != FT_LOAD_TARGET_MODE( load_flags )`) always succeeds. Is the problem also gone after you replace the condition with `if (1)`?

Maybe face->size->metrics changes between calls to af_loader_load_glyph, and autohint_metrics is no longer correct.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]