From 48ad145d65360074eb95f4c467cdf707b8a14682 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 27 Sep 2017 08:48:39 +0200 Subject: Use a 10p fontsize --- src/main.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main.cc') diff --git a/src/main.cc b/src/main.cc index d3017d9..96a6500 100644 --- a/src/main.cc +++ b/src/main.cc @@ -47,6 +47,12 @@ struct PangoFontMetricsDelete { } }; +struct PangoFontDescriptionDelete { + void operator()(PangoFontDescription* ptr) const { + pango_font_description_free(ptr); + } +}; + struct CairoPatternDelete { void operator()(cairo_pattern_t* pattern) const { cairo_pattern_destroy(pattern); @@ -171,6 +177,11 @@ public: pango_layout_set_ellipsize(layout_.get(), PANGO_ELLIPSIZE_MIDDLE); pango_layout_set_alignment(layout_.get(), PANGO_ALIGN_CENTER); pango_layout_set_height(layout_.get(), 0); + auto font = + std::unique_ptr( + pango_font_description_new()); + pango_font_description_set_size(font.get(), 10 * PANGO_SCALE); + pango_layout_set_font_description(layout_.get(), font.get()); auto context = pango_layout_get_context(layout_.get()); auto metrics = std::unique_ptr( pango_context_get_metrics(context, nullptr, nullptr)); -- cgit v1.3