summaryrefslogtreecommitdiff
path: root/frontends/gtk/layout_pango.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/gtk/layout_pango.c')
-rw-r--r--frontends/gtk/layout_pango.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/frontends/gtk/layout_pango.c b/frontends/gtk/layout_pango.c
index bad57d684..5276148e4 100644
--- a/frontends/gtk/layout_pango.c
+++ b/frontends/gtk/layout_pango.c
@@ -226,27 +226,24 @@ nserror nsfont_paint(int x, int y, const char *string, size_t length,
const plot_font_style_t *fstyle)
{
PangoFontDescription *desc;
- PangoLayout *layout;
PangoLayoutLine *line;
if (length == 0)
return NSERROR_OK;
- layout = pango_cairo_create_layout(current_cr);
+ nsfont_pango_check();
desc = nsfont_style_to_description(fstyle);
- pango_layout_set_font_description(layout, desc);
+ pango_layout_set_font_description(nsfont_pango_layout, desc);
pango_font_description_free(desc);
- pango_layout_set_text(layout, string, length);
+ pango_layout_set_text(nsfont_pango_layout, string, length);
- line = pango_layout_get_line_readonly(layout, 0);
+ line = pango_layout_get_line_readonly(nsfont_pango_layout, 0);
cairo_move_to(current_cr, x, y);
nsgtk_set_colour(fstyle->foreground);
pango_cairo_show_layout_line(current_cr, line);
- g_object_unref(layout);
-
return NSERROR_OK;
}