Wednesday, December 12, 2012

TextArea LineSpacing and LineHeight


New to Real Studio in 2012 Release 2 are two new properties for TextArea: LineHeight and LineSpacing. As you might guess, these properties control the height of individual lines in a TextArea and the amount of space between each and every line in the TextArea. These properties affect all the text in the TextArea.

LineHeight and LineSpacing are fully supported on OS X Cocoa and Windows apps. LineSpacing works on Linux, but only if the Text Area contains a single TextSize.

You can change these properties using either the Properties Pane or in code.



LineSpacing
This value is a simple integer that sets the line spacing. For example, if you wanted the text in the TextArea to be double-spaced, then you would set LineSpacing to 2. LineSpacing is a Double so you can also using a decimal such as 1.5. So in the Open event handler of a TextArea, you can simply use this code:

Me.LineSpacing = 1.5


LineHeight
Used to adjust the height of each line, LineHeight allows you to adjust the height using whatever is specified as the TextUnit for the TextArea. So on OS X, you can adjust the LineHeight using points like this (in the TextArea Open event handler):

Me.LineHeight = 18

You can see the differences in the screenshot below:


2 comments:

SteveLight said...
This comment has been removed by the author.
SteveLight said...

The question is does textarea.rtfdata supports both new options?