X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcwindowbase.C;fp=cinelerra-5.1%2Fguicast%2Fbcwindowbase.C;h=e979d5cae48965178314a54fde0f5d3d9f58cfaf;hp=0d9f95d4eede1a54100c45376e4b53a00fae282f;hb=0e6cf5b52d1ebce9272270144bcf43df4683507e;hpb=f068b73c1d4afafbf6d86e7f5bc8f1c96b5366d3 diff --git a/cinelerra-5.1/guicast/bcwindowbase.C b/cinelerra-5.1/guicast/bcwindowbase.C index 0d9f95d4..e979d5ca 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.C +++ b/cinelerra-5.1/guicast/bcwindowbase.C @@ -624,7 +624,7 @@ int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title } if(!hidden) show_window(); - + init_glyphs(); } draw_background(0, 0, this->w, this->h); @@ -2427,6 +2427,30 @@ xft_init_lock.unlock(); #endif // HAVE_XFT } +void BC_WindowBase::init_glyphs() +{ +// draw all ascii char glyphs +// There are problems with some/my graphics boards/drivers +// which cause some glyphs to be munged if draws occur while +// the font is being loaded. This code fills the font caches +// by drawing all the ascii glyphs before the system starts. +// Not a fix, but much better than nothing. + static int inited = 0; + if( inited ) return; + inited = 1; + int cur_font = current_font; +// locale encodings, needed glyphs to be preloaded + const char *text = _( // ascii 0x20...0x7e + " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~"); + for( int font=SMALLFONT; font<=LARGEFONT; ++font ) { + set_font(font); + draw_text(5,5, text, 0); + } + set_font(cur_font); +} + void BC_WindowBase::init_im() { XIMStyles *xim_styles;