]> git.saurik.com Git - wxWidgets.git/commitdiff
don't use Pango hack for drawing underlined text when using new enough version of...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 9 Apr 2007 21:21:44 +0000 (21:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 9 Apr 2007 21:21:44 +0000 (21:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dcclient.cpp

index 81eaf12861632eff7962c65df9077928d88d29f6..c064590ae8f81b80eff016653b1969d595cb1f8b 100644 (file)
@@ -1472,11 +1472,16 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
         return;
     size_t datalen = strlen(data);
 
-    // TODO: as soon as Pango provides a function to check at runtime its
-    //       version, we can use it to disable the underline hack for
-    //       Pango >= 1.16 as the "underline of leading/trailing spaces"
-    //       has been fixed there
-    bool needshack = underlined;
+#ifdef PANGO_VERSION_MAJOR
+    // in Pango >= 1.16 the "underline of leading/trailing spaces" bug has been fixed...
+    static bool pangoOk = (pango_version_check(1, 16, 1) == NULL);
+#else
+    // the version of Pango used for compiling wxWidgets does not have version macros/functions...
+    // we are forced to assume that the run-time version of Pango is older than 1.16
+    const bool pangoOk = false;
+#endif
+
+    bool needshack = underlined && !pangoOk;
     char *hackstring = NULL;
 
     if (needshack)