-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pango 1.50.0 breaks spacing #1367
Comments
On first inspection it seems more likely to be an issue with pango (or maybe, i3) than with i3status-rs - the only thing it does about pango is escape some characters. BTW some other totally unrelated project is complaining |
I guess this is the fix: https://gitlab.gnome.org/GNOME/pango/-/commit/8b46f5db285c6c661a2a7c28c5b354426a8d5c61 |
pango 1.50.0-3 which includes these commits doesn't fix it for me. |
otf-font-awesome works for me but not ttf-font-awesome. The otf is a bit larger in size though. |
Is this happening on both sway and i3? I haven't looked too deeply but was surprised not to find other status bars/etc also complaining about this. All we do is generate JSON which is parsed by swaybar/i3bar which are what actually renders the text. Perhaps try running a small program like this against the "good" and "bad" versions of pango and see what results you get? Or otherwise run a git bisect on pango while testing the bar each time to find the commit that changed the behaviour. #include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <stdio.h>
#include <cairo.h>
#include <pango/pangocairo.h>
int main (int argc, char **argv)
{
if (argc != 3)
{
return 1;
}
char *text = argv[1];
char *font = argv[2];
cairo_surface_t *target = cairo_recording_surface_create(CAIRO_CONTENT_COLOR_ALPHA, NULL);
cairo_t *cairo = cairo_create (target);
PangoLayout *layout = pango_cairo_create_layout(cairo);
PangoFontDescription *desc = pango_font_description_from_string(font);
pango_layout_set_font_description(layout, desc);
pango_layout_set_text(layout, text, -1);
int text_width, text_height;
pango_cairo_update_layout(cairo, layout);
pango_layout_get_pixel_size(layout, &text_width, &text_height);
char *pango_font_used = pango_font_description_to_string(desc);
printf("Width of '%s' is %d\nUsing font: %s", text, text_width, pango_font_used);
} EDIT: found at least one other bar with the same issue: Alexays/Waybar#1343 |
You can use |
I've reported this upstream [1]. If someone has some more insight that might help pango developers understand the issue, please share. |
Thanks for reporting it. Looks like it should be fixed now: https://gitlab.gnome.org/GNOME/pango/-/commit/37f22bb80ebacd834f1927e6acd7fd94aeaf1270 |
@ammgws |
pango perspective here: If you want control over the amount of space, use a font that has a space glyph. All of these icon fonts are weird and deficient in various ways, and forcing a text layout system like pango to deal with them is only ever going to yield suboptimal results. Pango makes various assumptions about fonts which are quite reasonable for |
Just update it to pango v1.50.3 (I'm using Archlinux), it seems good to me. 😃 |
Thanks for the update, looks like it was this: https://gitlab.gnome.org/GNOME/pango/-/commit/9fe2853692bb64ded58a507d87508dc8536cd386 that fixed it. And thanks to Matthias for the persistent effort! |
yes, 1.50.3 fixed it |
OS: Arch Linux
pango 1.48.10-1:
pango 1.50.0-2
Changelog: https://gitlab.gnome.org/GNOME/pango/-/blob/main/NEWS
The text was updated successfully, but these errors were encountered: