]> git.saurik.com Git - wxWidgets.git/commitdiff
Use "monospace" face name for all Unix systems, hopefully it should work.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 18 Apr 2010 22:15:53 +0000 (22:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 18 Apr 2010 22:15:53 +0000 (22:15 +0000)
This fixes failures of several build bot slaves (all running Debian or
Ubuntu) which were due to using "Fixed" under these Linux distributions.

Unfortunately "Fixed" didn't work as Pango doesn't seem to recognize it as a
valid face name. "DejaVu Sans" should probably work on most current Linux
systems but "Monospace" should hopefully be available on other Unix systems as
well.

We could also just take whatever wxFontEnumerator returns which should
probably be even more fool-proof.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64041 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/font/fonttest.cpp

index 69df21a2f549a07ca914a4c4f2de13804669180d..1c436ddf2085c434967d98e5383692c20b9459b7 100644 (file)
@@ -97,7 +97,7 @@ void FontTestCase::GetSet()
 {
     unsigned numFonts;
     const wxFont *pf = GetTestFonts(numFonts);
-    for ( size_t n = 0; n < numFonts; n++ )
+    for ( unsigned n = 0; n < numFonts; n++ )
     {
         wxFont test(*pf++);
 
@@ -113,23 +113,17 @@ void FontTestCase::GetSet()
         // consider adding another branch to this #if
 #if defined(__WXMSW__) || defined(__WXOSX__)
         static const char *knownGoodFaceName = "Arial";
-#elif defined(__LINUX__)
-        static const char *knownGoodFaceName;
-        wxString distroname = wxGetLinuxDistributionInfo().Id;
-        
-        if (distroname.Contains("Ubuntu"))
-            knownGoodFaceName = "FreeSerif";
-                // ttf-freefont and ttf-dejavu packages are installed by default on [X,K]Ubuntu systems
-        else if (distroname == "Debian")
-            knownGoodFaceName = "Fixed";
-        else
-            knownGoodFaceName = "DejaVu Sans";
-                // this is very popular in many linux distro...
 #else
-        static const char *knownGoodFaceName = "Fixed";
+        static const char *knownGoodFaceName = "Monospace";
 #endif
 
-        CPPUNIT_ASSERT( test.SetFaceName(knownGoodFaceName) );
+        WX_ASSERT_MESSAGE
+        (
+            ("failed to set face name \"%s\" for test font #%u\n"
+             "(this failure is harmless if this face name is not "
+             "available on this system)", knownGoodFaceName, n),
+            test.SetFaceName(knownGoodFaceName)
+        );
         CPPUNIT_ASSERT( test.IsOk() );