Formatting.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
diff --git a/ChangeLog b/ChangeLog
index ac8f8c0..360861b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,13 @@
2005-02-10 David Turner <david@freetype.org>
- * 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 <wl@gnu.org>
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index 1ad4556..9f8cbf7 100644
--- 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,15 +190,17 @@
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,13 +242,15 @@
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;
@@ -252,6 +265,7 @@
}
break;
+
default:
;
}