Dmitry Timoshkov : gdi32: Use symbolic names for font tags.

Alexandre Julliard julliard at winehq.org
Thu Sep 20 10:30:09 CDT 2007


Module: wine
Branch: master
Commit: b0d1590defbadf570d4da1fd0461cb6fc1125c50
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b0d1590defbadf570d4da1fd0461cb6fc1125c50

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Thu Sep 20 19:10:31 2007 +0900

gdi32: Use symbolic names for font tags.

---

 configure             |    2 ++
 configure.ac          |    1 +
 dlls/gdi32/freetype.c |   15 ++++++++++++---
 include/config.h.in   |    3 +++
 4 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index ab97690..ed0651b 100755
--- a/configure
+++ b/configure
@@ -13054,9 +13054,11 @@ fi
 
 
 
+
 for ac_header in ft2build.h \
                          freetype/freetype.h \
                          freetype/ftglyph.h \
+                         freetype/fttypes.h \
                          freetype/tttables.h \
                          freetype/ftnames.h \
                          freetype/ftsnames.h \
diff --git a/configure.ac b/configure.ac
index 2c8c5da..b951604 100644
--- a/configure.ac
+++ b/configure.ac
@@ -872,6 +872,7 @@ then
 	AC_CHECK_HEADERS(ft2build.h \
                          freetype/freetype.h \
                          freetype/ftglyph.h \
+                         freetype/fttypes.h \
                          freetype/tttables.h \
                          freetype/ftnames.h \
                          freetype/ftsnames.h \
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index c556c3d..89f8b22 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -102,6 +102,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(font);
 #ifdef HAVE_FREETYPE_TTTABLES_H
 #include <freetype/tttables.h>
 #endif
+#ifdef HAVE_FREETYPE_FTTYPES_H
+#include <freetype/fttypes.h>
+#endif
 #ifdef HAVE_FREETYPE_FTSNAMES_H
 #include <freetype/ftsnames.h>
 #else
@@ -195,6 +198,12 @@ MAKE_FUNCPTR(FcPatternGetString);
 
 #undef MAKE_FUNCPTR
 
+#ifndef FT_MAKE_TAG
+#define FT_MAKE_TAG( ch0, ch1, ch2, ch3 ) \
+	( ((DWORD)(BYTE)(ch0) << 24) | ((DWORD)(BYTE)(ch1) << 16) | \
+	  ((DWORD)(BYTE)(ch2) << 8) | (DWORD)(BYTE)(ch3) )
+#endif
+
 #ifndef ft_encoding_none
 #define FT_ENCODING_NONE ft_encoding_none
 #endif
@@ -587,7 +596,7 @@ static char **expand_mac_font(const char *path)
         unsigned short *num_faces_ptr, num_faces, face;
         AsscEntry *assoc;
         Handle fond;
-        ResType fond_res = 0x464f4e44; /* 'FOND' */
+        ResType fond_res = FT_MAKE_TAG('F','O','N','D');
 
         fond = Get1IndResource(fond_res, idx);
         if(!fond) break;
@@ -603,7 +612,7 @@ static char **expand_mac_font(const char *path)
         for(face = 0; face < num_faces; face++, assoc++)
         {
             Handle sfnt;
-            ResType sfnt_res = 0x73666e74; /* 'sfnt' */
+            ResType sfnt_res = FT_MAKE_TAG('s','f','n','t');
             unsigned short size, font_id;
             char *output;
 
@@ -1195,7 +1204,7 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_
 
             /* check for the presence of the 'CFF ' table to check if the font is Type1 */
             tmp_size = 0;
-            if (pFT_Load_Sfnt_Table && !pFT_Load_Sfnt_Table(ft_face, 0x43464620, 0, NULL, &tmp_size))
+            if (pFT_Load_Sfnt_Table && !pFT_Load_Sfnt_Table(ft_face, FT_MAKE_TAG('C','F','F',' '), 0, NULL, &tmp_size))
             {
                 TRACE("Font %s/%p is OTF Type1\n", wine_dbgstr_a(file), font_data_ptr);
                 face->ntmFlags = NTM_PS_OPENTYPE;
diff --git a/include/config.h.in b/include/config.h.in
index 8692bb1..e21e513 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -126,6 +126,9 @@
 /* Define if you have the <freetype/fttrigon.h> header file. */
 #undef HAVE_FREETYPE_FTTRIGON_H
 
+/* Define to 1 if you have the <freetype/fttypes.h> header file. */
+#undef HAVE_FREETYPE_FTTYPES_H
+
 /* Define to 1 if you have the <freetype/ftwinfnt.h> header file. */
 #undef HAVE_FREETYPE_FTWINFNT_H
 




More information about the wine-cvs mailing list