Font drawing issues
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Font drawing issues
Hi all,
I noticed that the font spacing for many characters is not right. Some letters are more noticeable than others. The f, i & s are the worst.
I would like to confirm if this is a bug or is something related to my hardware on Windows 10. On the attached image, LiveCode 9.6.6 on the left, and for comparison Notepad on the middle, and Sublime Text on the right. Is there a fix?
The stack is merely one card with 1 field with some text. Thanks!
I noticed that the font spacing for many characters is not right. Some letters are more noticeable than others. The f, i & s are the worst.
I would like to confirm if this is a bug or is something related to my hardware on Windows 10. On the attached image, LiveCode 9.6.6 on the left, and for comparison Notepad on the middle, and Sublime Text on the right. Is there a fix?
The stack is merely one card with 1 field with some text. Thanks!
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
-
- VIP Livecode Opensource Backer
- Posts: 9579
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Font drawing issues
Hi.
Are you asking about the differences between mono-spaced fonts and "ordinary" fonts, where each character has its own built-in width based on the inherent kerning of that font?
Craig
Are you asking about the differences between mono-spaced fonts and "ordinary" fonts, where each character has its own built-in width based on the inherent kerning of that font?
Craig
Re: Font drawing issues
Valid question but no, I'm not asking about monospaced fonts. I shouldn't have picked the notepad & Sublime as those have monospaced fonts. You can also compare in any word editor, i.e microsoft word, with any regular font. Comparing the same font type in LiveCode and the word editor at the same font size will yield different results.
Please notice that most letters seem to have a space in between them, while a few ones seem to be properly and evenly spaced (h,m,n,u and x). Zoom in into the screenshot and you will notice the irregular font spacing between repeated characters. No matter the font type, repeating the same character should yield the same spacing between them... right?
Please notice that most letters seem to have a space in between them, while a few ones seem to be properly and evenly spaced (h,m,n,u and x). Zoom in into the screenshot and you will notice the irregular font spacing between repeated characters. No matter the font type, repeating the same character should yield the same spacing between them... right?
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
-
- VIP Livecode Opensource Backer
- Posts: 9579
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Font drawing issues
Ah, OK.
What font does the LC field have? I made a few tests, and the spacing between successive chars (i's and f's) in a continuous string is uniform.
Craig
What font does the LC field have? I made a few tests, and the spacing between successive chars (i's and f's) in a continuous string is uniform.
Craig
Re: Font drawing issues
I am using Segoe UI which is Microsoft's one. However I'm trying with many fonts and I can see the spacing varies according to the font type and size. Also moving the field around makes the character spacing vary. So this is issue seems to be not font dependant. On what OS are you testing? could be a Windows only issue...
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
Re: Font drawing issues
Do you have the formatForPrinting property set true or fslse on the stack?
This is a Windows specific property which adjusts the font kerning according to the expected rendering destination. Set and unset ot to see the difference.
It may have no bearing on your issue, but worth investigating.
I have definitely seen fonts where the rendering is not good on screen in any application on Windows. I think some fonts don't have great metrics baked in. (Can't say that Segoe UI should be like that though.)
This is a Windows specific property which adjusts the font kerning according to the expected rendering destination. Set and unset ot to see the difference.
It may have no bearing on your issue, but worth investigating.
I have definitely seen fonts where the rendering is not good on screen in any application on Windows. I think some fonts don't have great metrics baked in. (Can't say that Segoe UI should be like that though.)
Re: Font drawing issues
Tnx for the suggestion. I tried setting it to both false and true, but no success. I've tried different fonts, system ones, and they look great in other applications but not in LiveCode. I suppose the font rendering is better on Apple devices?
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
Re: Font drawing issues
I suppose you could also check the Windows settings for ClearType as well (not that it is likely to help either).
I will have a check when I can use my laptop rather than this phone.
I will have a check when I can use my laptop rather than this phone.
Re: Font drawing issues
The clearType was set to true by default. Good suggestion but unfortunately doesn't work. LiveCode does indeed draw smooth fonts. But the problem is the spacing between characters which seems to be something not related to the font drawing engine, but instead something related to how LC draws the pixels. I believe I found the root issue and it's related to Bug #16119. I made some comments, and uploaded attachments to further Express my issue. Since that bug is already 5 years old, I doubt anything will be changed soon. That's a very nasty bug.
Perhaps deploying from a Mac has a better drawing. I've always felt the Windows part of LC doesn't receive as much love as the Mac counterpart of LC. I hope later on to get my hands on some Mac, and start developing for Mac. I wonder if deploying LC executables from Mac to Windows OS target is possible, and if so, I wonder if the rendering would be the same or different. That's something for the future though. In the meanwhile, I gotta ignore this issue and move on coding.
Perhaps deploying from a Mac has a better drawing. I've always felt the Windows part of LC doesn't receive as much love as the Mac counterpart of LC. I hope later on to get my hands on some Mac, and start developing for Mac. I wonder if deploying LC executables from Mac to Windows OS target is possible, and if so, I wonder if the rendering would be the same or different. That's something for the future though. In the meanwhile, I gotta ignore this issue and move on coding.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Font drawing issues
On a Mac on can run off standalones for Mac, Win and Linux. I suspect, however a standalone authored on a Mac will have the font problems you describe when it runs on Windows.
I you would like, send me the names of 3 or 4 of the problematic fonts, I'll then run off a Windows executable containing fields with these fonts on my Mac Mini, and you can run them on Windows, and . . .
I you would like, send me the names of 3 or 4 of the problematic fonts, I'll then run off a Windows executable containing fields with these fonts on my Mac Mini, and you can run them on Windows, and . . .
Re: Font drawing issues
Thanks. Let's try the basic fonts that come with the OS, Segoe UI, Consolas, and Arial. They are all problematic, anyway.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Font drawing issues
Busy planting tomatoes, probably manage things in about 2 hours time.
Re: Font drawing issues
Sure, no problem. Also if you want to see how badly my issue is, check the last attachment in the bug link I posted. I can't upload it, as 300kb video file is too big. The pixel drawing is so irregular, than when simply moving controls around, the fontspacing changes, thus the characters seems to be dancing. Important to note this dancing only happens when my screen monitor Layout and Scale is set at 125%. At 100% is fine, and the font looks ok (though the character spacing is still irregular)
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Font drawing issues
That is what the stack looks like on MacOS 12: font Segoe UI
-
Standalones for MacOS, Windows and Windows 64-bit are here:
https://www.dropbox.com/sh/7qnqf5xu9cr0 ... iBOca?dl=0
- Attachments
-
- fontTester.livecode.zip
- Stack.
- (3.62 KiB) Downloaded 60 times
Re: Font drawing issues
Thanks very much for providing the files. It has allowed me to notice some issues. Indeed the Windows compiled executable from Mac is the same as if it were made from Windows. That's great, LC does really guarantee consistency across platform.
The font is very symmetric and well spaced for Mac. The words 'Just' and 'place' look identical against their repeated counterpart. But for Windows there are subtle spacing differences. For 'Just', the bottom one has an extra space between J and U. For 'Place' u can see the are extra spaces between p with l, and a with c. Nevertheless, is really minor. The font and the text looks good enough. This doesn't bother me that much.
What did really bother me, and reason of posting here, is something I recently realized. I'm using my monitor Scale and layout set at 125%. Some weird glitches appear. For example, look at the yellow lines that appeared in the scrollbar. These glitches appear here and there. Fortunately, turning off that setting makes the stack look fine again.
The font is very symmetric and well spaced for Mac. The words 'Just' and 'place' look identical against their repeated counterpart. But for Windows there are subtle spacing differences. For 'Just', the bottom one has an extra space between J and U. For 'Place' u can see the are extra spaces between p with l, and a with c. Nevertheless, is really minor. The font and the text looks good enough. This doesn't bother me that much.
What did really bother me, and reason of posting here, is something I recently realized. I'm using my monitor Scale and layout set at 125%. Some weird glitches appear. For example, look at the yellow lines that appeared in the scrollbar. These glitches appear here and there. Fortunately, turning off that setting makes the stack look fine again.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/