Fix Savannah bug #15553.

* src/truetype/ttgload.c (tt_loader_init): Re-execute the CVT
program after a change from mono to grayscaling (and vice versa).
Use correct constant for comparison to get `exec->grayscale'.
This commit is contained in:
Werner Lemberg 2006-11-22 10:36:55 +00:00
parent 2bad8ffbdf
commit 91959bf24c
2 changed files with 26 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2006-11-22 Werner Lemberg <wl@gnu.org>
Fix Savannah bug #15553.
* src/truetype/ttgload.c (tt_loader_init): Re-execute the CVT
program after a change from mono to grayscaling (and vice versa).
Use correct constant for comparison to get `exec->grayscale'.
2006-11-18 Werner Lemberg <wl@gnu.org>
Because FT_Load_Glyph expects CID values for CID-keyed fonts, the

View File

@ -1720,6 +1720,7 @@
/* load execution context */
{
TT_ExecContext exec;
FT_Bool grayscale;
/* query new execution context */
@ -1728,8 +1729,25 @@
if ( !exec )
return TT_Err_Could_Not_Find_Context;
grayscale =
FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != FT_RENDER_MODE_MONO );
TT_Load_Context( exec, face, size );
/* a change from mono to grayscale rendering (and vice versa) */
/* requires a re-execution of the CVT program */
if ( grayscale != exec->grayscale )
{
FT_UInt i;
exec->grayscale = grayscale;
for ( i = 0; i < size->cvt_size; i++ )
size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );
tt_size_run_prep( size );
}
/* see if the cvt program has disabled hinting */
if ( exec->GS.instruct_control & 1 )
load_flags |= FT_LOAD_NO_HINTING;
@ -1739,9 +1757,6 @@
exec->GS = tt_default_graphics_state;
exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
exec->grayscale =
FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != FT_LOAD_TARGET_MONO );
loader->exec = exec;
loader->instructions = exec->glyphIns;
}