From c436af69bb7297228de634800bb1e88053dc6ef7 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Sun, 13 Jan 2019 14:22:54 +0800 Subject: [PATCH] fixbug: No need to make the pitch of FT2 monobitmap is single-byte aligned --- src/font/freetype2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/font/freetype2.c b/src/font/freetype2.c index 3231b710..061f5094 100644 --- a/src/font/freetype2.c +++ b/src/font/freetype2.c @@ -451,6 +451,7 @@ get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont, return (int)(bbox.xMax - bbox.xMin); } +#if 0 // VincentWei: bad implementation /* press double-byte align to byte align.*/ static void press_bitmap (void* buffer, int width, int rows, int pitch) @@ -472,7 +473,7 @@ press_bitmap (void* buffer, int width, int rows, int pitch) dest_pos += dest_pitch; } } - +#endif /* call this function to get the bitmap/pixmap of the char */ static const void* @@ -547,11 +548,15 @@ char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont, if (pitch) *pitch = source->pitch; +#if 0 // VincentWei: bad implementation if (!is_grey) { press_bitmap(source->buffer, source->width, source->rows, source->pitch); *pitch = (source->width + 7) >> 3; } +#else + *pitch = (source->width + 7) >> 3; +#endif #ifdef _MGFONT_TTF_CACHE if (ft_inst_info->cache && (ft_inst_info->rotation == 0)) {