freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] How to determine if horizontal hinting is happening?


From: Adam Goode
Subject: Re: [ft-devel] How to determine if horizontal hinting is happening?
Date: Fri, 16 Feb 2018 10:13:05 -0500

On Fri, Feb 16, 2018 at 1:31 AM, Werner LEMBERG <address@hidden> wrote:
>
>
> > I am working on a Chrome bug (crbug.com/740385) related to subpixel
> > positioning and hinting.
> >
> > There is currently an issue where glyphs do not get positioned
> > correctly in all cases, and to solve this problem I need to enable
> > subpixel positioning.
> >
> > This works, except when horizontal hinting is enabled ("full
> > hinting" in xft enables this). In this case, letters get smeared
> > badly.
> >
> > https://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html
> > suggests that I should do subpixel positioning if I am not hinting
> > horizontally, which matches with my understanding.
> >
> > Therefore, I would like to programatically determine if horizontal
> > hinting is happening and base the subpixel positioning decision on
> > this information.  But I have not been able to figure out how to do
> > this.  Is there a way that avoids needing to know the internals of
> > the engines?
>
> Well, the decision whether you are using `full hinting' or not is
> given by the load flags used in `FT_Load_Glyph'.  This is *external*
> information given by Chrome itself!  FreeType overrides this only for
> the very small class of `tricky' fonts which don't display correctly
> otherwise; this can be tested with `FT_IS_TRICKY'.
>
> Am I missing something?
>
>
>     Werner


Hi Werner,

Yes, Chrome itself provides these flags. I'm looking now at
https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_LOAD_TARGET_XXX

What I think I need is a bit more documentation about these flags,
allowing me to reason about which ones will not do horizontal hinting
(letting me safely do subpixel positioning) and which ones will do
horizontal hinting. Right now, I have to experimentally determine this
by changing flags manually and observing what happens.

But it looks like I can't quite be sure of this either, because "a
font's native hinters may ignore the hinting algorithm you have
specified".

I don't think I always want to force the autohinter. Really I just
want the best hinter to be chosen given the user's preferences and
Freetype's internal logic. What I need is a reliable mechanism (across
Freetype versions and fonts) to determine if a font has horizontal
hinting applied or not. It looks like it's something Freetype might
need to provide, since the true answer seems to come from the
interaction of flags, fonts, and engines.

Could this be something that I can read out of FT_FaceRec ?

Or am I overthinking this?


Thanks for your help,

Adam



reply via email to

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