ref: 0358b21d8595e0ce6d07947d5f4c6d8e19021992
parent: e99b9a99d7ff1025d6b8694c5be81c7871811a8e
author: Werner Lemberg <[email protected]>
date: Thu Feb 10 11:59:37 EST 2005
Formatting.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,13 @@
2005-02-10 David Turner <[email protected]>
- * src/pfr/pfrgload.c (pfr_glyph_load): fixed an unbounded growing
- dynamic array when loading a glyph from a PFR font. This fixes
- bug #11921
+ * src/pfr/pfrgload.c (pfr_glyph_load): Fix an unbounded growing
+ dynamic array when loading a glyph from a PFR font (Savannah bug
+ #11921).
- * src/base/ftbitmap.c (FT_Bitmap_Convert): small improvements to the
- conversion function (mainly stupid optimization, because I like
- these... shame on me)
+ * src/base/ftbitmap.c (FT_Bitmap_Convert): Small improvements to the
+ conversion function (mainly stupid optimization).
- * src/base/Jamfile: adding ftbitmap.c to the list of compiled files
+ * src/base/Jamfile: Adding ftbitmap.c to the list of compiled files.
2005-02-10 Werner Lemberg <[email protected]>
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -63,6 +63,7 @@
FT_Int pad;
FT_Long old_size;
+
old_size = target->rows * target->pitch;
if ( old_size < 0 )
old_size = -old_size;
@@ -81,7 +82,7 @@
target->pitch = source->width + pad;
- if ( target->rows * target->pitch > old_size &&
+ if ( target->rows * target->pitch > old_size &&
FT_QREALLOC( target->buffer,
old_size, target->rows * target->pitch ) )
return error;
@@ -100,6 +101,7 @@
FT_Byte* t = target->buffer;
FT_Int i;
+
target->num_grays = 2;
for ( i = source->rows; i > 0; i-- )
@@ -108,11 +110,13 @@
FT_Byte* tt = t;
FT_Int j;
+
/* get the full bytes */
for ( j = source->width >> 3; j > 0; j-- )
{
FT_Int val = ss[0]; /* avoid a byte->int cast on each line */
+
tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7 );
tt[1] = (FT_Byte)( ( val & 0x40 ) >> 6 );
tt[2] = (FT_Byte)( ( val & 0x20 ) >> 5 );
@@ -132,9 +136,10 @@
{
FT_Int val = *ss;
+
for ( ; j > 0; j-- )
{
- tt[0] = (FT_Byte)(( val & 0x80 ) >> 7);
+ tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7);
val <<= 1;
tt += 1;
}
@@ -156,6 +161,7 @@
FT_Int t_pitch = target->pitch;
FT_Int i;
+
target->num_grays = 256;
for ( i = source->rows; i > 0; i-- )
@@ -175,6 +181,7 @@
FT_Byte* t = target->buffer;
FT_Int i;
+
target->num_grays = 4;
for ( i = source->rows; i > 0; i-- )
@@ -183,16 +190,18 @@
FT_Byte* tt = t;
FT_Int j;
+
/* get the full bytes */
for ( j = source->width >> 2; j > 0; j-- )
{
FT_Int val = ss[0];
- tt[0] = (FT_Byte)( (val & 0xC0) >> 6 );
- tt[1] = (FT_Byte)( (val & 0x30) >> 4 );
- tt[2] = (FT_Byte)( (val & 0x0C) >> 2 );
- tt[3] = (FT_Byte)( (val & 0x03) );
+ tt[0] = (FT_Byte)( ( val & 0xC0 ) >> 6 );
+ tt[1] = (FT_Byte)( ( val & 0x30 ) >> 4 );
+ tt[2] = (FT_Byte)( ( val & 0x0C ) >> 2 );
+ tt[3] = (FT_Byte)( ( val & 0x03 ) );
+
ss += 1;
tt += 4;
}
@@ -202,6 +211,7 @@
{
FT_Int val = ss[0];
+
for ( ; j > 0; j-- )
{
tt[0] = (FT_Byte)( ( val & 0xC0 ) >> 6 );
@@ -223,6 +233,7 @@
FT_Byte* t = target->buffer;
FT_Int i;
+
target->num_grays = 16;
for ( i = source->rows; i > 0; i-- )
@@ -231,14 +242,16 @@
FT_Byte* tt = t;
FT_Int j;
+
/* get the full bytes */
for ( j = source->width >> 1; j > 0; j-- )
{
FT_Int val = ss[0];
- tt[0] = (FT_Byte)( (val & 0xF0) >> 4 );
- tt[1] = (FT_Byte)( (val & 0x0F) );
+ tt[0] = (FT_Byte)( ( val & 0xF0 ) >> 4 );
+ tt[1] = (FT_Byte)( ( val & 0x0F ) );
+
ss += 1;
tt += 2;
}
@@ -251,6 +264,7 @@
}
}
break;
+
default:
;