Thanks to Dave Kilroy for sharing the work around and the generosity of Mark Stephens of Simulytics for donating the code back to the LiveCode community, a new function is available to fully justify LiveCode text fields. LiveCode version >= 6.5 is required as it uses the measureText function which was introduced in 6.5. It doesn't work with the LC7 DP releases as the charIndex property seems to be missing - I assume it's down to the unicode changes that are underway. I've been testing on Mac / Linux and Windows - everything looks good so far !...
The code is in the public domain and completely free to use for any purpose
P.S. I'll ask at the jam if the unicode changes will mean losing any properties, etc. (I suspect not). It's not a big deal to alter the code slightly if charIndex did disappear.
Kevin confirmed that no text properties will be dropped in v7, so a bug report has been filed.
Full justification for LiveCode fields
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Full justification for LiveCode fields
Last edited by splash21 on Fri May 23, 2014 9:05 pm, edited 1 time in total.
LiveCode Development & Training : http://splash21.com
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Location: Plymouth, UK
- Contact:
Re: Full justification for LiveCode fields
Thanks John - very nice work!
Kind regards
Dave
Kind regards
Dave
"...this is not the code you are looking for..."
-
- VIP Livecode Opensource Backer
- Posts: 9844
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Full justification for LiveCode fields
Wonderful work - thank you!
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
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: Full justification for LiveCode fields
Thanks for the feedback. I've made a small performance tweak (v1.01) which may save a few cycles on really large text - every little helps!
I've also uploaded a tweaked version that will work with the LC7 DP releases that don't have the charIndex property. I've not timed the LC7 version (which uses offset instead of charIndex) - it may actuallt be faster.
I've also uploaded a tweaked version that will work with the LC7 DP releases that don't have the charIndex property. I've not timed the LC7 version (which uses offset instead of charIndex) - it may actuallt be faster.
LiveCode Development & Training : http://splash21.com