[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] A few tiny patches
From: |
Dirck Blaskey |
Subject: |
[ft-devel] A few tiny patches |
Date: |
Mon, 15 Aug 2011 13:42:19 -0700 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 |
Hi Werner & Co.
Here's a small set of patches I'd like to get in to the official tree.
#1 a broken glyph in a font file that Acrobat allows, but
freetype doesn't: allow for a trailing empty contour
diff -u base/ftoutln.c s:\l\cdoc\src\ftype/ftoutln.c
--- base/ftoutln.c Mon Jul 18 23:20:00 2011
+++ s:\l\cdoc\src\ftype/ftoutln.c Mon Aug 23 20:25:28 2010
@@ -366,7 +366,9 @@
end = outline->contours[n];
/* note that we don't accept empty contours */
- if ( end <= end0 || end >= n_points )
+ /* Acrobat allows this broken glyph, trailing empty contour */
+
+ if ( /*end <= end0 ||*/ end >= n_points )
goto Bad;
end0 = end;
#2 cff font with a funky matrix, running scaling logic where scaling == 0 is
bad news
diff -u cff/cffparse.c s:\l\cdoc\src\ftype/cffparse.c
--- cff/cffparse.c Mon Aug 15 20:20:34 2011
+++ s:\l\cdoc\src\ftype/cffparse.c Mon Aug 15 20:27:51 2011
@@ -470,7 +470,9 @@
scaling = -scaling;
- if ( scaling < 0 || scaling > 9 )
+ /* scaling == 0 is bad */
+
+ if ( scaling <= 0 || scaling > 9 )
{
/* Return default matrix in case of unlikely values. */
#3 The host software uses the incremental interface, and in one case
can stomp on itself due to convolutions in the font. Save & restore the stream:
diff -u truetype/ttgload.c s:\l\cdoc\src\ftype/ttgload.c
--- truetype/ttgload.c Mon Jul 18 23:20:00 2011
+++ s:\l\cdoc\src\ftype/ttgload.c Tue Jul 19 00:35:38 2011
@@ -1231,6 +1231,7 @@
FT_StreamRec inc_stream;
FT_Data glyph_data;
FT_Bool glyph_data_loaded = 0;
+ FT_Stream saved_stream = 0; /* save&restore */
#endif
@@ -1290,6 +1291,7 @@
FT_Stream_OpenMemory( &inc_stream,
glyph_data.pointer, glyph_data.length );
+ saved_stream = loader->stream; /* save&restore */
loader->stream = &inc_stream;
}
else
@@ -1610,6 +1612,9 @@
face->root.internal->incremental_interface->funcs->free_glyph_data(
face->root.internal->incremental_interface->object,
&glyph_data );
+
+ if ( face->root.internal->incremental_interface && saved_stream )
+ loader->stream = saved_stream; /* save&restore */
#endif
Let me know if you have any questions or need more info.
Thanks!
- [ft-devel] A few tiny patches,
Dirck Blaskey <=