Use PANGO_UNDERLINE_SINGLE for rendering shortcuts
[mikachu/openbox.git] / obrender / font.c
index cde0d03..0f56a55 100644 (file)
@@ -68,12 +68,12 @@ RrFont *RrFontOpen(const RrInstance *inst, const gchar *name, gint size,
     PangoStyle pstyle;
     PangoAttrList *attrlist;
 
-    out = g_new(RrFont, 1);
+    out = g_slice_new(RrFont);
     out->inst = inst;
     out->ref = 1;
     out->font_desc = pango_font_description_new();
     out->layout = pango_layout_new(inst->pango);
-    out->shortcut_underline = pango_attr_underline_new(PANGO_UNDERLINE_LOW);
+    out->shortcut_underline = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
     out->shortcut_underline->start_index = 0;
     out->shortcut_underline->end_index = 0;
 
@@ -133,7 +133,7 @@ void RrFontClose(RrFont *f)
         if (--f->ref < 1) {
             g_object_unref(f->layout);
             pango_font_description_free(f->font_desc);
-            g_free(f);
+            g_slice_free(RrFont, f);
         }
     }
 }
@@ -181,7 +181,7 @@ RrSize *RrFontMeasureString(const RrFont *f, const gchar *str,
 
     g_assert(!flow || maxwidth > 0);
 
-    size = g_new(RrSize, 1);
+    size = g_slice_new(RrSize);
     font_measure_full(f, str, &size->width, &size->height, shadow_x, shadow_y,
                       flow, maxwidth);
     return size;
@@ -284,6 +284,8 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
     case RR_JUSTIFY_CENTER:
         x += (w - mw) / 2;
         break;
+    case RR_JUSTIFY_NUM_TYPES:
+        g_assert_not_reached();
     }
 
     if (t->shadow_offset_x || t->shadow_offset_y) {