Text Flow

Mike Doub mikedoub at gmail.com
Wed Sep 16 07:37:20 EDT 2015


There is a routine in the masterlibrary that calculates soft line wraps to solve the wrapping problem to which James referred.  

I created it when I used the hidden field approach simulating page turning. 

https://www.dropbox.com/s/3wpwn3hfbmpl7sk/MasterLibrary.livecode?dl=0



On Sep 16, 2015, 4:26 AM, at 4:26 AM, James Hale <james at thehales.id.au> wrote:
>One way is to have a hidden field the dimensions you want. Put the text
>into this field first and then get the pageranges of this field. It
>will return a list of character ranges, one per line, for each field
>(of the hidden field's size) required.
>So the number of lines will tell you how many fields, the character
>ranges, what to put into them.
>E.g. (Watch for line wraps)
>        Put mytext into field "hidden"
>        Put the pageRanges of field "hidden" into tranges
>        Put the number of lines of tranges into requiredFields
>--put the code to make or display the requisite number of fields here..
>        --I have assumed fields are called "display1", "display2", etc
>       Repeat with fnum = 1 to requiredFields
>       Put item 1 of line fnum of tranges into tstart
>       Put item 2 of line fnum of tranges into tend
>      Put char (tstart) to (tend) of mytext into field ("display"&fnum)
>      Next repeat
>
>James
>
>
>
>_______________________________________________
>use-livecode mailing list
>use-livecode at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list