What controls the space between lines in a field?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
What controls the space between lines in a field?
I have two fields (see image below). The top one is a label field, the bottom one, regular field.
There is no other difference between the two. The font, textSize, textHeight, are all identical.
The line height is not fixed; however, there are no funny chars or mixed size chars in the fields.
Is it just me, or do the fields look different, with more space between the lines and less crowded characters within the line itself?
What might be the cause?
font: (text)
size: 13
text height: 17
Regards,
Sri
There is no other difference between the two. The font, textSize, textHeight, are all identical.
The line height is not fixed; however, there are no funny chars or mixed size chars in the fields.
Is it just me, or do the fields look different, with more space between the lines and less crowded characters within the line itself?
What might be the cause?
font: (text)
size: 13
text height: 17
Regards,
Sri
- Attachments
-
- linespace.png (13.18 KiB) Viewed 8883 times
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: What controls the space between lines in a field?
Check the fixedLineHeight of each field.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: What controls the space between lines in a field?
Hi.
A fresh new label field and a fresh new regular field look identical to me with the same text.
Get "the properties" of each field and compare them line by line. I made a gadget many years ago to extract the properties that do not match between two such lists.
Craig
A fresh new label field and a fresh new regular field look identical to me with the same text.
Get "the properties" of each field and compare them line by line. I made a gadget many years ago to extract the properties that do not match between two such lists.
Craig
Re: What controls the space between lines in a field?
Checking the fixedLineHeight increases the space between lines.
The text in the two fields still look different. The fonts seem to be different.
The font property for both say "(text)" and grayed out.
The text font of the stack returns empty, so (I presume) it inherits the font from the system.
One difference between the two fields is that the bottom field is inside a group and the font property for the group says "(system)".
Thanks,
Sri
- Attachments
-
- linespace1.png (13.33 KiB) Viewed 8792 times
Re: What controls the space between lines in a field?
I am unable to reproduce this problem in a fresh stack.
The label field must be corrupted, somehow.
As I increase its textSize, only the line height is adjusted. The font size remains at 12 (although the inspector shows 13, 14, ... as I modify).
I'll just delete that field and redo.
Sorry for wasting your time, folks!
Regards,
Sri
The label field must be corrupted, somehow.
As I increase its textSize, only the line height is adjusted. The font size remains at 12 (although the inspector shows 13, 14, ... as I modify).
I'll just delete that field and redo.
Sorry for wasting your time, folks!
Regards,
Sri
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: What controls the space between lines in a field?
Are you setting the font size of the field object, or the text within it?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: What controls the space between lines in a field?
Never realized the distinction!FourthWorld wrote: ↑Sun Feb 02, 2020 3:21 amAre you setting the font size of the field object, or the text within it?
I set the textSize of the field with either
set the textSize of selObj() to 14
or
set the textSize of field "MyField" to 14
When I try
set the textSize of the text of field "MyField" to 14
I get the execution error:
Error description: Chunk: error in object expression
I did not try
set the textSize of the selectedText of field "MyField" to 14
since it is a label field.
Regards,
Sri
Re: What controls the space between lines in a field?
Hi,
You cannot set the textSize of "the text". In the situation that Richard is talking about, set a chunk expression:
This sets the whole text. It is less silly than:
Craig
You cannot set the textSize of "the text". In the situation that Richard is talking about, set a chunk expression:
Code: Select all
set the textSize of char 1 to (the length of fld 1) of fld 1 to "22"
Code: Select all
set the textSize of char 1 to 1000000 of fld 1 to "22"
Re: What controls the space between lines in a field?
or
?
Code: Select all
char 1 to -1 of fld 1...
Kaveh
Re: What controls the space between lines in a field?
Craig:
This is interesting!
Your code works. In fact, setting it to empty with
solved the problem, and the text "inherited" the textSize of the field (which itself is empty, and inherits, I presume, from the system).
This means something was "intercepting" the field setting from reaching the text. I wonder what?
Thanks,
Sri
This is interesting!
Your code works. In fact, setting it to empty with
Code: Select all
set the textSize of char 1 to (the length of fld 1) of fld 1 to empty
This means something was "intercepting" the field setting from reaching the text. I wonder what?
Thanks,
Sri
Re: What controls the space between lines in a field?
Sri,
Glad to hear, and you have all that right.
Just to go back, the "text" is a property, as is the "textSize", and if you think about it, you cannot set a property of a property. It would be the same as trying to set, say, the backColor of the topLeft...
Craig
Glad to hear, and you have all that right.
Just to go back, the "text" is a property, as is the "textSize", and if you think about it, you cannot set a property of a property. It would be the same as trying to set, say, the backColor of the topLeft...
Craig
Re: What controls the space between lines in a field?
Craig:
Yes, I see that!
I realized the effort to make LC script more English-like and forgiving of loose syntax has created some pitfalls for non-experts like me.
For example,
the selectedText of field "MyField"
is a function, not a property!
I have been tripped up by such "oddities" more than once!
Regards,
Sri
Yes, I see that!
I realized the effort to make LC script more English-like and forgiving of loose syntax has created some pitfalls for non-experts like me.
For example,
the selectedText of field "MyField"
is a function, not a property!
I have been tripped up by such "oddities" more than once!
Regards,
Sri
Re: What controls the space between lines in a field?
Yep, that's why we can also script (more function-like):

Code: Select all
...
put selectedText(fld "MyField")
...
put height(btn 3)
...
## etc...
...
## And also:
...
put the sum of "1,2,3,4"
### instead of
put sum(1,2,3,4)
...
