Page 1 of 1

Fixed line height in fields - LC7/LC8 differences

Posted: Wed Oct 26, 2016 10:46 am
by paulclaude
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):
screenshot-26.10.2016_112118.png
In LC8, the same field appears messy (and so the text insertion point):
screenshot-26.10.2016_112141.png
Someone knows if it's a bug or a deliberate change?

Paul Claude

Re: Fixed line height in fields - LC7/LC8 differences

Posted: Wed Oct 26, 2016 2:58 pm
by FourthWorld
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?

Re: Fixed line height in fields - LC7/LC8 differences

Posted: Wed Oct 26, 2016 5:03 pm
by paulclaude
Hi Richard, please see this little new example in LC7:
screenshot-26.10.2016_175510.png
and the same, untouched stack, open with LC8:
screenshot-26.10.2016_175405.png
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>
PaulClaude

Re: Fixed line height in fields - LC7/LC8 differences

Posted: Wed Oct 26, 2016 5:35 pm
by FourthWorld
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?

Re: Fixed line height in fields - LC7/LC8 differences

Posted: Thu Oct 27, 2016 9:18 am
by paulclaude
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.
Test1.livecode.zip
(1.16 KiB) Downloaded 247 times

Re: Fixed line height in fields - LC7/LC8 differences

Posted: Thu Oct 27, 2016 3:03 pm
by FourthWorld
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.

Re: Fixed line height in fields - LC7/LC8 differences

Posted: Thu Oct 27, 2016 3:26 pm
by paulclaude
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)...

Re: Fixed line height in fields - LC7/LC8 differences

Posted: Sat Nov 26, 2016 1:41 pm
by sphere