From 941aa2014888d6a501656b06454c00598ddf4581 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 9 Dec 2019 23:38:10 +0100 Subject: [PATCH] Fix font size on Push2 At least on my machine, the fonts on the Push display were ridiculously large, making everything overlapping and unusable. I suspect this is because pango_cairo_font_map_get_default() inherits DPI from the system, so the monitor scaling factor got applied to the Push display as well. This commit instead creates a new plain font map, and sets the resolution to 96, which looks like what the UI was designed for. Some more tweaking of the Pango context might make things more optimal on the Push, but just setting the resolution makes things look reasonable to me anyway. --- libs/surfaces/push2/canvas.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/surfaces/push2/canvas.cc b/libs/surfaces/push2/canvas.cc index 519d3367b6..b05888e701 100644 --- a/libs/surfaces/push2/canvas.cc +++ b/libs/surfaces/push2/canvas.cc @@ -242,13 +242,14 @@ Glib::RefPtr Push2Canvas::get_pango_context () { if (!pango_context) { - PangoFontMap* map = pango_cairo_font_map_get_default (); + PangoFontMap* map = pango_cairo_font_map_new (); if (!map) { error << _("Default Cairo font map is null!") << endmsg; return Glib::RefPtr (); } PangoContext* context = pango_font_map_create_context (map); + pango_cairo_context_set_resolution (context, 96); if (!context) { error << _("cannot create new PangoContext from cairo font map") << endmsg;