Fixed line height in fields - LC7/LC8 differences
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Fixed line height in fields - LC7/LC8 differences
In LC7, changing the size of a font in a field with a fixed line height, gave this (Font size: 18, Fixed Line Height: 18):
Paul Claude
In LC8, the same field appears messy (and so the text insertion point):
Someone knows if it's a bug or a deliberate change?Paul Claude
-
- VIP Livecode Opensource Backer
- Posts: 10057
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Fixed line height in fields - LC7/LC8 differences
Neither look like the default settings of a field object.
Testing here the differences are very minimal - this screen shot has v6, 7, and 8 from left to right, using only the default settings of the field. V8 shows a larger default font size because the engine is now better at picking up the default OS font (I'm running Ubuntu at the moment). But in all three cases the line spacing relative to the font size is fairly consistent, and baselines are where we'd expect them.
Have you set the textShift of the field contents, perhaps also with change to the textHeight of the field?
Testing here the differences are very minimal - this screen shot has v6, 7, and 8 from left to right, using only the default settings of the field. V8 shows a larger default font size because the engine is now better at picking up the default OS font (I'm running Ubuntu at the moment). But in all three cases the line spacing relative to the font size is fairly consistent, and baselines are where we'd expect them.
Have you set the textShift of the field contents, perhaps also with change to the textHeight of the 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
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Fixed line height in fields - LC7/LC8 differences
Hi Richard, please see this little new example in LC7:
PaulClaude
and the same, untouched stack, open with LC8:
If you want to test it by yourself, this is the htmlText (the target fld has a fixed line height of 18):
Code: Select all
<p><font size="18">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</font></p>
<p></font><font face="Carta" size="18">sax</font></p>
-
- VIP Livecode Opensource Backer
- Posts: 10057
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Fixed line height in fields - LC7/LC8 differences
Could you kindly post the zipped stack? That would be very helpful in allowing me to see this in action more quickly.
And why have a fixed textHeight of 18 when the textSize is also 18? Wouldn't you want some leading between the lines?
And why have a fixed textHeight of 18 when the textSize is also 18? Wouldn't you want some leading between the lines?
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
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Fixed line height in fields - LC7/LC8 differences
I need a text field with different fonts and font sizes, but with a fixed line height, for several reasons (as for the legal acts that need a fixed number of rows in a page). With LC7 and previous versions there was no problem, but It seems that LC8 has changed the managing of text fields.
Please find enclosed the simple stack I've made (you need to have also the "Carta" font installed, but this font is default on every Mac). If you open it with LC7 and LC8, you will see the difference, as the images I've posted before.
Please find enclosed the simple stack I've made (you need to have also the "Carta" font installed, but this font is default on every Mac). If you open it with LC7 and LC8, you will see the difference, as the images I've posted before.
-
- VIP Livecode Opensource Backer
- Posts: 10057
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Fixed line height in fields - LC7/LC8 differences
Thanks. Looks like the issue is either specific to macOS, or perhaps the Carta font - as shown in the screen shot below, on Ubuntu the fields look fine in both 7 (at left) and 9 (at right). Testing in the most recent build (current v9 dp1) can be very helpful here as a way of checking whether the source of the issue has already been addressed.
If anyone here can confirm this on macOS in v9 it may be helpful to file a bug report.
As for the textSize, I can appreciate the need for a fixed textHeight, but setting the textHeight to the same as the textSize means the field has no space between lines, which may be contributing to the trouble it's having attempting to fit them in.
Try bumping up the textHeight a few px and see if that helps. Ideally it should simply crop text when the textHeight doesn't allow for the full rendering of the letters at a given textSize, and that may well be a recently-introduced bug. But if just bumping the textHeight to a value large enough to allow reading does what you need at least you'll be set on this for now.
If anyone here can confirm this on macOS in v9 it may be helpful to file a bug report.
As for the textSize, I can appreciate the need for a fixed textHeight, but setting the textHeight to the same as the textSize means the field has no space between lines, which may be contributing to the trouble it's having attempting to fit them in.
Try bumping up the textHeight a few px and see if that helps. Ideally it should simply crop text when the textHeight doesn't allow for the full rendering of the letters at a given textSize, and that may well be a recently-introduced bug. But if just bumping the textHeight to a value large enough to allow reading does what you need at least you'll be set on this for now.
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
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Fixed line height in fields - LC7/LC8 differences
I think the Carta font (and maybe other fonts with symbols or special chars) is part of the problem, but the same problem does not occur with LC6 or LC7.
For my app, I need to have no space between lines (as for chords on a music sheet)...
For my app, I need to have no space between lines (as for chords on a music sheet)...