shithub: freetype+ttf2subf

Download patch

ref: 9154dab8155e7bb5865dd5041fc4ef7fc5450c98
parent: 644d6fab7e0d1878e6453d7091cfdabba7a8197f
author: Werner Lemberg <[email protected]>
date: Fri Nov 21 03:03:51 EST 2014

[ftlcdfil] Obey flow direction.

* src/base/ftlcdfil.c (_ft_lcd_filter_fir, _ft_lcd_filter_legacy):
Handle `up' flow.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2014-11-21  Werner Lemberg  <[email protected]>
 
+	[ftlcdfil] Obey flow direction.
+
+	* src/base/ftlcdfil.c (_ft_lcd_filter_fir, _ft_lcd_filter_legacy):
+	Handle `up' flow.
+
+2014-11-21  Werner Lemberg  <[email protected]>
+
 	* src/base/ftbitmap.c (FT_Bitmap_Convert): Improve.
 
 	This commit completes argument checks and adds support for different
--- a/src/base/ftlcdfil.c
+++ b/src/base/ftlcdfil.c
@@ -46,6 +46,10 @@
       FT_Byte*  line = bitmap->buffer;
 
 
+      /* take care of bitmap flow */
+      if ( bitmap->pitch < 0 )
+        line -= bitmap->pitch * ( bitmap->rows - 1 );
+
       /* `fir' and `pix' must be at least 32 bit wide, since the sum of */
       /* the values in `weights' can exceed 0xFF                        */
 
@@ -106,6 +110,10 @@
       FT_Int    pitch  = bitmap->pitch;
 
 
+      /* take care of bitmap flow */
+      if ( bitmap->pitch < 0 )
+        column -= bitmap->pitch * ( bitmap->rows - 1 );
+
       for ( ; width > 0; width--, column++ )
       {
         FT_Byte*  col = column;
@@ -190,6 +198,10 @@
       FT_Byte*  line = bitmap->buffer;
 
 
+      /* take care of bitmap flow */
+      if ( bitmap->pitch < 0 )
+        line -= bitmap->pitch * ( bitmap->rows - 1 );
+
       for ( ; height > 0; height--, line += pitch )
       {
         FT_UInt  xx;
@@ -228,6 +240,10 @@
     {
       FT_Byte*  column = bitmap->buffer;
 
+
+      /* take care of bitmap flow */
+      if ( bitmap->pitch < 0 )
+        column -= bitmap->pitch * ( bitmap->rows - 1 );
 
       for ( ; width > 0; width--, column++ )
       {