I've tried to clip a text in a rectangle and I would have expected the text would have wrapped inside the rectangle.
I do not seen a command for creating a text behaving like the svg "textarea" element.
Maybe I missed something in the documentation. If not, is there any plan to support this behavior in a future version?
Clipping text in a shape - Wrapping text
-
- VIP Livecode Opensource Backer
- Posts: 163
- Joined: Tue Jan 26, 2010 10:15 pm
- Contact:
Clipping text in a shape - Wrapping text
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
Re: Clipping text in a shape - Wrapping text
You have a good point - the current 'fill text' syntax could do with some refinement. How about this:
To fill a text string without implicitly breaking the text into lines at a given point use:
By default 'point' is taken to be the left-side baseline anchor of the text. 'ascent' makes it the left-side ascent anchor (i.e. ascent above the baseline); and similarly for 'descent'.
To fill a text string with implicit breaking and alignment within a rectangle use:
The text will be broken into lines using the width of the rect as the layout widget. The logical size of the text, after being broken into lines, will be taken and then positioned within the rectangle with the given alignment. (Note that there is no clipping down here, the rect is just used for alignment - if you want to clip to the rect, an explicit command will be needed to set the clip).
To fill a text string without implicitly breaking the text into lines at a given point use:
Code: Select all
fill text <expr> [ with ( ascent | descent | baseline ) ] at <point>
To fill a text string with implicit breaking and alignment within a rectangle use:
Code: Select all
fill text <expr> at <alignment> of <rect>
-
- VIP Livecode Opensource Backer
- Posts: 163
- Joined: Tue Jan 26, 2010 10:15 pm
- Contact:
Re: Clipping text in a shape - Wrapping text
@LCMark
Sounds great, thanks.
Btw, any chance to have the "text path" implemented?
Sounds great, thanks.
Btw, any chance to have the "text path" implemented?
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
Re: Clipping text in a shape - Wrapping text
@LCMark is there any possibility to have both vertical and horizontal alignment options when filling text within a rectangle? So <alignment> would be:
Code: Select all
[ (top | middle | bottom) ] [( left | center | right)]
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: Clipping text in a shape - Wrapping text
@monte: Hmmm - you can do 'top right', 'top left', 'bottom right', 'bottom left', 'left', 'right', 'center' - but not 'middle' it would appear. I think the 'middle' combinations are an oversight. Filed as http://quality.runrev.com/show_bug.cgi?id=15144.