shithub: freetype+ttf2subf

Download patch

ref: 300458eb949f71a486710b69bb6b704139765b26
parent: 65f9516bc7554c15d76ceb303ff110c84e61a55f
author: Alexei Podtelezhnikov <[email protected]>
date: Fri May 3 19:16:42 EDT 2019

Miscellaneous macro updates.

* src/base/ftoutln.c (SCALED): Updated.
* src/smooth/ftgrays.c (SCALED): Ditto.
(FLOOR, ROUND, CEILING): Removed.
* src/psaux/psfixed.h (cf2_fracToFixed): Updated.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-05-03  Alexei Podtelezhnikov  <[email protected]>
+
+	Miscellaneous macro updates.
+
+	* src/base/ftoutln.c (SCALED): Updated.
+	* src/smooth/ftgrays.c (SCALED): Ditto.
+	(FLOOR, ROUND, CEILING): Removed.
+	* src/psaux/psfixed.h (cf2_fracToFixed): Updated.
+
 2019-05-02  Alexei Podtelezhnikov  <[email protected]>
 
 	Tweak LCD filtering.
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -46,8 +46,7 @@
                         void*                    user )
   {
 #undef  SCALED
-#define SCALED( x )  ( ( (x) < 0 ? -( -(x) << shift )             \
-                                 :  (  (x) << shift ) ) - delta )
+#define SCALED( x )  ( (x) * ( 1L << shift ) - delta )
 
     FT_Vector   v_last;
     FT_Vector   v_control;
--- a/src/psaux/psfixed.h
+++ b/src/psaux/psfixed.h
@@ -72,8 +72,7 @@
 #define cf2_fixedFraction( x )                                           \
           ( (x) - cf2_fixedFloor( x ) )
 #define cf2_fracToFixed( x )                                             \
-          ( (x) < 0 ? -( ( -(x) + 0x2000 ) >> 14 )                       \
-                    :  ( (  (x) + 0x2000 ) >> 14 ) )
+          ( ( (x) + 0x2000 - ( (x) < 0 ) ) >> 14 )
 
 
   /* signed numeric types */
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -327,17 +327,9 @@
   /* must be at least 6 bits! */
 #define PIXEL_BITS  8
 
-#undef FLOOR
-#undef CEILING
-#undef TRUNC
-#undef SCALED
-
 #define ONE_PIXEL       ( 1 << PIXEL_BITS )
 #define TRUNC( x )      ( (TCoord)( (x) >> PIXEL_BITS ) )
 #define SUBPIXELS( x )  ( (TPos)(x) * ONE_PIXEL )
-#define FLOOR( x )      ( (x) & -ONE_PIXEL )
-#define CEILING( x )    ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL )
-#define ROUND( x )      ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL )
 
 #if PIXEL_BITS >= 6
 #define UPSCALE( x )    ( (x) * ( ONE_PIXEL >> 6 ) )
@@ -1337,7 +1329,7 @@
                         void*                    user )
   {
 #undef SCALED
-#define SCALED( x )  ( ( (x) << shift ) - delta )
+#define SCALED( x )  ( (x) * ( 1L << shift ) - delta )
 
     FT_Vector   v_last;
     FT_Vector   v_control;