changeset 2259:5f1677cc32e9

GTK3: Switch back to Pango syntax for older GTK versions. The GTK 3.19 change notes indicate every widget was converted to CSS. So enabling CSS support for 3.20 or higher... may need further testing to be sure about the version support.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 27 Jan 2021 01:27:46 +0000
parents 7cd64f66f1cc
children cb24daa675a2
files gtk3/dw.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gtk3/dw.c	Tue Jan 26 11:02:43 2021 +0000
+++ b/gtk3/dw.c	Wed Jan 27 01:27:46 2021 +0000
@@ -2687,7 +2687,7 @@
       free(oldfont);
 }
 
-/* Convert DW style font to CSS syntax:
+/* Convert DW style font to CSS syntax (or Pango for older versions):
  * font: font-style font-variant font-weight font-size/line-height font-family
  */
 char *_convert_font(const char *font)
@@ -2697,18 +2697,24 @@
    if(font)
    {
       char *name = strchr(font, '.');
+#if GTK_CHECK_VERSION(3,20,0)
       char *Italic = strstr(font, " Italic");
       char *Bold = strstr(font, " Bold");
+#endif
       
       /* Detect Dynamic Windows style font name...
        * Format: ##.Fontname
-       * and convert to a Pango name
+       * and convert to CSS or Pango syntax
        */
       if(name && (name++) && isdigit(*font))
       {
           int size = atoi(font);
-          newfont = g_strdup_printf("%s normal %s %dpx %s", Italic ? "italic " : "normal",
+#if GTK_CHECK_VERSION(3,20,0)
+          newfont = g_strdup_printf("%s normal %s %dpx \"%s\"", Italic ? "italic " : "normal",
                                     Bold ? "bold " : "normal", size, name);
+#else
+          newfont = g_strdup_printf("%s %d", name, size);
+#endif
       }
    }
    return newfont;