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: Werner LEMBERG
Subject: Re: [ft-devel] How to determine if horizontal hinting is happening?
Date: Mon, 19 Feb 2018 00:10:01 +0100 (CET)

> The issue is that sometimes we want to start text at a non-integer
> position, but still align each glyph appropriately to allow for
> hinting to look correct.  This means that depending on hinting
> parameters, we might want to round the final position of each glyph
> before displaying on screen.  If the glyph is horizontally hinted,
> we do want to round to integer screen positions.  But if the glyph
> is not horizontally hinted, we know that it is better to position
> the glyph at a subpixel position.
> 
> Skia already makes some optimizations based on this hinting
> knowledge.  It knows that light hinting does not hint in the
> horizontal direction and avoids running hinting before computing
> metrics.  But it doesn't know if other engines might not hint
> horizontally, and has to run the hinter before metric computation.
> That would be another place to use this information.

Let me summarize: We have an `FT_Face' object together with the load
flags for `FT_Load_Glyph', and you want to know whether FreeType is
going to hint horizontally, right?  For this we need a new function,
say,

  FT_Bool
  FT_Is_Hinted_Horizontally( FT_Face   face,
                             FT_Int32  load_flags );

An alternative could be

  typedef enum FT_Render_Info_
  {
    FT_RENDER_INFO_HINT_HORIZONTALLY,
    FT_RENDER_INFO_HINT_VERTICALLY,
    ...

  } FT_Render_Info;


  FT_Int
  FT_Get_Rendering_Info( FT_Face         face,
                         FT_Render_Info  info,
                         FT_Int32        load_flags );

however, I'm not sure whether the latter is justified.

Comments, please.


    Werner



reply via email to

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