Disappearing commas in Editor window

Discussions related to Visual Prolog
User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

Disappearing commas in Editor window

Unread post by Ferenc Nagy » 5 Nov 2012 19:17

If I use Verdana font in the Editor window then the
A,B
expressions are clearly visible.
I used some Unicode character in my comments. Verdana font shows them a empty squares.
If I use Arial Unicode MS font in the Editor window then the special characters are visible but the comma in
A,B
expressions are hidden. I see the comma only if I add a space after it before the B:
A,[space here]B.
Is it a bug or is it a feature?
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1641
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 6 Nov 2012 0:14

It is definitely not nice. I can explain why the problem happens, and then you can decide whether it is a feature or a bug, and perhaps who is to blame ;-).

The problem comes from Windows font edge smoothing (ClearType). Font smoothing is done by blurring the pixels a little into the surroundings. The eye/brain percieve (is that the right word?) this as more smooth.

The blurring means that each letter is actually using one pixel more in all directions. Writing several letters at once with one of the writing routines will not cause any problems because the overlap between the letters will be handled by the write operation. But if you write some letters with one operation and then some more with another operation then the last write will reset some pixels in from the first operation in the overlap.

And that is what happens to your comma, it is effectively erased by the next letter (there are most likely some not fully colored pixels left from the comma).

The editor use many write operations to do the token coloring, because a single write operation will use same font, color, etc.

There are means to solve the problem, but not in existing programs. The next (7.4) IDE will use the Scintilla editor which have solved the problem.
Regards Thomas Linder Puls
PDC

User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

I found nice fonts

Unread post by Ferenc Nagy » 6 Nov 2012 12:08

Hi Thomas,

Thank you for the explanation.
I found Lucida Sans Unicode and Lingoes Unicode fonts nice.
Only the small "el" and the capital "Ian" letters are hard to distinguish.
See attachment.[/img]
Attachments
Lucinda.png
Lucinda.png (2.26 KiB) Viewed 1415 times
TIA, Regards,
Frank Nagy

Harrison Pratt
VIP Member
Posts: 295
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt » 6 Nov 2012 13:21

Andale Mono works well for code.

Post Reply