Package: grpn
Version: 1.4.1-1+b1
Severity: important
Howdy!
I've flagged this `important` because the rendering bug is quite severe
on my system, largely rendering grpn unusable for me.
My system has a high DPI screen, and I correspondingly configure various
system-level DPI to be higher to compensate. For example, I have
`~/.Xresources` containing `Xft.dpi: 200`.
Pango font rendering renders fonts correctly in and of itself, but grpn
mis-calculates the line height in this circumstance.
I'm not sure if there's a better method, but I found that using
gdk_get_screen_resolution returns `200.0` for me, and I can scale grpn's
calculated fontH and fontW by (resolution/96), which gives me perfect
font rendering.
Here's a patch:
--- grpn-1.4.1/lcd.c 2017-11-11 02:29:45.000000000 -0800
+++ grpn-1.4.1-fixed/lcd.c 2020-12-12 22:29:39.334770757 -0800
@@ -148,8 +148,17 @@
pango_context_get_metrics(pango_context, pango_desc,
pango_language_get_default());
fontW =
(pango_font_metrics_get_approximate_digit_width(pango_metrics))/PANGO_SCALE;
- fontH = (pango_font_metrics_get_ascent(pango_metrics) +
pango_font_metrics_get_descent(pango_metrics))/PANGO_SCALE;
- fontD = pango_font_metrics_get_descent(pango_metrics)/PANGO_SCALE;
+
+ GdkScreen * screen = gdk_screen_get_default();
+ gdouble resolution;
+ if(screen == NULL) {
+ resolution = 96.0;
+ } else {
+ resolution = gdk_screen_get_resolution(screen);
+ }
+
+ fontH = (pango_font_metrics_get_ascent(pango_metrics) +
pango_font_metrics_get_descent(pango_metrics))/PANGO_SCALE * resolution / 96.0;
+ fontD = pango_font_metrics_get_descent(pango_metrics)/PANGO_SCALE *
resolution / 96.0;
gtk_widget_modify_font(lcdDA, pango_desc);
#else
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.9.0-1-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages grpn depends on:
ii libatk1.0-0 2.36.0-2
ii libc6 2.31-4
ii libcairo2 1.16.0-4
ii libfontconfig1 2.13.1-4.2
ii libfreetype6 2.10.2+dfsg-4
ii libgdk-pixbuf2.0-0 2.40.0+dfsg-7
ii libglib2.0-0 2.66.3-1
ii libgtk2.0-0 2.24.32-5
ii libpango-1.0-0 1.46.2-3
ii libpangocairo-1.0-0 1.46.2-3
ii libpangoft2-1.0-0 1.46.2-3
ii libx11-6 2:1.6.12-1
grpn recommends no packages.
grpn suggests no packages.
-- no debconf information