weird text display overwriting problem

Deploying to Linux? Get penguinated here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
neville
Posts: 40
Joined: Tue Apr 15, 2008 8:37 am

weird text display overwriting problem

Post by neville » Sat Dec 23, 2017 2:53 am

I have a weird problem with text in a label field not rendering properly, with part of the text overwriting the previous part lLiveCode 8.1.9, Ubuntu linux installed under Parallels on a Mac, but confirmed by native Ubuntu user]

I have a simple label field in a simple stack "myAlert".
set the textfont of fld 1 of cd 1 of stack "myAlert" to "Arial"
set the textsize of cd 1 of stack "myAlert" to 14
put "No external displays detected" into cd 1 of stack "myAlert"
results in the words "display detected" being written on top of the word "external"

However with
put "No externa dispays detected" into cd 1 of stack "myAlert"
(deleting the two ell characters), it displays correctly!!!

Multiline text in fld 1 tends to overwrite one line over another, eg four lines becoming two unreadable lines.

If I change the font from "Arial" to say "DejaVu" (both btw installed in the system), that particular text displays correctly, but other text won't. If I change the size from 14 to 15 say, it displays correctly: however other text will show the same problem. Size 12 actually seems to always render correctly.

I don't think it has anytime to do with the particular character "l" but possibly where a tabtop is hit; there are however no tabstops set, it is a plain vanilla label field.

The stack is a sub-stack of a standalone Linux-64 app, but the behaviour also occurs when I execute an LC script in a command-line setup I use, so I am pretty sure it would replicate in the development environment on Ubuntu. The Mac and Windows standalone have no problem.

I have seen references in forums to font metric issues with Linux as compared with Mac/Windows (I actually have another font issue with Ubuntu not scaling a window to less than 50% correctly, fonts get scaled by more than the requested scaling) but nothing like this. Surely someone must have come across this before (unless every LiveCode Ubuntu users only ever uses 12 point fonts?)

neville
Posts: 40
Joined: Tue Apr 15, 2008 8:37 am

Re: weird text display overwriting problem

Post by neville » Sat Dec 23, 2017 3:50 am

the script should have been
set the textsize of fld 1 of cd 1 of stack "myAlert" to 14
put "No external displays detected" into fld 1 of cd 1 of stack "myAlert"
of course

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5938
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: weird text display overwriting problem

Post by FourthWorld » Sat Dec 23, 2017 4:40 am

Works well here under Ubuntu 14.04 on metal with LC 8.2dp2 and LC 9.0dp11.

Any other options I might try to see if I can reproduce this?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bogs
Posts: 1755
Joined: Sat Feb 25, 2017 10:45 pm

Re: weird text display overwriting problem

Post by bogs » Sat Dec 23, 2017 7:08 am

Actually, I have something neville (or his willing guinea pig) can try, which is to start the program from the command line with (in terminal, from the folder the program is in)

Code: Select all

./program name
The output is often quite informative, in this case a Gtk warning about the theme engine not being found in the module path, although in spite of this the program appears to work correctly.
Image
Image

neville
Posts: 40
Joined: Tue Apr 15, 2008 8:37 am

Re: weird text display overwriting problem

Post by neville » Fri Dec 29, 2017 1:48 am

Thanks guys for your response (and Happy New Year)

Richard, I am using Ubuntu 16.04. My user is on Ubuntu 18.10.

Good suggestion about the theme, but no help: the program runs from the command line without any messages.

I find that a workaround seems to be to set the text font of the label field to "Default" [Although I was sure I tried that before and got incorrectly rendered text in some cases, but now it seems to work]. Luckily (?) the default font for label fields set by LC matches the sans serif style I wanted, so I can live with this, though I don't like the default font for buttons.

But there is a LC bug lurking somewhere there. I can't think of any other settings which could be involved so unless other people can replicate it there doesn't seem to any point in reporting it beyond this forum; hopefully if some other livecoder comes across something similar this posting will help.

BTW what *is* the default font: requesting the effective textfont just return "Default" ?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2673
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: weird text display overwriting problem

Post by mwieder » Thu Jan 25, 2018 1:56 am

I'm coming late to this party, but my guess it has to do with selecting 'Arial' as the text font. That's a Micro$oft font, and mapping of an alternate font may well have undefined results on different systems. Your code works fine on my linux Mint 17 system, and Arial isn't installed on my computer and LiveCode says the text font is Arial, so...

run 'fc-match Arial' from a commandline and see what gets mapped to Arial.
On my system it's LiberationSans-Regular.ttf: "Liberation Sans" "Regular"

If there's a discrepancy between mapping on the two systems and you really need Arial font, you can install the M$ fonts with

sudo apt-get install ttf-mscorefonts-installer
sudo fc-cache

and then run the fc-match check again.

neville
Posts: 40
Joined: Tue Apr 15, 2008 8:37 am

Re: weird text display overwriting problem

Post by neville » Thu Jan 25, 2018 4:53 am

Thanks mwieder

I do have Arial installed. But I get the same problems (with various text) when I use the Ubuntu fonts "Ubuntu" or "LiberationSans". I've decided to go with using "Default" which works in all the cases I need at least.

bogs
Posts: 1755
Joined: Sat Feb 25, 2017 10:45 pm

Re: weird text display overwriting problem

Post by bogs » Thu Jan 25, 2018 4:51 pm

neville wrote:
Fri Dec 29, 2017 1:48 am
BTW what *is* the default font: requesting the effective textfont just return "Default" ?
From Max's Wiki
Setting the textFont to `(Default)` causes the control to use the default font for that type of control rather than inheriting the font from a parent object.
In other words, whatever your Os has listed to display a font for, that is the default font. In Linux, this is usually found under 'Appearance'
Image
...but Win and Mac have a simlar thing.
Image

Post Reply

Return to “Linux”