Blocks rendering on Linux

Issue #126 resolved
José García created an issue

I have some visualization problems on Linux (Xubuntu 20.04) the bottom part of block's text is truncated. This is specially annoying with blocks that contains an underscore. Here you have a capture from desktop and web version on the same computer.

Regards

Comments (5)

  1. John Maloney repo owner

    Thanks for reporting this. As you say, it appears that the bottom part of the text is getting clipped. I notice that the descenders of “y” and “p” are also getting removed. I’ll look into it.

  2. John Maloney repo owner

    Something apparently changed about fonts or text rendering between Ubuntu 18.04 and Ubuntu 20.04 (or the upstream distro). The text is not cut off in either 16.04 or 18.04. I will look for a fix or work-around but I want to be sure to support older versions of Linux, not just the latest.

  3. John Maloney repo owner

    I did more investigation. It appears that the change arises from a change to Pango, the Linux Unicode text rendering engine, between versions 1.40.14 (used in Ubuntu 18.04) and 1.44.4 (used in Ubuntu 20.04). It is probably this change: “Switch to using harfbuzz for [font] metrics”(https://gitlab.gnome.org/GNOME/pango/-/blob/master/NEWS) introduced in 1.44.4, the very latest version.

    Since this is a very recent change and it might break font rendering and text layout for other applications, there is chance that Gnome will issue a fix that will be picked up by Ubuntu. Meanwhile, I can add a workaround based on the Pango version number. I need to do that because otherwise fixing the issue on 20.04 messes things up on 18.04 and 16.04. (I haven’t tested MicroBlocks on version 19 of Ubuntu but Pango 1.44 was released in July, 2019 so it may or may not have be included in Ubuntu 19.)

  4. Log in to comment