afrantzis / bless

Bless - Gtk# Hex Editor
GNU General Public License v2.0
210 stars 38 forks source link

Fonts corrupt under Wayland #67

Open spl237 opened 5 months ago

spl237 commented 5 months ago

If you run bless on a system using a Wayland backend, the fonts used to display hex, dec and oct are corrupted.

This is caused by Gdk Pixmaps on Wayland having a hard limit of 4096 pixels wide, so the pre-rendered versions of the byte symbols overflow and the bitmaps get corrupted.

The easy fix is to not try to pre-render all the individual symbols, but just to pre-render "0123456789abcdef" (reduced as appropriate for decimal or octal) and to copy multiple individual characters for each byte from the buffer instead of trying to copy the entire byte value in one.

I can submit a patch if it is useful - I have implemented this on Raspberry Pi and it works fine.