diff options
author | Werner Lemberg <wl@gnu.org> | 2013-01-28 13:56:23 +0100 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2013-01-28 13:56:23 +0100 |
commit | 6b9034f0fdfcd84e62e7c0d29bfd458325f4ccd7 (patch) | |
tree | 506d9e550fc99d660982a3347b66ec7b0d1a8619 /src/truetype | |
parent | ab02d9e8e76030eec774ce058f005864e14b34ea (diff) | |
download | freetype2-6b9034f0fdfcd84e62e7c0d29bfd458325f4ccd7.tar.gz |
Formatting, comment improvements.
Diffstat (limited to 'src/truetype')
-rw-r--r-- | src/truetype/ttgload.c | 1 | ||||
-rw-r--r-- | src/truetype/ttinterp.c | 69 | ||||
-rw-r--r-- | src/truetype/ttinterp.h | 12 | ||||
-rw-r--r-- | src/truetype/ttobjs.h | 16 | ||||
-rw-r--r-- | src/truetype/ttsubpix.c | 27 | ||||
-rw-r--r-- | src/truetype/ttsubpix.h | 16 |
6 files changed, 73 insertions, 68 deletions
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index ba5e533a8..e8f6258cf 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -1943,7 +1943,6 @@ if ( subpixel_hinting ) grayscale = grayscale_hinting = FALSE; - else if ( SPH_OPTION_SET_GRAYSCALE ) { grayscale = grayscale_hinting = TRUE; diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c index c687144c8..d1fd80584 100644 --- a/src/truetype/ttinterp.c +++ b/src/truetype/ttinterp.c @@ -3182,6 +3182,7 @@ args[0] = CUR.storage[I]; \ } \ } + #else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ #define DO_RS \ @@ -4581,11 +4582,11 @@ return; } - rec->range = CUR.curRange; - rec->opc = (FT_UInt16)n; - rec->start = CUR.IP + 1; - rec->active = TRUE; - rec->inline_delta = FALSE; + rec->range = CUR.curRange; + rec->opc = (FT_UInt16)n; + rec->start = CUR.IP + 1; + rec->active = TRUE; + rec->inline_delta = FALSE; rec->sph_fdef_flags = 0x0000; if ( n > CUR.maxFunc ) @@ -4614,8 +4615,8 @@ if ( opcode_pointer[i] == opcode_size[i] ) { - - FT_TRACE7(( "sph: Function %d, opcode ptrn: %d, %s %s\n", i, n, + FT_TRACE7(( "sph: Function %d, opcode ptrn: %d, %s %s\n", + i, n, CUR.face->root.family_name, CUR.face->root.style_name )); @@ -4683,7 +4684,6 @@ CUR.face->sph_found_func_flags |= SPH_FDEF_SPACING_2; } break; - } opcode_pointer[i] = 0; } @@ -4694,10 +4694,9 @@ } /* Set sph_compatibility_mode only when deltas are detected */ - CUR.face->sph_compatibility_mode = ( ( CUR.face->sph_found_func_flags & - SPH_FDEF_INLINE_DELTA_1 ) | - ( CUR.face->sph_found_func_flags & - SPH_FDEF_INLINE_DELTA_2 ) ); + CUR.face->sph_compatibility_mode = + ( ( CUR.face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_1 ) | + ( CUR.face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ); #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ @@ -6035,7 +6034,8 @@ ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_INLINE_DELTAS ) ) goto Skip; - if ( !CUR.face->sph_compatibility_mode && CUR.GS.freeVector.y != 0 ) + if ( !CUR.face->sph_compatibility_mode && + CUR.GS.freeVector.y != 0 ) MOVE_Zp2_Point( point, dx, dy, TRUE ); else if ( CUR.face->sph_compatibility_mode ) @@ -6069,7 +6069,7 @@ CUR.GS.freeVector.y != 0 && ( B1 & 63 ) == 0 && ( B2 & 63 ) != 0 && - B1 != B2 ) ) + B1 != B2 ) ) MOVE_Zp2_Point( point, -dx, -dy, TRUE ); } else @@ -6260,8 +6260,8 @@ if ( CUR.GS.gep0 == 0 ) /* If in twilight zone */ { #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING - /* Only adjust when not in sph_compatibility_mode or ignore_x_mode */ - /* Determined via experimentation and may be incorrect */ + /* Only adjust if not in sph_compatibility_mode or ignore_x_mode. */ + /* Determined via experimentation and may be incorrect... */ if ( !CUR.ignore_x_mode || !CUR.face->sph_compatibility_mode ) #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ CUR.zp0.org[point].x = TT_MulFix14( (FT_UInt32)distance, @@ -6643,7 +6643,7 @@ ( B1 & 63 ) != 0 ) reverse_move = TRUE; - if ( ( CUR.sph_tweak_flags & + if ( ( CUR.sph_tweak_flags & SPH_TWEAK_DELTAP_SKIP_EXAGGERATED_VALUES ) && !reverse_move && FT_ABS( B1 - B2 ) >= 64 ) @@ -7371,15 +7371,15 @@ else B1 = CUR.zp0.cur[A].x; #if 0 - /* Standard Subpixel Hinting: Allow y move */ - /* This messes up dejavu and may not be needed */ + /* Standard Subpixel Hinting: Allow y move. */ + /* This messes up dejavu and may not be needed... */ if ( !CUR.face->sph_compatibility_mode && CUR.GS.freeVector.y != 0 ) CUR_Func_move( &CUR.zp0, A, B ); else #endif - /* Compatibility Mode: Allow x or y move if point touched in - Y direction */ + /* Compatibility Mode: Allow x or y move if point touched in */ + /* Y direction. */ if ( CUR.face->sph_compatibility_mode && !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) ) { @@ -7389,10 +7389,8 @@ if ( ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) ) B = FT_PIX_ROUND( B1 + B ) - B1; - /* - * Allow delta move if using sph_compatibility_mode, IUP has not - * been called, and point is touched on Y. - */ + /* Allow delta move if using sph_compatibility_mode, */ + /* IUP has not been called, and point is touched on Y. */ if ( !CUR.iup_called && ( CUR.zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) ) CUR_Func_move( &CUR.zp0, A, B ); @@ -7401,14 +7399,14 @@ B2 = CUR.zp0.cur[A].y; /* Reverse this move if it results in a disallowed move */ - if ( CUR.GS.freeVector.y != 0 && - ( ( CUR.face->sph_compatibility_mode && - ( B1 & 63 ) == 0 && - ( B2 & 63 ) != 0 ) || - ( ( CUR.sph_tweak_flags & - SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) && - ( B1 & 63 ) != 0 && - ( B2 & 63 ) != 0 ) ) ) + if ( CUR.GS.freeVector.y != 0 && + ( ( CUR.face->sph_compatibility_mode && + ( B1 & 63 ) == 0 && + ( B2 & 63 ) != 0 ) || + ( ( CUR.sph_tweak_flags & + SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) && + ( B1 & 63 ) != 0 && + ( B2 & 63 ) != 0 ) ) ) CUR_Func_move( &CUR.zp0, A, -B ); } #else @@ -7552,7 +7550,8 @@ if ( ( args[0] & 1 ) != 0 && CUR.ignore_x_mode ) { K = CUR.rasterizer_version; - FT_TRACE7(( "Setting rasterizer version %d\n", CUR.rasterizer_version )); + FT_TRACE7(( "Setting rasterizer version %d\n", + CUR.rasterizer_version )); } else #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ @@ -8024,7 +8023,7 @@ #endif #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING - CUR.iup_called = FALSE; + CUR.iup_called = FALSE; #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ /* set CVT functions */ diff --git a/src/truetype/ttinterp.h b/src/truetype/ttinterp.h index 84602105a..69f5011ed 100644 --- a/src/truetype/ttinterp.h +++ b/src/truetype/ttinterp.h @@ -278,15 +278,15 @@ FT_BEGIN_HEADER FT_Bool subpixel_positioned; /* subpixel positioned */ /* (DirectWrite ClearType)? */ - FT_Int rasterizer_version; /* MS rasterizer version */ + FT_Int rasterizer_version; /* MS rasterizer version */ - FT_Bool iup_called; /* IUP called for glyph? */ + FT_Bool iup_called; /* IUP called for glyph? */ - FT_ULong sph_tweak_flags; /* flags to control */ - /* hint tweaks */ + FT_ULong sph_tweak_flags; /* flags to control */ + /* hint tweaks */ - FT_ULong sph_in_func_flags; /* flags to indicate if in */ - /* special functions */ + FT_ULong sph_in_func_flags; /* flags to indicate if in */ + /* special functions */ #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h index 98a69aa70..030a552d2 100644 --- a/src/truetype/ttobjs.h +++ b/src/truetype/ttobjs.h @@ -4,7 +4,7 @@ /* */ /* Objects manager (specification). */ /* */ -/* Copyright 1996-2009, 2011-2012 by */ +/* Copyright 1996-2009, 2011-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -173,13 +173,13 @@ FT_BEGIN_HEADER /* */ typedef struct TT_DefRecord_ { - FT_Int range; /* in which code range is it located? */ - FT_Long start; /* where does it start? */ - FT_Long end; /* where does it end? */ - FT_UInt opc; /* function #, or instruction code */ - FT_Bool active; /* is it active? */ - FT_Bool inline_delta; /* is function that defines inline delta? */ - FT_ULong sph_fdef_flags; /* flags to identify special functions */ + FT_Int range; /* in which code range is it located? */ + FT_Long start; /* where does it start? */ + FT_Long end; /* where does it end? */ + FT_UInt opc; /* function #, or instruction code */ + FT_Bool active; /* is it active? */ + FT_Bool inline_delta; /* is function that defines inline delta? */ + FT_ULong sph_fdef_flags; /* flags to identify special functions */ } TT_DefRecord, *TT_DefArray; diff --git a/src/truetype/ttsubpix.c b/src/truetype/ttsubpix.c index 6d88ef03d..53d3ed55e 100644 --- a/src/truetype/ttsubpix.c +++ b/src/truetype/ttsubpix.c @@ -275,7 +275,7 @@ }; - /* Force special legacy fixes for fonts; */ + /* Force special legacy fixes for fonts. */ #define COMPATIBILITY_MODE_RULES_SIZE 1 const SPH_TweakRule COMPATIBILITY_MODE_Rules @@ -1030,22 +1030,29 @@ if ( loader->exec->rasterizer_version != 35 ) { loader->exec->rasterizer_version = 35; - loader->exec->size->cvt_ready = FALSE; - tt_size_ready_bytecode( loader->exec->size, - FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) ); + loader->exec->size->cvt_ready = FALSE; + + tt_size_ready_bytecode( + loader->exec->size, + FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) ); } - else loader->exec->rasterizer_version = 35; + else + loader->exec->rasterizer_version = 35; } else { - if ( loader->exec->rasterizer_version != SPH_OPTION_SET_RASTERIZER_VERSION ) + if ( loader->exec->rasterizer_version != + SPH_OPTION_SET_RASTERIZER_VERSION ) { loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION; - loader->exec->size->cvt_ready = FALSE; - tt_size_ready_bytecode( loader->exec->size, - FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) ); + loader->exec->size->cvt_ready = FALSE; + + tt_size_ready_bytecode( + loader->exec->size, + FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) ); } - else loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION; + else + loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION; } if ( IS_HINTED( loader->load_flags ) ) diff --git a/src/truetype/ttsubpix.h b/src/truetype/ttsubpix.h index ba39916a2..5e5d8e69e 100644 --- a/src/truetype/ttsubpix.h +++ b/src/truetype/ttsubpix.h @@ -34,14 +34,14 @@ FT_BEGIN_HEADER /* ID flags to identify special functions at FDEF and runtime. */ /* */ /* */ -#define SPH_FDEF_INLINE_DELTA_1 0x0000001 -#define SPH_FDEF_INLINE_DELTA_2 0x0000002 -#define SPH_FDEF_DIAGONAL_STROKE 0x0000004 -#define SPH_FDEF_VACUFORM_ROUND_1 0x0000008 -#define SPH_FDEF_TTFAUTOHINT_1 0x0000010 -#define SPH_FDEF_SPACING_1 0x0000020 -#define SPH_FDEF_SPACING_2 0x0000040 -#define SPH_FDEF_TYPEMAN_STROKES 0x0000080 +#define SPH_FDEF_INLINE_DELTA_1 0x0000001 +#define SPH_FDEF_INLINE_DELTA_2 0x0000002 +#define SPH_FDEF_DIAGONAL_STROKE 0x0000004 +#define SPH_FDEF_VACUFORM_ROUND_1 0x0000008 +#define SPH_FDEF_TTFAUTOHINT_1 0x0000010 +#define SPH_FDEF_SPACING_1 0x0000020 +#define SPH_FDEF_SPACING_2 0x0000040 +#define SPH_FDEF_TYPEMAN_STROKES 0x0000080 /*************************************************************************/ |