|
|
4befcd |
--- a/src/smooth/ftsmooth.c
|
|
|
4befcd |
+++ b/src/smooth/ftsmooth.c
|
|
|
4befcd |
@@ -232,39 +232,13 @@
|
|
|
4befcd |
FT_UInt i, j;
|
|
|
4befcd |
|
|
|
4befcd |
unsigned int height = bitmap->rows;
|
|
|
4befcd |
- unsigned int width = bitmap->width;
|
|
|
4befcd |
+ unsigned int width = bitmap->width / 3;
|
|
|
4befcd |
int pitch = bitmap->pitch;
|
|
|
4befcd |
|
|
|
4befcd |
-
|
|
|
4befcd |
- /* Render 3 separate monochrome bitmaps, shifting the outline */
|
|
|
4befcd |
- /* by 1/3 pixel. */
|
|
|
4befcd |
- width /= 3;
|
|
|
4befcd |
-
|
|
|
4befcd |
- bitmap->buffer += width;
|
|
|
4befcd |
-
|
|
|
4befcd |
- error = render->raster_render( render->raster, ¶ms );
|
|
|
4befcd |
- if ( error )
|
|
|
4befcd |
- goto Exit;
|
|
|
4befcd |
-
|
|
|
4befcd |
- FT_Outline_Translate( outline, -21, 0 );
|
|
|
4befcd |
- x_shift -= 21;
|
|
|
4befcd |
- bitmap->buffer += width;
|
|
|
4befcd |
-
|
|
|
4befcd |
error = render->raster_render( render->raster, ¶ms );
|
|
|
4befcd |
if ( error )
|
|
|
4befcd |
goto Exit;
|
|
|
4befcd |
|
|
|
4befcd |
- FT_Outline_Translate( outline, 42, 0 );
|
|
|
4befcd |
- x_shift += 42;
|
|
|
4befcd |
- bitmap->buffer -= 2 * width;
|
|
|
4befcd |
-
|
|
|
4befcd |
- error = render->raster_render( render->raster, ¶ms );
|
|
|
4befcd |
- if ( error )
|
|
|
4befcd |
- goto Exit;
|
|
|
4befcd |
-
|
|
|
4befcd |
- /* XXX: Rearrange the bytes according to FT_PIXEL_MODE_LCD. */
|
|
|
4befcd |
- /* XXX: It is more efficient to render every third byte above. */
|
|
|
4befcd |
-
|
|
|
4befcd |
if ( FT_ALLOC( temp, (FT_ULong)pitch ) )
|
|
|
4befcd |
goto Exit;
|
|
|
4befcd |
|
|
|
4befcd |
@@ -272,11 +246,7 @@
|
|
|
4befcd |
{
|
|
|
4befcd |
line = bitmap->buffer + i * (FT_ULong)pitch;
|
|
|
4befcd |
for ( j = 0; j < width; j++ )
|
|
|
4befcd |
- {
|
|
|
4befcd |
- temp[3 * j ] = line[j];
|
|
|
4befcd |
- temp[3 * j + 1] = line[j + width];
|
|
|
4befcd |
- temp[3 * j + 2] = line[j + width + width];
|
|
|
4befcd |
- }
|
|
|
4befcd |
+ temp[3 * j] = temp[3 * j + 1] = temp[3 * j + 2] = line[j];
|
|
|
4befcd |
FT_MEM_COPY( line, temp, pitch );
|
|
|
4befcd |
}
|
|
|
4befcd |
|
|
|
4befcd |
@@ -284,35 +254,23 @@
|
|
|
4befcd |
}
|
|
|
4befcd |
else if ( vmul ) /* lcd_v */
|
|
|
4befcd |
{
|
|
|
4befcd |
- int pitch = bitmap->pitch;
|
|
|
4befcd |
-
|
|
|
4befcd |
+ FT_Byte* line;
|
|
|
4befcd |
+ FT_UInt i;
|
|
|
4befcd |
+ int original_pitch = bitmap->pitch;
|
|
|
4befcd |
|
|
|
4befcd |
- /* Render 3 separate monochrome bitmaps, shifting the outline */
|
|
|
4befcd |
- /* by 1/3 pixel. Triple the pitch to render on each third row. */
|
|
|
4befcd |
bitmap->pitch *= 3;
|
|
|
4befcd |
bitmap->rows /= 3;
|
|
|
4befcd |
|
|
|
4befcd |
- bitmap->buffer += pitch;
|
|
|
4befcd |
-
|
|
|
4befcd |
- error = render->raster_render( render->raster, ¶ms );
|
|
|
4befcd |
- if ( error )
|
|
|
4befcd |
- goto Exit;
|
|
|
4befcd |
-
|
|
|
4befcd |
- FT_Outline_Translate( outline, 0, 21 );
|
|
|
4befcd |
- y_shift += 21;
|
|
|
4befcd |
- bitmap->buffer += pitch;
|
|
|
4befcd |
-
|
|
|
4befcd |
error = render->raster_render( render->raster, ¶ms );
|
|
|
4befcd |
if ( error )
|
|
|
4befcd |
goto Exit;
|
|
|
4befcd |
|
|
|
4befcd |
- FT_Outline_Translate( outline, 0, -42 );
|
|
|
4befcd |
- y_shift -= 42;
|
|
|
4befcd |
- bitmap->buffer -= 2 * pitch;
|
|
|
4befcd |
-
|
|
|
4befcd |
- error = render->raster_render( render->raster, ¶ms );
|
|
|
4befcd |
- if ( error )
|
|
|
4befcd |
- goto Exit;
|
|
|
4befcd |
+ for ( i = 0; i < bitmap->rows; i++ )
|
|
|
4befcd |
+ {
|
|
|
4befcd |
+ line = bitmap->buffer + i * bitmap->pitch;
|
|
|
4befcd |
+ FT_MEM_COPY( line + original_pitch, line, bitmap->width );
|
|
|
4befcd |
+ FT_MEM_COPY( line + 2 * original_pitch, line, bitmap->width );
|
|
|
4befcd |
+ }
|
|
|
4befcd |
|
|
|
4befcd |
bitmap->pitch /= 3;
|
|
|
4befcd |
bitmap->rows *= 3;
|