nadrad / h-m-m

Hackers Mind Map
GNU General Public License v3.0
1.89k stars 53 forks source link

Issue : tree breaks with speciale characters #52

Closed klownie closed 1 year ago

klownie commented 1 year ago

As the title says if you create a new node that contain speciale character like chinese it breaks completely. Here is a image of the issue. Screenshot from 2023-04-17 at 13_36_00 366435100

nadrad commented 1 year ago

Sorry, I just gave up on fixing it after a few hours of work!

The first problem was with word wrapping, as the native function is not designed for multi-byte characters such as those. I could fix it, but then ran into a more fundamental problem: Those characters take twice the width of ASCII characters! I always thought that every character has the same width in a monospace font, but that turned out to be wrong.

Considering different character widths requires a fundamental change in the application to use the typographic widths instead of number of characters. Since I'm considering rewriting h-m-m with a better programming language in the future, I won't go through it now, but I'll certainly have it in mind when writing the new version from scratch.