* src/base/ftbitmap.c (FT_Bitmap_Embolden): Handle negative pitch. Handle FT_PIXEL_MODE_GRAY with num_gray != 256. Improve speed for FT_PIXEL_MODE_GRAY. (ft_bitmap_assure_buffer): Accept FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V.
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
diff --git a/ChangeLog b/ChangeLog
index a168039..8b1caeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-05-28 Chia I Wu <b90201047@ntu.edu.tw>
+
+ * src/base/ftbitmap.c (FT_Bitmap_Embolden): Handle negative pitch.
+ Handle FT_PIXEL_MODE_GRAY with num_gray != 256.
+ Improve speed for FT_PIXEL_MODE_GRAY.
+ (ft_bitmap_assure_buffer): Accept FT_PIXEL_MODE_LCD and
+ FT_PIXEL_MODE_LCD_V.
+
2005-05-27 Chia I Wu <b90201047@ntu.edu.tw>
* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Initialize `error'.
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index 9de9e8f..0306188 100644
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -115,6 +115,8 @@
switch ( bitmap->pixel_mode )
{
case FT_PIXEL_MODE_MONO:
+ case FT_PIXEL_MODE_LCD:
+ case FT_PIXEL_MODE_LCD_V:
ppb = 8;
break;
case FT_PIXEL_MODE_GRAY2:
@@ -210,7 +212,7 @@
else
{
pitch = -pitch;
- p = bitmap->buffer + pitch * ( bitmap->rows - ystr - 1 );
+ p = bitmap->buffer + pitch * ( bitmap->rows - 1 );
}
/* for each row */
@@ -237,16 +239,30 @@
/* the maximum value of 8 for `xstr' comes from here */
if ( x > 0 )
p[x] |= p[x - 1] << ( 8 - i );
+
+#if 0
+ if ( p[x] == 0xff )
+ break;
+#endif
}
else if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY )
{
if ( x - i >= 0 )
{
- if ( p[x] + p[x - i] > 0xff )
- p[x] = 0xff;
+ if ( p[x] + p[x - i] > bitmap->num_grays )
+ {
+ p[x] = bitmap->num_grays;
+ break;
+ }
else
+ {
p[x] += p[x - i];
+ if ( p[x] == bitmap->num_grays )
+ break;
+ }
}
+ else
+ break;
}
}
}