Display glitches with hollow box characters
@egmontkob
Submitted by Egmont Koblinger Link to original bug (#709556)
Description
Created attachment 256617 screenshot
Please see the attached screenshot which was taken from the file vte/doc/boxes.txt.
The problems I see:
-
Cutting the hollow has several of off-by errors.
-
There's one single variable named "adjust" which is used for both the double and the light line width. In vte-0-34 vte.c line 9893 (and onwards) its value is practially uninitialized (I mean it's random which of the two line widths it corresponds to).
-
Thin and thick lines, as well as the outer part of hollow lines are guaranteed to be integer wide and aligned to whole pixels so that no AA kicks in. This is not true for the hollow itself, it's a result of division by 3 which might lead to AA effects. This looks terrible, and not like two lines at all.
-
The intent is faulty at 256A and 256B: the Unicode PDF and many fonts imply that the single line should cross the hollow of the double lines.
-
The code is quite complicated, at least for me it's hard to understand and hard to touch.
My suggestions:
- Instead of drawing lines like this and clearing the hollow, I believe a much simpler approach would be to define each of these characters by dividing the cell into 5x5 rectangles (of uneven sizes, but proper alignment both horizonally and vertically), all of which are completely black or completely white. E.g. U+256A would be
00100 11111 00100 11111 00100
Drawing would be as simple as computing the boundaries of rectangles and then filling the necessary ones.
- Drop floating point, make sure all boundaries fall at whole pixel boundaries even with hollow.
Attachment 256617, "screenshot":
Version: 0.34.x
Resolution: RESOLVED FIXED