[Bug 211201] print/freetype2: update to 2.7, add V40 code

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Feb 14 16:34:19 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211201

--- Comment #80 from lightside <lightside at gmx.com> ---
The compiler's warning in comment #79 may create impression, that possible to
define TT_CONFIG_OPTION_SUBPIXEL_HINTING to 0, instead of comment/undefine it,
in case of V38=off and V40=off. 
I created some test.c program to test this:
-8<--
#include <stdio.h>

#ifndef CHECK
#if defined(TT_CONFIG_OPTION_SUBPIXEL_HINTING) &&
(TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1)
#define  TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
#endif

#if defined(TT_CONFIG_OPTION_SUBPIXEL_HINTING) &&
(TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2)
#define  TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
#endif
#else
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
#define  TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
#endif

#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
#define  TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
#endif
#endif

int main() {
        printf("default\n");
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
        printf("infinality\n");
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
        printf("minimal\n");
#endif
        return 0;
}
-->8-

with following results:
-8<--
% cc -o test test.c && ./test
default
% cc -DTT_CONFIG_OPTION_SUBPIXEL_HINTING=0 -o test test.c && ./test
default
% cc -DTT_CONFIG_OPTION_SUBPIXEL_HINTING=1 -o test test.c && ./test
default
infinality
% cc -DTT_CONFIG_OPTION_SUBPIXEL_HINTING=2 -o test test.c && ./test
default
minimal
% cc -DTT_CONFIG_OPTION_SUBPIXEL_HINTING=3 -o test test.c && ./test
default
infinality
minimal
% cc -DCHECK -Wundef -o test test.c && ./test
test.c:12:5: warning: 'TT_CONFIG_OPTION_SUBPIXEL_HINTING' is not defined,
evaluates to 0 [-Wundef]
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
    ^
test.c:16:5: warning: 'TT_CONFIG_OPTION_SUBPIXEL_HINTING' is not defined,
evaluates to 0 [-Wundef]
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
    ^
2 warnings generated.
default
-->8-

But in case of freetype2 source code, there is some check for defined
TT_CONFIG_OPTION_SUBPIXEL_HINTING:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/truetype/ttgload.c?h=VER-2-7-1#n1355
-8<--
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
    TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( loader->face );
#endif
-->8-

So, defining TT_CONFIG_OPTION_SUBPIXEL_HINTING to 0 may create different
result(s).

Moreover, the freetype2's developer(s) commented/undefined
TT_CONFIG_OPTION_SUBPIXEL_HINTING for 2.6.5 version:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/include/freetype/config/ftoption.h?h=VER-2-6-5#n633
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/include/freetype/config/ftoption.h?h=VER-2-6-5#n845
in preparation for 2.7.x series:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/CHANGES?h=VER-2-6-5#n10

This is why TT_CONFIG_OPTION_SUBPIXEL_HINTING was commented/undefined for
V38=off and V40=off case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the freebsd-gnome mailing list