| OLD | NEW |
| 1 /***************************************************************************/ | 1 /***************************************************************************/ |
| 2 /* */ | 2 /* */ |
| 3 /* ttsubpix.c */ | 3 /* ttsubpix.c */ |
| 4 /* */ | 4 /* */ |
| 5 /* TrueType Subpixel Hinting. */ | 5 /* TrueType Subpixel Hinting. */ |
| 6 /* */ | 6 /* */ |
| 7 /* Copyright 2010-2013 by */ | 7 /* Copyright 2010-2013 by */ |
| 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
| 9 /* */ | 9 /* */ |
| 10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
| 11 /* modified, and distributed under the terms of the FreeType project */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
| 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
| 13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
| 14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
| 15 /* */ | 15 /* */ |
| 16 /***************************************************************************/ | 16 /***************************************************************************/ |
| 17 | 17 |
| 18 #include "../../include/ft2build.h" | 18 #include <ft2build.h> |
| 19 #include "../../include/freetype/internal/ftdebug.h" | 19 #include FT_INTERNAL_DEBUG_H |
| 20 #include "../../include/freetype/internal/ftcalc.h" | 20 #include FT_INTERNAL_CALC_H |
| 21 #include "../../include/freetype/internal/ftstream.h" | 21 #include FT_INTERNAL_STREAM_H |
| 22 #include "../../include/freetype/internal/sfnt.h" | 22 #include FT_INTERNAL_SFNT_H |
| 23 #include "../../include/freetype/tttags.h" | 23 #include FT_TRUETYPE_TAGS_H |
| 24 #include "../../include/freetype/ftoutln.h" | 24 #include FT_OUTLINE_H |
| 25 #include "../../include/freetype/ftttdrv.h" | 25 #include FT_TRUETYPE_DRIVER_H |
| 26 | 26 |
| 27 #include "ttsubpix.h" | 27 #include "ttsubpix.h" |
| 28 | 28 |
| 29 | 29 |
| 30 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING | 30 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING |
| 31 | 31 |
| 32 /*************************************************************************/ | 32 /*************************************************************************/ |
| 33 /* */ | 33 /* */ |
| 34 /* These rules affect how the TT Interpreter does hinting, with the */ | 34 /* These rules affect how the TT Interpreter does hinting, with the */ |
| 35 /* goal of doing subpixel hinting by (in general) ignoring x moves. */ | 35 /* goal of doing subpixel hinting by (in general) ignoring x moves. */ |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 }, | 275 }, |
| 276 }; | 276 }; |
| 277 | 277 |
| 278 | 278 |
| 279 /* Force special legacy fixes for fonts. */ | 279 /* Force special legacy fixes for fonts. */ |
| 280 #define COMPATIBILITY_MODE_RULES_SIZE 1 | 280 #define COMPATIBILITY_MODE_RULES_SIZE 1 |
| 281 | 281 |
| 282 const SPH_TweakRule COMPATIBILITY_MODE_Rules | 282 const SPH_TweakRule COMPATIBILITY_MODE_Rules |
| 283 [COMPATIBILITY_MODE_RULES_SIZE] = | 283 [COMPATIBILITY_MODE_RULES_SIZE] = |
| 284 { | 284 { |
| 285 { "-", 0, "", 0 }, | 285 { "Verdana Clones", 0, "", 0 }, |
| 286 }; | 286 }; |
| 287 | 287 |
| 288 | 288 |
| 289 /* Don't do subpixel (ignore_x_mode) hinting; do normal hinting. */ | 289 /* Don't do subpixel (ignore_x_mode) hinting; do normal hinting. */ |
| 290 #define PIXEL_HINTING_RULES_SIZE 2 | 290 #define PIXEL_HINTING_RULES_SIZE 2 |
| 291 | 291 |
| 292 const SPH_TweakRule PIXEL_HINTING_Rules | 292 const SPH_TweakRule PIXEL_HINTING_Rules |
| 293 [PIXEL_HINTING_RULES_SIZE] = | 293 [PIXEL_HINTING_RULES_SIZE] = |
| 294 { | 294 { |
| 295 /* these characters are almost always safe */ | 295 /* these characters are almost always safe */ |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 TWEAK_RULES_EXCEPTIONS( SKIP_NONPIXEL_Y_MOVES ); | 949 TWEAK_RULES_EXCEPTIONS( SKIP_NONPIXEL_Y_MOVES ); |
| 950 | 950 |
| 951 TWEAK_RULES( ROUND_NONPIXEL_Y_MOVES ); | 951 TWEAK_RULES( ROUND_NONPIXEL_Y_MOVES ); |
| 952 TWEAK_RULES_EXCEPTIONS( ROUND_NONPIXEL_Y_MOVES ); | 952 TWEAK_RULES_EXCEPTIONS( ROUND_NONPIXEL_Y_MOVES ); |
| 953 | 953 |
| 954 if ( loader->exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 ) | 954 if ( loader->exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 ) |
| 955 { | 955 { |
| 956 if ( loader->exec->rasterizer_version != TT_INTERPRETER_VERSION_35 ) | 956 if ( loader->exec->rasterizer_version != TT_INTERPRETER_VERSION_35 ) |
| 957 { | 957 { |
| 958 loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35; | 958 loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35; |
| 959 loader->exec->size->cvt_ready = FALSE; | 959 loader->exec->size->cvt_ready = -1; |
| 960 | 960 |
| 961 tt_size_ready_bytecode( | 961 tt_size_ready_bytecode( |
| 962 loader->exec->size, | 962 loader->exec->size, |
| 963 FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) ); | 963 FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) ); |
| 964 } | 964 } |
| 965 else | 965 else |
| 966 loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35; | 966 loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35; |
| 967 } | 967 } |
| 968 else | 968 else |
| 969 { | 969 { |
| 970 if ( loader->exec->rasterizer_version != | 970 if ( loader->exec->rasterizer_version != |
| 971 SPH_OPTION_SET_RASTERIZER_VERSION ) | 971 SPH_OPTION_SET_RASTERIZER_VERSION ) |
| 972 { | 972 { |
| 973 loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION; | 973 loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION; |
| 974 loader->exec->size->cvt_ready = FALSE; | 974 loader->exec->size->cvt_ready = -1; |
| 975 | 975 |
| 976 tt_size_ready_bytecode( | 976 tt_size_ready_bytecode( |
| 977 loader->exec->size, | 977 loader->exec->size, |
| 978 FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) ); | 978 FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) ); |
| 979 } | 979 } |
| 980 else | 980 else |
| 981 loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION; | 981 loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION; |
| 982 } | 982 } |
| 983 | 983 |
| 984 if ( IS_HINTED( loader->load_flags ) ) | 984 if ( IS_HINTED( loader->load_flags ) ) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1002 | 1002 |
| 1003 #else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ | 1003 #else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ |
| 1004 | 1004 |
| 1005 /* ANSI C doesn't like empty source files */ | 1005 /* ANSI C doesn't like empty source files */ |
| 1006 typedef int _tt_subpix_dummy; | 1006 typedef int _tt_subpix_dummy; |
| 1007 | 1007 |
| 1008 #endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ | 1008 #endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ |
| 1009 | 1009 |
| 1010 | 1010 |
| 1011 /* END */ | 1011 /* END */ |
| OLD | NEW |