Page 1 of 1

Fixedwidth font is not fixed

Posted: Tue Dec 10, 2013 3:52 pm
by Maxiogee
I wish to use a fixed with font in a scrolling field to along certain sections of each line, to make reading the field easier.

I have used Courier on Mac OSX 10.9, using LiveCode 6.5.0

In TextEdit, the text aligns as I wish it to.
In LiveCode it is all awry.

The text has been aligned by setting the itemdelimiter to "|", calculating which line has the longest item 1 and adding " " to each line's item 1 until all lines have the same number of characters in their first item.

This screen capture shows the difference between how the same text looks in both apps.

What can I do to make LiveCode align the text?

Image

Re: Fixedwidth font is not fixed

Posted: Tue Dec 10, 2013 11:50 pm
by Simon
Hi Maxiogee,
I've just done a test in liveCode using Courier font an it does line up correctly.
I think you should copy the liveCode text field you are displaying and paste it into TextEdit to see if it lines up again. I think it wont. Check your code that enters the spaces.

Simon

Re: Fixedwidth font is not fixed

Posted: Tue Dec 10, 2013 11:54 pm
by SparkOut
Instead of padding with spaces, can't you use a tab-delimited set of data with tabstops set on the field to display?

Re: Fixedwidth font is not fixed

Posted: Wed Dec 11, 2013 1:07 pm
by Klaus
Hi guys,

If I remember correctly from the mailing list, this is a known bug in LC 6.x
and should be fixed in one of the next releases.


Best

Klaus

Re: Fixedwidth font is not fixed

Posted: Wed Dec 11, 2013 10:40 pm
by Maxiogee
Simon wrote:Hi Maxiogee,
I've just done a test in liveCode using Courier font an it does line up correctly.
I think you should copy the liveCode text field you are displaying and paste it into TextEdit to see if it lines up again. I think it wont. Check your code that enters the spaces.

Simon
That, Simon, is how I got that image I posted.

The text came from LiveCode to TextEdit, not the other way around.

Re: Fixedwidth font is not fixed

Posted: Wed Dec 11, 2013 10:42 pm
by Maxiogee
SparkOut wrote:Instead of padding with spaces, can't you use a tab-delimited set of data with tabstops set on the field to display?
Thanks SparkOut,
Unfortunately each card has a different maximum length to Item 1.
This means than some cards have extremely long lengths, which push ,much of the line offscreen.
I would not want to standardise the line length across all cards.

Re: Fixedwidth font is not fixed

Posted: Wed Dec 11, 2013 10:44 pm
by Maxiogee
Klaus wrote:If I remember correctly from the mailing list, this is a known bug in LC 6.x
Thanks Klaus.
I suspected, and feared, as much.

Klaus wrote:and should be fixed in one of the next releases.
I hope so.

Re: Fixedwidth font is not fixed

Posted: Wed Dec 11, 2013 10:57 pm
by SparkOut
Maxiogee wrote:
SparkOut wrote:Instead of padding with spaces, can't you use a tab-delimited set of data with tabstops set on the field to display?
Thanks SparkOut,
Unfortunately each card has a different maximum length to Item 1.
This means than some cards have extremely long lengths, which push ,much of the line offscreen.
I would not want to standardise the line length across all cards.
No, but if you are calculating the amount of spaces to pad the first item, then you can calculate a suitable tabstop, surely?

Re: Fixedwidth font is not fixed

Posted: Thu Dec 12, 2013 2:57 am
by Simon
hmmm...
Must just be on Mac then
2013-12-11_1752.png
Win 7 it's aligned

Code: Select all

on mouseUp
   put "" into fld 1
   put  "I wish to use a fixed with font" & cr & \
         "I have used Courier on Mac OSX" & cr & \
         "In TextEdit" & cr & \
         "In LiveCode" & cr & \
         "The text has been"  into tText
   put the num of chars of line 1 of tText into tNum --cheat I already know it's the longest line
   repeat for each line tLine in tText
      put the num of chars of tLine into tCount
      put tNum - tCount into tSpace
      repeat with x = 1 to tSpace
         put space after tLine
      end repeat
      put tLine & "|" & cr after fld 1
   end repeat
end mouseUp
Simon

Re: Fixedwidth font is not fixed

Posted: Sat Dec 14, 2013 1:03 pm
by Maxiogee
Maxiogee wrote:
Klaus wrote:If I remember correctly from the mailing list, this is a known bug in LC 6.x
Thanks Klaus.
I suspected, and feared, as much.

I can confirm that it is a 6.x issue.

I have just now opened all the affected stacks with LiveCode 5.5.4 — having viewed them (with the non-alignment visible) first in LiveCode 6.5 — and the lines along perfectly.
Saving them in 5.5.4 and opening them in 6.5 the fault reappears immediately.

Re: Fixedwidth font is not fixed

Posted: Sat Dec 14, 2013 1:19 pm
by Klaus
Could you please report this as a bug? http://quality.runrev.com
Thanks!

Re: Fixedwidth font is not fixed

Posted: Sat Dec 14, 2013 7:35 pm
by Maxiogee
Klaus wrote:Could you please report this as a bug? http://quality.runrev.com
Thanks!
Done

Re: Fixedwidth font is not fixed

Posted: Sun Dec 15, 2013 9:24 pm
by jacque
The calculations for text width were broken in LiveCode 6.5, but have been fixed in 6.5.1 rc 1. If you have that version, try it there. My current project was misbehaving in multiple ways because of the bug, but in the latest rc everything went back to normal. Someone at RR must have noticed, because when I searched for a related bug report I couldn't find one, and I was about to enter one until I thought to test in the latest version.