Issue with weird spacing between letters on Android

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
Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Issue with weird spacing between letters on Android

Post by Opaquer » Wed Oct 07, 2020 7:15 am

Hey guys

So, I'm in the final stages of alpha for my sudoku app (only like 4 more bits of feedback to work on and it's done! woo, finally!), and one of the bits of feedback from my testers is that some of the text has weird spacing to it. I confirmed with everyone in the test program that it was all there and not a device specific issue, and found out everyone had it. Basically, with some of the words throughout my app, the text has weird spacing between letters, and while it's not huge, it is noticeable and a bit annoying, especially once you notice it :P

I've uploaded an album here and highlighted a few words that have issues. As you can see in words like option and separately, there's more space between the op, ti and on in option, and same goes for the se, pa, ra, tely parts of separately. It's a bit of an annoyance, and I can't seem to find any way to fix it. Has anyone experienced this before, and if so, is there an easy fix?

Many thanks!

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

Re: Issue with weird spacing between letters on Android

Post by richmond62 » Wed Oct 07, 2020 8:17 am

Oddly enough, looking at your pictures, the ONLY problem I can see is after the letter "o" ('separately' seems alright).

I suspect the font has got a wonky kerning table.
-
Oh, Ho, Ho.jpg
-
At the risk of asking a stupid question: Have you tried other fonts than the one in the pictures?

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Issue with weird spacing between letters on Android

Post by Opaquer » Wed Oct 07, 2020 8:48 am

If you have a look at the enlarged separately in the imgur album, it does have a bit of a gap mostly after the a and the e... Maybe this font doesn't like vowels??? First the o and i in option, then the a and e in separately and even a bit of the e in control... Something to think about!

As for trying a different font - I completely forgot that was an option :P. I have so many things that use this font (the default that got picked when I made my first item that has a font), that I didn't even think to try a different font option! I should have started with the easy solution first, huh! Is there an easy way to make every button, field, widget and control I have use a different font without having to change it all up?

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

Re: Issue with weird spacing between letters on Android

Post by richmond62 » Wed Oct 07, 2020 9:05 am

AS any object (button, field, whatever) inherits characteristics from the card it resides on (unless you specifically change them)
you can probably set the font ONCE (in fact I'd do it for the whole stack) and the effect should be across the board.

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Issue with weird spacing between letters on Android

Post by Opaquer » Wed Oct 07, 2020 10:27 am

That did it! Combining that with this thread and I managed to figure out how to get the text to transfer to my phone! Thanks so much for the tip, I would have spent ages going through every single control I had and manually changing it!

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Issue with weird spacing between letters on Android

Post by Opaquer » Wed Oct 07, 2020 12:18 pm

Hey richmond

So, I was going through my options trying to find a font that would work and came across something weird. I've downloaded a few fonts, I can see them on my computer and can transfer them through the app onto my phone, and can see them there too. The only issue though is that I can't set the textStyle of any of the controls to bold or plain or anything on my phone, though it works on the computer in the IDE. Have you heard of anything like this before? For every custom font I'm trying out, setting the textStyle to bold/plain does nothing, and the font doesn't actually change? It's super weird!

Funnily enough, I tried with taking Arial over (one of the default fonts already in LC and my computer and whatnot), and the bold works perfectly fine on it? Is it something lacking with the files of the custom fonts, or something with how Android uses them do you think?

Many thanks

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7233
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Issue with weird spacing between letters on Android

Post by jacque » Wed Oct 07, 2020 4:46 pm

Text kerning was bad on Android until LC fixed it in the latest release. This was an engine issue. Are you using LC 9.6.1?

LC also changed how styled text works a while ago and no longer creates artificial bold or italic text. If the font package doesn't include a styled version, you won't see any style changes.

Edit: Android doesn't normally include Arial but LC will substitute the system font if the chosen font doesn't exist on the target device. The system font on Android is Roboto or Droid Sans, depending on the OS version, and both contain a full set of styled fonts. For mobile I generally try to stick with the system font to keep the app looking like users expect. You can set the stack font to "(system)" which is the first option in the font menu, and no matter what device is running the font will look and work correctly.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Issue with weird spacing between letters on Android

Post by Opaquer » Wed Oct 07, 2020 5:32 pm

Hi Jacque

That makes sense about Arial having bold and others not, but some of the other also have a bold version, though in hindsight they're all named things other than fontname-bold or something similar. The weird thing is that on my computer when I'm working on it, the textStyle does change to bold regardless of the font I have, but when I transfer it to Android it doesn't artificially change the style of of the field! So does this mean that whenever I set the textStyle of something to bold, it actually just replaces the font type with the bold version, instead of just making it bold? Also do you know if the bold versions of the fonts have to be named anything specific, or can LC figure out what it's meant to be?

As for the text kerning, I'm using Indy version 9.6.1 stable release that came out on 19 August, and I'm having this issue. Is there anything I can do to fix it? The (system) font looks great (and everything I've got is based to fit around it, so I don't need to worry about how big/small things are :P), so if I can fix the kerning, I think I might be happy enough with that!

Many thanks!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7233
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Issue with weird spacing between letters on Android

Post by jacque » Thu Oct 08, 2020 5:38 pm

LC presumably figures out what the styled font is named, particularly if you're using the system font. You can set the textstyle to bold and LC will use the bold variation in the font package.

We saw the same spacing problems on Android until LC fixed it, so I'm not sure there's much you can do. The only thing I can think of is that maybe some of the controls have their own font set instead of inheriting from the stack. But even so, that shouldn't affect the display. So I guess the short answer is that I don't know.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Issue with weird spacing between letters on Android

Post by Opaquer » Fri Oct 09, 2020 3:13 pm

Hey Jacque

Yeah, I don't know what was going on with it either! I ended up having to edit the fonts I wanted a bit anyway since I didn't like how the numbers were looking, and when I did that, I made a bold version to use. I think I figured out the problem I was having though:

I *think* if a standard font is called "XYZ regular", when you make it bold with LC, it'll try looking for "XYZ regular bold", however since I didn't have that as a font name (since I had "XYZ bold"), it didn't work with it!

I found a program to make and edit fonts, and I did that to get the font I want, including a bold flavour of it, which now works almost perfectly - certainly enough to not have to worry about it!

Thanks for all your help and suggestions!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7233
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Issue with weird spacing between letters on Android

Post by jacque » Fri Oct 09, 2020 5:32 pm

Interesting. I'm glad you figured it out, I'll have to keep the naming conventions in mind.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”