13
0

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.
This commit is contained in:
David Robillard 2019-12-09 23:38:10 +01:00
parent 3c3b4b9a15
commit 941aa20148

View File

@ -242,13 +242,14 @@ Glib::RefPtr<Pango::Context>
Push2Canvas::get_pango_context () Push2Canvas::get_pango_context ()
{ {
if (!pango_context) { if (!pango_context) {
PangoFontMap* map = pango_cairo_font_map_get_default (); PangoFontMap* map = pango_cairo_font_map_new ();
if (!map) { if (!map) {
error << _("Default Cairo font map is null!") << endmsg; error << _("Default Cairo font map is null!") << endmsg;
return Glib::RefPtr<Pango::Context> (); return Glib::RefPtr<Pango::Context> ();
} }
PangoContext* context = pango_font_map_create_context (map); PangoContext* context = pango_font_map_create_context (map);
pango_cairo_context_set_resolution (context, 96);
if (!context) { if (!context) {
error << _("cannot create new PangoContext from cairo font map") << endmsg; error << _("cannot create new PangoContext from cairo font map") << endmsg;