aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/truetype
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-05 10:19:03 +0200
committermarha <marha@users.sourceforge.net>2011-09-05 10:19:03 +0200
commit9441c8f47bb24faebc885bfc3c5e37f47a3ad984 (patch)
tree276b55ded8f63c6bc5041785785ba927f168e077 /freetype/src/truetype
parentc7b24c70d1e2d558d512665ffa5479e64b36692d (diff)
parent6eaea4464631b5d8c1f44a46016163e351028afc (diff)
downloadvcxsrv-9441c8f47bb24faebc885bfc3c5e37f47a3ad984.tar.gz
vcxsrv-9441c8f47bb24faebc885bfc3c5e37f47a3ad984.tar.bz2
vcxsrv-9441c8f47bb24faebc885bfc3c5e37f47a3ad984.zip
Merge remote-tracking branch 'origin/released'
Conflicts: libXfont/configure.ac libXfont/doc/fontlib.xml libXfont/src/bitmap/bitscale.c libXfont/src/fontfile/decompress.c
Diffstat (limited to 'freetype/src/truetype')
-rw-r--r--freetype/src/truetype/ttdriver.c3
-rw-r--r--freetype/src/truetype/ttobjs.c75
2 files changed, 78 insertions, 0 deletions
diff --git a/freetype/src/truetype/ttdriver.c b/freetype/src/truetype/ttdriver.c
index e61f57fab..5866e872e 100644
--- a/freetype/src/truetype/ttdriver.c
+++ b/freetype/src/truetype/ttdriver.c
@@ -246,7 +246,10 @@
FT_Request_Metrics( size->face, req );
if ( FT_IS_SCALABLE( size->face ) )
+ {
error = tt_size_reset( ttsize );
+ ttsize->root.metrics = ttsize->metrics;
+ }
return error;
}
diff --git a/freetype/src/truetype/ttobjs.c b/freetype/src/truetype/ttobjs.c
index f24c774e2..0172cf1bc 100644
--- a/freetype/src/truetype/ttobjs.c
+++ b/freetype/src/truetype/ttobjs.c
@@ -409,6 +409,54 @@
}
+ /* Check whether `.notdef' is the only glyph in the `loca' table. */
+ static FT_Bool
+ tt_check_single_notdef( FT_Face ttface )
+ {
+ FT_Bool result = FALSE;
+
+ TT_Face face = (TT_Face)ttface;
+ FT_UInt asize;
+ FT_ULong i;
+ FT_ULong glyph_index = 0;
+ FT_UInt count = 0;
+
+
+ for( i = 0; i < face->num_locations; i++ )
+ {
+ tt_face_get_location( face, i, &asize );
+ if ( asize > 0 )
+ {
+ count += 1;
+ if ( count > 1 )
+ break;
+ glyph_index = i;
+ }
+ }
+
+ /* Only have a single outline. */
+ if ( count == 1 )
+ {
+ if ( glyph_index == 0 )
+ result = TRUE;
+ else
+ {
+ /* FIXME: Need to test glyphname == .notdef ? */
+ FT_Error error;
+ char buf[8];
+
+
+ error = FT_Get_Glyph_Name( ttface, glyph_index, buf, 8 );
+ if ( !error &&
+ buf[0] == '.' && !ft_strncmp( buf, ".notdef", 8 ) )
+ result = TRUE;
+ }
+ }
+
+ return result;
+ }
+
+
/*************************************************************************/
/* */
/* <Function> */
@@ -504,6 +552,20 @@
if ( !error )
error = tt_face_load_prep( face, stream );
+ /* Check the scalable flag based on `loca'. */
+ if ( !ttface->internal->incremental_interface &&
+ ttface->num_fixed_sizes &&
+ face->glyph_locations &&
+ tt_check_single_notdef( ttface ) )
+ {
+ FT_TRACE5(( "tt_face_init:"
+ " Only the `.notdef' glyph has an outline.\n"
+ " "
+ " Resetting scalable flag to FALSE.\n" ));
+
+ ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
+ }
+
#else
if ( !error )
@@ -515,6 +577,19 @@
if ( !error )
error = tt_face_load_prep( face, stream );
+ /* Check the scalable flag based on `loca'. */
+ if ( ttface->num_fixed_sizes &&
+ face->glyph_locations &&
+ tt_check_single_notdef( ttface ) )
+ {
+ FT_TRACE5(( "tt_face_init:"
+ " Only the `.notdef' glyph has an outline.\n"
+ " "
+ " Resetting scalable flag to FALSE.\n" ));
+
+ ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
+ }
+
#endif
}