summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <david@freetype.org>2001-05-08 12:58:07 +0000
committerDavid Turner <david@freetype.org>2001-05-08 12:58:07 +0000
commit24b0172c178fdbab317bd632a54040aa27a454e2 (patch)
treeedbbe3022c436a437720e88c05157231755f593b
parentf0fbf27a4f2a1973e1e66fb68e43f3242fefd24e (diff)
downloadfreetype2-24b0172c178fdbab317bd632a54040aa27a454e2.tar.gz
* src/pcfdriver.c: fixed incorrect bitmap width computation
* docs/docmaker.py: updated the DocMaker script in order to add command line options (--output,--prefix,--title), fix the erroneous line numbers reported during errors and warnings, and other formatting issues.. * src/base/ftcalc.c: various tiny fixes related to rounding in 64-bits routines and pseudo"optimisations" :-)
-rw-r--r--ChangeLog14
-rw-r--r--include/freetype/config/ftoption.h2
-rw-r--r--src/base/ftcalc.c26
-rw-r--r--src/pcf/pcfdriver.c2
4 files changed, 30 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 50935725d..b1b7b4cab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2001-05-08 Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>
+
+ * src/pcfdriver.c: fixed incorrect bitmap width computation
+
+2001-05-08 David Turner <david@freetype.org>
+
+ * docs/docmaker.py: updated the DocMaker script in order to add
+ command line options (--output,--prefix,--title), fix the erroneous
+ line numbers reported during errors and warnings, and other formatting
+ issues..
+
+ * src/base/ftcalc.c: various tiny fixes related to rounding in 64-bits
+ routines and pseudo"optimisations" :-)
+
2001-04-27 David Turner <david@freetype.org>
* src/base/ftbbox.c (BBox_Cubic_Check): Fixed the coefficient
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 4736a36ac..f5f733740 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -154,7 +154,7 @@ FT_BEGIN_HEADER
/* file "ftconfig.h" either statically, or through Autoconf */
/* on platforms that support it. */
/* */
-#undef FT_CONFIG_OPTION_FORCE_INT64
+#define FT_CONFIG_OPTION_FORCE_INT64
/*************************************************************************/
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 2399a1145..eb0271911 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -135,16 +135,18 @@
FT_Long b,
FT_Long c )
{
- FT_Int s;
-
+ FT_Int s;
+ FT_Long d;
s = 1;
- if ( a < 0 ) { a = -a; s = -s; }
+ if ( a < 0 ) { a = -a; s = -1; }
if ( b < 0 ) { b = -b; s = -s; }
if ( c < 0 ) { c = -c; s = -s; }
- return s * ( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
- : 0x7FFFFFFFL );
+ d = ( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
+ : 0x7FFFFFFFL );
+
+ return ( s > 0 ) ? d : -d;
}
@@ -153,14 +155,14 @@
FT_EXPORT_DEF( FT_Long ) FT_MulFix( FT_Long a,
FT_Long b )
{
- FT_Int s;
+ FT_Int s = 1;
+ FT_Long c;
-
- s = 1;
- if ( a < 0 ) { a = -a; s = -s; }
+ if ( a < 0 ) { a = -a; s = -1; }
if ( b < 0 ) { b = -b; s = -s; }
- return s * (FT_Long)( ( (FT_Int64)a * b + 0x8000 ) >> 16 );
+ c = (FT_Long)( ( (FT_Int64)a * b + 0x8000 ) >> 16 );
+ return ( s > 0 ) ? c : -c ;
}
@@ -181,9 +183,9 @@
q = 0x7FFFFFFFL;
else
/* compute result directly */
- q = ( (FT_Int64)a << 16 ) / b;
+ q = ( ((FT_Int64)a + (b >> 1)) << 16 ) / b;
- return (FT_Int32)( s < 0 ? -q : q );
+ return (FT_Long)( s < 0 ? -q : q );
}
diff --git a/src/pcf/pcfdriver.c b/src/pcf/pcfdriver.c
index 18d4fffbe..bdcb7a749 100644
--- a/src/pcf/pcfdriver.c
+++ b/src/pcf/pcfdriver.c
@@ -158,7 +158,7 @@ THE SOFTWARE.
metric = face->metrics + glyph_index;
bitmap->rows = metric->ascent + metric->descent;
- bitmap->width = metric->characterWidth;
+ bitmap->width = metric->rightSideBearing - metric->leftSideBearing;
bitmap->num_grays = 1;
bitmap->pixel_mode = ft_pixel_mode_mono;