PATCH: better freetype enc fix

Marcus Meissner marcus at jet.franken.de
Sun Oct 26 05:00:51 CST 2003


On Sun, Oct 26, 2003 at 11:29:28AM +0100, Rein Klazes wrote:
> On Sun, 26 Oct 2003 10:58:05 +0100, you wrote:
> 
> > Hi,
> > 
> > This fix supercedes Rein Klazes fix, since MS_MAKE_TAG is used in other places.
> 
> Hmm thanks, I shoud have chacked that of course.
> 
> Actually I was expecting the question why not use the definition in
> freetype.h that comes with libfreetype? Or better use the
> ready-to-be-used tags FT_ENCODING_MS_SYMBOL, FT_ENCODING_UNICODE and
> FT_ENCODING_APPLE_ROMAN.
> Makes it easier to read with the libfreetype's documentation as well.

Because they changed during the freetype 2 release phase.

I have freetype2-2.0.9, which has:
    FT_ENC_TAG( ft_encoding_symbol,  's', 'y', 'm', 'b' ),

and with freetype2-2.1.4, which has:
    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL,  's', 'y', 'm', 'b' ),
hmm, and:
#define  ft_encoding_symbol          FT_ENCODING_MS_SYMBOL

Well, what about this patch instead:

Ciao, Marcus

Changelog:
	Use freetype 2.0 defines for font encodings instead of misuse of MS_MAKE_TAG.

Index: dlls/gdi/freetype.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/freetype.c,v
retrieving revision 1.40
diff -u -r1.40 freetype.c
--- dlls/gdi/freetype.c	15 Oct 2003 20:51:22 -0000	1.40
+++ dlls/gdi/freetype.c	26 Oct 2003 11:00:03 -0000
@@ -1249,16 +1249,16 @@
         free_font( ret );
         return 0;
     }
-	
+
     if (ret->charset == SYMBOL_CHARSET && 
-        !pFT_Select_Charmap(ret->ft_face, MS_MAKE_TAG('s','y','m','b'))) {
+        !pFT_Select_Charmap(ret->ft_face, ft_encoding_symbol)) {
         /* No ops */
     }
-    else if (!pFT_Select_Charmap(ret->ft_face, MS_MAKE_TAG('u','n','i','c'))) {
+    else if (!pFT_Select_Charmap(ret->ft_face, ft_encoding_unicode)) {
         /* No ops */
     }
     else {
-        pFT_Select_Charmap(ret->ft_face, MS_MAKE_TAG('a','r','m','n'));
+        pFT_Select_Charmap(ret->ft_face, ft_encoding_apple_roman);
     }
 
     ret->orientation = lf.lfOrientation;



More information about the wine-devel mailing list