From 018380da0c7c8d1acbc1c465c295e70362664dbf Mon Sep 17 00:00:00 2001 From: Garux Date: Fri, 5 Jul 2019 19:22:46 +0300 Subject: [PATCH] try extra hardcoded font names to make gtkglext bitmap font to work on linux #24 --- libs/gtkutil/glfont.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/gtkutil/glfont.cpp b/libs/gtkutil/glfont.cpp index e5c9fb7d..7d9b86b2 100644 --- a/libs/gtkutil/glfont.cpp +++ b/libs/gtkutil/glfont.cpp @@ -701,6 +701,14 @@ GLFont *glfont_create( const char* font_string ){ g_object_get( settings, "gtk-font-name", &fontname, NULL ); font = tryFont( fontname, font_desc, font_list_base ); g_free( fontname ); + + if( !font ){ + const char* guessFonts[] = { "serif 8", "sans 8", "clean 8", "courier 8", "helvetica 8", "arial 8", "dejavu sans 8" }; + for( const auto str : guessFonts ){ + if( ( font = tryFont( str, font_desc, font_list_base ) ) ) + break; + } + } } while ( 0 ); PangoFontMap *fontmap = 0; @@ -731,6 +739,8 @@ GLFont *glfont_create( const char* font_string ){ pango_font_description_set_size( font_desc, fontsize ); pango_context_set_font_description( ft2_context, font_desc ); +// globalOutputStream() << pango_font_description_get_family( font_desc ) << " " << pango_font_description_get_size( font_desc ) << "\n"; + // g_object_unref( G_OBJECT( ft2_context ) ); // g_object_unref( G_OBJECT( fontmap ) );