From 6de328c1273b0a136328aff90d99aa885e141dc7 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig Date: Mon, 4 Jun 2018 11:29:41 +0200 Subject: [PATCH] Linux default font --- unix/drawtext.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unix/drawtext.c b/unix/drawtext.c index 80ed4194..19bd2a3f 100644 --- a/unix/drawtext.c +++ b/unix/drawtext.c @@ -80,18 +80,18 @@ void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height *height = pangoToCairo(logical.height); } -uiDrawTextFont *uiDrawLoadDefaultFont() +void uiDrawLoadDefaultFont(uiFontDescriptor *f) { GtkWidget *widget; GtkStyleContext *style; PangoFontDescription *fontdesc; - PangoFont *font; widget = g_object_ref_sink(gtk_drawing_area_new()); style = gtk_widget_get_style_context(widget); gtk_style_context_get(style, GTK_STATE_FLAG_NORMAL, "font", &fontdesc, NULL); - font = pangoDescToPangoFont(fontdesc); + uiprivFontDescriptorFromPangoFontDescription(fontdesc, f); + // pdesc is transfer-full and thus is a copy + pango_font_description_free(fontdesc); g_object_unref(widget); - return mkTextFont(font, FALSE); }