Page 1 of 1

full text justification

Posted: Wed Apr 30, 2014 3:21 pm
by dave.kilroy
Hello all LiveCode gurus, grand masters, big cheeses, little cheeses and total newbies

I need to be able to display fully justified text in a LiveCode field - I found some code that Brian Yennie wrote in 2007 (http://thread.gmane.org/gmane.comp.ide. ... cus=100322 thanks Brian!) that I've tweaked and have now got justified text that seems OK (if you don't look too closely). I'm including the stack here in the hope that others might find it of use - and that some of you will be able to suggest ways to improve what I've got and move us on towards something like 'proper' justified text which we can all benefit from.

Of course in the long-term LiveCode will have a 'full justify' options on its fields and the feature request for this is http://quality.runrev.com/show_bug.cgi?id=4714

So, please check out the hack code in my stack and let me have your suggestions on how to progress things

Kind regards

Dave

PS: new versions of the stack will always be attached to the first posting of this thread

Re: full text justification

Posted: Wed Apr 30, 2014 3:28 pm
by Dixie
That's neat...:-) I like this !

Re: full text justification

Posted: Wed Apr 30, 2014 3:32 pm
by dave.kilroy
Thanks Dixie :)

Like I say it's mostly copied from Brian's work and then tweaked - but it is most certainly a hack (in the not-yet-cooked sense) and could do with a lot of attention from coders here...

Dave

Re: full text justification

Posted: Wed Apr 30, 2014 3:51 pm
by FourthWorld
Nicely done, Dave - thanks for posting that!

Re: full text justification

Posted: Wed Apr 30, 2014 5:10 pm
by dave.kilroy
Just tried this on Windows and it's a mess! Will figure out what is happening and upload a new version...

Re: full text justification

Posted: Wed Apr 30, 2014 7:55 pm
by dave.kilroy
Hi all

OK discovered the problem when on Windows 7 was that I was using LC 6.6.2(rc2) - when I changed to LC 6.6.1 everything calmed down (although I did have to prevent my tweakJustification handler running on Windows which means the right-hand margin is a bit less uniform). New version with these changes available here: [edit] actually in order to avoid confusion I've moved the new version to the first posting in this thread[\edit]

So, it appears there is a bug on LC 6.6.2(rc2) when on Windows - I'll file a bug report...

Kind regards

Dave

Re: full text justification

Posted: Wed Apr 30, 2014 8:21 pm
by dave.kilroy
Bug report for difference in how LC 6.6.2(rc2) responds to formattedWidth filed at http://quality.runrev.com/show_bug.cgi?id=12332

...although maybe it isn't a bug at all but a foreshadowing of new field properties...

Dave

Re: full text justification

Posted: Wed Apr 30, 2014 8:52 pm
by dave.kilroy
I don't think this is a bug anymore - just a mystery...

I had been doing some testing and discovered it now runs in Windows with LC 6.6.2(rc2)!! I don't really know why ... but as long as you use the latest version it now appears to run fine :o