freetype-devel
[Top][All Lists]
Advanced

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

RE: [ft-devel] ft-smooth for 2.1.10?


From: Turner, David
Subject: RE: [ft-devel] ft-smooth for 2.1.10?
Date: Tue, 20 Dec 2005 13:19:58 +0100

Ah, I'll try to explain, there is something ambiguous there,
and we need to make the documentation clearer about this.

I'll try to sum it up as:

A/ the FT_LOAD_TARGET_XXX values are used with FT_Load_Glyph
   and specify a *hinting* algorithm to the outline loader.

B/ the FT_RENDER_MODE_XXX values are used with FT_Render_Glyph
   and specify a *rendering* algorithm, which can be either
   monochrome, gray, LCD or LCD_V.

the confusion comes from the existence of FT_RENDER_MODE_LIGHT,
because:

  - when it is used in FT_Render_Glyph, or other rendering
    function, it is equivalent to FT_RENDER_MODE_NORMAL,
    which correspond to gray rendering.

  - the value is also used to build FT_LOAD_TARGET_LIGHT,
    which however instructs the auto-hinter called by
    FT_Load_Glyph to perform a "light" outline distorsion.

suppose that you want to perform LIGHT hinting, but render
to a LCD surface, you'd do something like:

   FT_Load_Glyph( face, glyph_index, FT_LOAD_TARGET_LIGHT );
   FT_Render_Glyph( face, FT_RENDER_MODE_LCD );

now, there is the FT_LOAD_RENDER bit-flag, that instructs
FT_Load_Glyph to perform rendering just after the outline
was hinted. When you call:

   FT_Load_Glyph( face, gindex, FT_LOAD_TARGET_XXX | FT_LOAD_RENDER );

this is equivalent to:

  FT_Load_Glyph( face, gindex, FT_LOARD_TARGET_XXX );
  FT_Render_Glyph( face, FT_RENDER_MODE_XXX );

so, when XXX is LIGHT, you get LIGHT hinting, and gray rendering
by default with this bit-flag set.

The problem comes from the fact that the same values are used to
specify hinting algorithms and rendering modes.

The documentation probably needs some update.

Hope this helps,

- David



> -----Message d'origine-----
> De : address@hidden [mailto:address@hidden
> Envoyé : mardi 20 décembre 2005 12:31
> À : Turner, David; David Turner; address@hidden
> Objet : RE: [ft-devel] ft-smooth for 2.1.10?
>
>
> Hello David,
>
> > > what exactly
> > > is the API change, and since when?
> > >
> > > FT_LOAD_TARGET_LIGHT and FT_RENDER_MODE_LIGHT did nothing for
> > > in 2.1.10.
> > >
> >
> > There is no API change, it's simply the algorithm used to implement
> > the LIGHT hinting mode that has been modified.
> >
> > Moreover, in 2.1.10, this mode did actually perform something.
>
> From the API docs I read this:
>
> FT_LOAD_TARGET_LIGHT:
> Use hinting for FT_RENDER_MODE_LIGHT.
>
> FT_RENDER_MODE_LIGHT:
> This is similar to FT_RENDER_MODE_NORMAL -- you have to use
> FT_LOAD_TARGET_LIGHT in calls to FT_Load_Glyph to get any effect since
> the rendering process no longer influences the positioning of glyph
> outlines. The resulting glyph shapes are more similar to the original,
> while being a bit more fuzzy (`better shapes' instead of `better
> contrast', so to say.
>
> ---
>
> What I make up of this: FT_RENDER_MODE_LIGHT has become
> deprecated, and
> specifying it is exactly the same as specifying FT_RENDER_MODE_NORMAL.
>
> I should only use FT_LOAD_TARGET_LIGHT in FT_Load_Glyph().
>
> So:
>
> error = FT_Load_Char( face, text[n], FT_LOAD_DEFAULT |
> FT_LOAD_TARGET_LIGHT)
> ...
> error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, 0, 1 );
>
> ---
>
>
> If my assumption is correct, I would suggest moving the explanation to
> the FT_LOAD_TARGET_LIGHT flag docs, and have
> FT_RENDER_MODE_LIGHT refer
> to FT_LOAD_TARGET_LIGHT.
>
> Furthermore, on the web API docs, I noticed
> FT_LOAD_TARGET_LIGHT is not
> in the FT_LOAD_XXX list that sits before their descriptions.
>
>
> Thanks, best regards,
>
> Leon.
>
>
>
> On Tue, 20 Dec 2005 10:15:11 +0100, "Turner, David" <address@hidden>
> said:
> > Hi Leon,
> >
> > > For those of us using and/or testing FreeType standalone,
> > > what exactly
> > > is the API change, and since when?
> > >
> > > FT_LOAD_TARGET_LIGHT and FT_RENDER_MODE_LIGHT did nothing for
> > > in 2.1.10.
> > >
> >
> > There is no API change, it's simply the algorithm used to implement
> > the LIGHT hinting mode that has been modified.
> >
> > Moreover, in 2.1.10, this mode did actually perform something.
> > This can be demo-ed with "ftview" and the "L" key to cycle between
> > target modes.
> >
> > Regards,
> >
> > - David
> >
> **************************************************************
> *********************
> > Information contained in this email message is confidential
> and may be
> > privileged, and is intended only for use of the individual or entity
> > named above. If the reader of this message is not the
> intended recipient,
> > or the employee or agent responsible to deliver it to the intended
> > recipient, you are hereby notified that any dissemination,
> distribution
> > or copying of this communication is strictly prohibited. If you have
> > received this communication in error, please immediately notify the
> > address@hidden and destroy the original message.
> >
> **************************************************************
> *********************
> >
>
***********************************************************************************
Information contained in this email message is confidential and may be 
privileged, and is intended only for use of the individual or entity named 
above. If the reader of this message is not the intended recipient, or the 
employee or agent responsible to deliver it to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the address@hidden and destroy the original 
message.
***********************************************************************************





reply via email to

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