Enlightenment CVS committal Author : tilman Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common Modified Files: evas_font_load.c Log Message: fixed evas_common_hinting_available so it works properly with both freetype 2.1 and 2.2 =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_font_load.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- evas_font_load.c 6 Sep 2006 07:33:40 -0000 1.37 +++ evas_font_load.c 8 Oct 2006 13:00:26 -0000 1.38 @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #include "evas_common.h" #include "evas_private.h" @@ -379,23 +382,34 @@ EAPI Evas_Bool evas_common_hinting_available(Font_Hint_Flags hinting) { - if (hinting == FONT_NO_HINT) return 1; - else if (hinting == FONT_AUTO_HINT) + switch (hinting) { -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - return 1; -#else - return 1; -#endif - } - else if (hinting == FONT_BYTECODE_HINT) - { -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER - return 1; + case FONT_NO_HINT: + case FONT_AUTO_HINT: + /* these two hinting modes are always available */ + return 1; + case FONT_BYTECODE_HINT: + /* Only use the bytecode interpreter if support for the _patented_ + * algorithms is available because the free bytecode + * interpreter's results are too crappy. + * + * On freetyp 2.2+, we can ask the library about support for + * the patented interpreter. On older versions, we need to use + * macros to check for it. + */ +#if FREETYPE_MINOR >= 2 + return FT_Get_TrueType_Engine_Type(evas_ft_lib) >= + FT_TRUETYPE_ENGINE_TYPE_PATENTED; #else - return 1; +# ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER + return 1; +# else + return 0; +# endif #endif } + + /* shouldn't get here - need to add another case statement */ return 0; } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs