Underscores not rendered in Monospace 11/12 font #2449
Comments
Monospace is not a font. I believe Anyway I think this is a font problem. xtext queries the line height from the font. |
@jpiszcz Could you find out if the |
That was it! Everything is rendering perfectly once again! The workaround is to downgrade these packages to the following versions: I found the old versions here: |
So ideally somebody could bisect the code to see what caused the regression. But I guess you can just open an issue against Pango with the exact version where the line height of a font no longer seems accurate (this isn't exactly verified to be the exact problem). |
Someone also submitted a Debian bug report: Will submit these two links to the pango issues section. |
I tried downgrading by following the instructions posted above (since my issue was exactly as reported in this thread), but then I encountered the following issues:
On top of that, when trying to do Edit: This also broke my packages altogether, so I cannot upgrade or do anything with it, nor purge them. Here's the output of apt-get install -f:
|
The instructions were for Debian Testing (x86_64) arch, for Ubuntu or other distributions you will need to determine how to downgrade and then once done make sure you pin the packages so they don't break again.
|
Also getting the same issue (Debian testing), downgrading pango fixed it. @s7sost Looks like you have i386 packages, so you'll also need to download and install the downgraded versions of those too. Then --fix-broken will start working again. |
I had the same problem on Fedora 31 and now on Fedora 32. Works: Broken: |
This comment has been minimized.
This comment has been minimized.
Pango added the use of typographic metrics (sTypo*) and a line height attribute around then. It's possible that was the start of the problem. Locally, I "fixed" it (may not be a correct fix) by doing this: --- src/fe-gtk/xtext.c
+++ src/fe-gtk/xtext.c
@@ -283,6 +283,7 @@ backend_font_open (GtkXText *xtext, char
metrics = pango_context_get_metrics (context, xtext->font->font, lang);
xtext->font->ascent = pango_font_metrics_get_ascent (metrics) / PANGO_SCALE;
xtext->font->descent = pango_font_metrics_get_descent (metrics) / PANGO_SCALE;
+ xtext->fontsize = pango_font_metrics_get_height (metrics) / PANGO_SCALE + 1;
pango_font_metrics_unref (metrics);
}
static int
@@ -3479,7 +3480,7 @@ gtk_xtext_set_font (GtkXText *xtext, cha
if (xtext->font == NULL)
return FALSE;
- xtext->fontsize = xtext->font->ascent + xtext->font->descent;
+// xtext->fontsize = xtext->font->ascent + xtext->font->descent;
{
char *time_str; |
@Deek It doesn't look crazy. Could you open a PR for that and I'll ask some Pango folks to review it. |
Ok so that is new in 1.44, put it in an |
Some more detail here: https://gitlab.gnome.org/GNOME/pango/-/issues/392 @Deek if you don't want to open a PR for this, maybe I could take a look if your fix still works? |
With newer versions of Pango and some fonts, the bottom of the text is clipped (making underscores invisible). Use the correct calculation when needed to avoid this. Based on an original fix by Jeff Teunissen. Closes hexchat#2449.
The fix does still work; it could well be a bug in Pango itself causing it (that +1 I had to put in is suggestive), but it does seem to result in text that doesn't get cut off. |
@Deek do you really need the +1 ? I tested both with and without, and the fix is sufficient for me to see underscores again. But I slightly prefer the additional pixel space. |
I seem to recall not adding the 1 did partially restore most underscores, but that they were still cut off a bit; adding the +1 seemed to make hexchat look just like it did before the Pango change. |
The issue is still present for me.... |
My bug report in https://bugs.launchpad.net/hexchat-irc/+bug/1920974 |
If somebody here runs Ubuntu 20.04 focal and is affected by this bug, I've proposed a patch on https://bugs.launchpad.net/hexchat-irc/+bug/1920974 msg#4 ; I need somebody to fill in the "test plan" (i.e. how to reproduce the bug) and try out my proposed package, after which if the bug is confirmed fixed I can upload it to the main archive. TIA! |
Also sorry it took me so long to fix it on focal, it totally slipped my mind to check it there when I fixed it for Debian… |
FYI, the fix has just been fully released to focal-updates, so Ubuntu 20.04 users running hexchat as present in the Ubuntu repository will now get the fix. |
Summary: - Added "Use pango_font_metrics_get_height() to calculate font height" patch. [Upstream bug](hexchat/hexchat#2449). I did notice an improvement in font rendering with this patch applied while testing the now abandoned D10958, so I think it's deserving of being fixed. Notably chat seems less "smooshed" with a more natural spacing between lines. Test Plan: - Tested that Hexchat opened - Checked that IRC was working - Checked that font appeared to be rendering acceptably Reviewers: #triage_team, JoshStrobl Reviewed By: #triage_team, JoshStrobl Subscribers: JoshStrobl, TClark77 Differential Revision: https://dev.getsol.us/D10963
I am finding that underscores don't render, appearing as spaces, when using the default Monospace 11 or Monospace 12 font on Ubuntu 20.04 (Focal, development beta, but due to be released this month). This occurs in both the package of 2.14.3-3 and the current master branch as of today.
Increasing to Monospace 13 causes them to appear and they work in some other fonts at various sizes. I suspect most likely that the calculated bounding box for the row is being incorrectly calculated somehow to be too short.
I imagine most likely this is either in xtext or an interaction with one of it's rendering dependencies but I'm not really sure where to start on debugging it. I'm happy to do any testing or even work towards solving it but somewhere to start would be great!
The text was updated successfully, but these errors were encountered: