freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] FT_Load_Glyph && FT_LOAD_IGNORE_TRANSFORM


From: Kal Conley
Subject: [ft-devel] FT_Load_Glyph && FT_LOAD_IGNORE_TRANSFORM
Date: Sun, 09 Oct 2011 20:26:46 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20110929 Thunderbird/8.0

Hi,
I'm trying to figure out if the following two snippets of code will load the glyph in the same way in all cases...

Snippet#1:
---------------
FT_Set_Transform(face, NULL, NULL);
FT_Load_Glyph(face, glyph_index, load_flags);

Snippet#2:
---------------
FT_Load_Glyph(face, glyph_index, load_flags | FT_LOAD_IGNORE_TRANSFORM);



I question this because FT_Load_Glyph uses the following logic when determining if auto-hinting should be used:

    /*
     * Determine whether we need to auto-hint or not.
     * The general rules are:
     *
     * - Do only auto-hinting if we have a hinter module, a scalable font
     *   format dealing with outlines, and no transforms except simple
     *   slants and/or rotations by integer multiples of 90 degrees.
     *
     * - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't
     *   have a native font hinter.
     *
     * - Otherwise, auto-hint for LIGHT hinting mode or if there isn't
     *   any hinting bytecode in the TrueType/OpenType font.
     *
     * - Exception: The font is `tricky' and requires the native hinter to
     *   load properly.
     */

    if ( hinter &&
         !( load_flags & FT_LOAD_NO_HINTING ) &&
         !( load_flags & FT_LOAD_NO_AUTOHINT ) &&
         FT_DRIVER_IS_SCALABLE( driver ) &&
         FT_DRIVER_USES_OUTLINES( driver ) &&
         !FT_IS_TRICKY( face ) &&
         ( ( face->internal->transform_matrix.yx == 0 &&
             face->internal->transform_matrix.xx != 0 ) ||
           ( face->internal->transform_matrix.xx == 0 &&
             face->internal->transform_matrix.yx != 0 ) ) )
    {


The decision is based on the transformation matrix without considering if the FT_LOAD_IGNORE_TRANSFORM bit is set. Is this a bug? Does the glyph always get loaded the same way in both cases?

Thanks
Kal




reply via email to

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