Hello,
http://bugs.winehq.org/show_bug.cgi?id=9840 has a ttf font attached
to it which can be perfectly displayed in Windows, but Wine is not able
to actually show any character using this font, only 'c' is displayed.
That's because Freetype selects first unicode cmap table which happens
to be with platform id 0 (Apple Unicode), and that cmap table is incomplete
(or truncated). cmap tables for other platforms (1 and 3) are good, and
making Freetype ignore cmap with platform id 0 makes the font display
properly in Wine's notepad.
Attached is the hack that makes Freetype ignore cmaps with platform id 0.
What Freetype developers think about this problem?
--
Dmitry.
diff -uprN freetype2/src/sfnt/ttcmap.c freetype2/src/sfnt/ttcmap.c
--- freetype2/src/sfnt/ttcmap.c 2007-06-13 17:05:55.000000000 +0900
+++ freetype2/src/sfnt/ttcmap.c 2007-09-30 20:45:39.000000000 +0900
@@ -2284,6 +2284,20 @@
charmap.encoding = FT_ENCODING_NONE; /* will be filled later */
offset = TT_NEXT_ULONG( p );
+ FT_TRACE2(( "found cmap platform_id %u, encoding_id %u\n",
+ charmap.platform_id, charmap.encoding_id ));
+
+ /* cmap tables with platform_id == Apple Unicode sometimes are
+ * incomplete in comparison to other tables.
+ * FIXME: perhaps fallback to this table if no other table exists.
+ */
+ if ( charmap.platform_id == 0 ) /* Apple Unicode */
+ {
+ FT_TRACE2(( "ignoring Apple Unicode encoding\n" ));
+ continue;
+ }
+
+
if ( offset && offset <= face->cmap_size - 2 )
{
FT_Byte* volatile cmap = table + offset;
_______________________________________________
Freetype-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype-devel