summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <david@freetype.org>2001-06-08 13:29:36 +0000
committerDavid Turner <david@freetype.org>2001-06-08 13:29:36 +0000
commit1ad51db6b1923ad26aefe6434d79864472b167b3 (patch)
treedcc1b903190622a4535958ecec689c3d17341a20
parent6c01dd82ae914fac6b347b9ededae2ddc4f8bd22 (diff)
downloadfreetype2-1ad51db6b1923ad26aefe6434d79864472b167b3.tar.gz
fixed a bug that returned an invalid linear width for composite
TrueType glyphs fixed source code to work with the new error scheme implemented by Werner
-rw-r--r--ChangeLog7
-rw-r--r--include/freetype/fttypes.h4
-rw-r--r--include/freetype/internal/tttypes.h2
-rw-r--r--src/base/ftobjs.c4
-rw-r--r--src/base/ftoutln.c2
-rw-r--r--src/truetype/ttgload.c8
-rw-r--r--src/truetype/ttinterp.c2
7 files changed, 23 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 24bc1cc98..3109fe860 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,13 @@
corrupted transformed glyphs that were auto-hinted (the transform
was applied twice).
+ * include/internal/tttypes.h, src/truetype/ttgload.c: fixed a bug
+ that returned an invalid linear width for composite TrueType glyphs
+
+ * include/fttypes.h, src/base/ftobjs.c: fixed source code to work
+ with the new error scheme implemented by Werner
+
+
2001-06-07 Werner Lemberg <wl@gnu.org>
Updating to libtool 1.4.0 and autoconf 2.50.
diff --git a/include/freetype/fttypes.h b/include/freetype/fttypes.h
index 32de95f31..ece9e4ffd 100644
--- a/include/freetype/fttypes.h
+++ b/include/freetype/fttypes.h
@@ -77,7 +77,7 @@ FT_BEGIN_HEADER
/* */
/*************************************************************************/
-
+
/*************************************************************************/
/* */
/* <Type> */
@@ -509,6 +509,8 @@ FT_BEGIN_HEADER
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
+/* return base error code (without module-specific prefix) */
+#define FT_ERROR_BASE(x) ((x) & 255)
FT_END_HEADER
diff --git a/include/freetype/internal/tttypes.h b/include/freetype/internal/tttypes.h
index 095311a40..b2eed82ee 100644
--- a/include/freetype/internal/tttypes.h
+++ b/include/freetype/internal/tttypes.h
@@ -1570,6 +1570,8 @@ FT_BEGIN_HEADER
FT_BBox bbox;
FT_Int left_bearing;
FT_Int advance;
+ FT_Int linear;
+ FT_Bool linear_def;
FT_Bool preserve_pps;
FT_Vector pp1;
FT_Vector pp2;
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index c37d707d9..df11f1c4d 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1240,7 +1240,7 @@
if ( !error )
goto Success;
- if ( error != FT_Err_Unknown_File_Format )
+ if ( FT_ERROR_BASE(error) != FT_Err_Unknown_File_Format )
goto Fail2;
}
}
@@ -2115,7 +2115,7 @@
while ( renderer )
{
error = renderer->render( renderer, slot, render_mode, 0 );
- if ( !error || error != FT_Err_Cannot_Render_Glyph )
+ if ( !error || FT_ERROR_BASE(error) != FT_Err_Cannot_Render_Glyph )
break;
/* FT_Err_Cannot_Render_Glyph is returned if the render mode */
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index f8294c68d..42268caed 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -514,7 +514,7 @@
while ( renderer )
{
error = renderer->raster_render( renderer->raster, params );
- if ( !error || error != FT_Err_Cannot_Render_Glyph )
+ if ( !error || FT_ERROR_BASE(error) != FT_Err_Cannot_Render_Glyph )
break;
/* FT_Err_Cannot_Render_Glyph is returned if the render mode */
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 63bf703ec..560e98138 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -712,6 +712,12 @@
loader->left_bearing = left_bearing;
loader->advance = advance_width;
+
+ if ( !loader->linear_def )
+ {
+ loader->linear_def = 1;
+ loader->linear = advance_width;
+ }
}
offset = face->glyph_locations[index];
@@ -1154,7 +1160,7 @@
/* get the device-independent horizontal advance. It is scaled later */
/* by the base layer. */
{
- FT_Pos advance = loader->advance;
+ FT_Pos advance = loader->linear;
/* the flag FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH was introduced to */
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 1f5b6c79f..05440d5c3 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -7390,7 +7390,7 @@
#endif /* TT_CONFIG_OPTION_INTERPRETER_SWITCH */
- if ( CUR.error != TT_Err_Ok )
+ if ( CUR.error != FT_Err_Ok )
{
switch ( CUR.error )
{