From e6bccc081f651a87bba58235e8c28c3fdfae5607 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 30 May 2019 15:28:08 +0200 Subject: X11+Pango: call pango_font_description_from_string() less often Previously, each time fl_font(fnum, fsize) was called, functions pango_font_description_free() and pango_font_description_from_string() would be called. Now, pango_font_description_from_string() is called only once, the first time an Fl_Font is used. --- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H') diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H index 66b47edb0..784bc8d02 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H @@ -84,7 +84,8 @@ protected: static PangoContext *pctxt_; static PangoFontMap *pfmap_; static PangoLayout *playout_; - PangoFontDescription *pfd_; + static PangoFontDescription **pfd_array; // one array element for each Fl_Font + static int pfd_array_length; void do_draw(int from_right, const char *str, int n, int x, int y); static PangoContext *context(); static void init_built_in_fonts(); -- cgit v1.2.3