Font drawing issues

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Font drawing issues

Post by Monox18 » Wed May 04, 2022 12:54 pm

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.
Screenshot 2022-05-04 13.43.47.png
Thanks!
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Font drawing issues

Post by dunbarx » Wed May 04, 2022 4:19 pm

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

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Font drawing issues

Post by Monox18 » Wed May 04, 2022 5:22 pm

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?
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Font drawing issues

Post by dunbarx » Wed May 04, 2022 5:50 pm

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

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Font drawing issues

Post by Monox18 » Wed May 04, 2022 6:22 pm

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/

SparkOut
Posts: 2839
Joined: Sun Sep 23, 2007 4:58 pm

Re: Font drawing issues

Post by SparkOut » Wed May 04, 2022 7:23 pm

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.)

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Font drawing issues

Post by Monox18 » Wed May 04, 2022 7:32 pm

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/

SparkOut
Posts: 2839
Joined: Sun Sep 23, 2007 4:58 pm

Re: Font drawing issues

Post by SparkOut » Wed May 04, 2022 7:38 pm

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.

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Font drawing issues

Post by Monox18 » Sun May 08, 2022 4:08 pm

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.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Font drawing issues

Post by richmond62 » Sun May 08, 2022 4:28 pm

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 . . .

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Font drawing issues

Post by Monox18 » Sun May 08, 2022 4:34 pm

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/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Font drawing issues

Post by richmond62 » Sun May 08, 2022 4:38 pm

Busy planting tomatoes, probably manage things in about 2 hours time.

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Font drawing issues

Post by Monox18 » Sun May 08, 2022 4:47 pm

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/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Font drawing issues

Post by richmond62 » Sun May 08, 2022 5:28 pm

SShot 2022-05-08 at 19.24.21.png
-
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

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Font drawing issues

Post by Monox18 » Sun May 08, 2022 6:22 pm

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.
Comparison. Mac on Left. Windows on Right.jpg

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.
Windows with Scale Layout 125%.png
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”