Another symbol font fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

There are a couple of non-MS TT fonts on my system that only display
rectangles in win98's charmap.exe. Wine recognize these to have a SYMBOL
character set but Windows (win2k) does not. So libfreetype returning a
character mapping ft_encoding_symbol is not enough, I propose testing
the 0xf000 character offset that is assumed in other parts of the code.

Tested to work for libfreetype 2.0.9 and 2.1.5

Changelog:
	dlls/gdi	: freetype.c
	Don't include a SYMBOL_CHARSET character set unless there is a
	0xf000 character mapping offset.

Rein.  
-- 
Rein Klazes
rklazes@xs4all.nl
--- wine/dlls/gdi/freetype.c	2003-10-28 01:08:28.000000000 +0100
+++ mywine/dlls/gdi/freetype.c	2003-10-29 20:16:26.000000000 +0100
@@ -93,6 +93,7 @@
 MAKE_FUNCPTR(FT_Vector_Unit);
 MAKE_FUNCPTR(FT_Done_Face);
 MAKE_FUNCPTR(FT_Get_Char_Index);
+MAKE_FUNCPTR(FT_Get_First_Char);
 MAKE_FUNCPTR(FT_Get_Sfnt_Table);
 MAKE_FUNCPTR(FT_Init_FreeType);
 MAKE_FUNCPTR(FT_Load_Glyph);
@@ -103,6 +104,7 @@
 MAKE_FUNCPTR(FT_Outline_Transform);
 MAKE_FUNCPTR(FT_Outline_Translate);
 MAKE_FUNCPTR(FT_Select_Charmap);
+MAKE_FUNCPTR(FT_Set_Charmap);
 MAKE_FUNCPTR(FT_Set_Pixel_Sizes);
 MAKE_FUNCPTR(FT_Vector_Transform);
 #undef MAKE_FUNCPTR
@@ -383,8 +385,17 @@
 		case ft_encoding_apple_roman:
 			(*insertface)->fs.fsCsb[0] |= 1;
 		    break;
-		case ft_encoding_symbol:
-		    (*insertface)->fs.fsCsb[0] |= 1L << 31;
+		case ft_encoding_symbol: {
+                    UINT dummy;
+                    /* only the fonts that have a character range in the 0xf000
+                     * segment are recognised in windows with SYMBOL_CHARSET */
+                    if(!pFT_Set_Charmap( ft_face, ft_face->charmaps[i]) &&
+                            (pFT_Get_First_Char( ft_face, &dummy) & 0xf000))
+                        (*insertface)->fs.fsCsb[0] |= 1L << 31;
+                    else
+                        WARN("MS_SYMBOL encoding of %s ignored: not the required character offset.\n",
+                                debugstr_a(ft_face->family_name));
+                    }
 		    break;
 		default:
 		    break;
@@ -686,6 +697,7 @@
     LOAD_FUNCPTR(FT_Vector_Unit)
     LOAD_FUNCPTR(FT_Done_Face)
     LOAD_FUNCPTR(FT_Get_Char_Index)
+    LOAD_FUNCPTR(FT_Get_First_Char)
     LOAD_FUNCPTR(FT_Get_Sfnt_Table)
     LOAD_FUNCPTR(FT_Init_FreeType)
     LOAD_FUNCPTR(FT_Load_Glyph)
@@ -696,6 +708,7 @@
     LOAD_FUNCPTR(FT_Outline_Transform)
     LOAD_FUNCPTR(FT_Outline_Translate)
     LOAD_FUNCPTR(FT_Select_Charmap)
+    LOAD_FUNCPTR(FT_Set_Charmap)
     LOAD_FUNCPTR(FT_Set_Pixel_Sizes)
     LOAD_FUNCPTR(FT_Vector_Transform)
 

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux