summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2017-09-27 08:48:39 +0200
committerJoel Klinghed <the_jk@yahoo.com>2017-09-27 08:48:39 +0200
commit48ad145d65360074eb95f4c467cdf707b8a14682 (patch)
tree4e4fe36e9d071c5271a5011e49f33f55d2b3ae58
parentd88253f049daaf188f2b55764251ccca3d6b7e29 (diff)
Use a 10p fontsize
-rw-r--r--src/main.cc11
1 files changed, 11 insertions, 0 deletions
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<PangoFontDescription, PangoFontDescriptionDelete>(
+ 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<PangoFontMetrics, PangoFontMetricsDelete>(
pango_context_get_metrics(context, nullptr, nullptr));