Wednesday, July 27, 2016

CGTEXT CLASS

This is a Mac only REALbasic class that will give you the ability to draw text in a Rb Canvas with more control and functionality using the Core Graphics framework in OS X. The class is free, but is encrypted. The download includes a demo project.
The class allows you to set the following.

SSCGText

*Character Spacing (single). The default setting is 0.25.
*Dash (Boolean). The pen style on TextFillStroke Fonts can be drawn with a dashed styled. The default setting is False.
*Drawing Mode (String). This setting determines the style of the font drawn. Available settings are, Text Fill, Text Stroke, Text Fill Stroke. The default setting is Text Fill.
*Fill Alpha (single). The color of the fill can be assigned an alpha value. The default setting is 1.0.
*Fill Color (color). The color of the fill can be assigned a color. The default setting is black.
*Font Name (string). You can assign the PostScript name of the font family. he default setting is “Verdana”.
*Font Size (single). You can assign the size of the font to be drawn. The default setting is 11.0.
*Pen Alpha (single). The pen alpha value can be assigned a value. The default setting is 1.0.
*Pen Color (color). The color of the pen can be assigned a color. The default setting is black.
*Pen Width (single). The pen width can be assigned a value. The default setting is 0.50.
*Rotate (single). The entire CGText object can be rotated. Positive values rotate clockwise. The default setting is 0.0.
*ScaleX (single). The entire CGText object can be scaled in the X direction. The default setting is 1.0.
*ScaleY (single). The entire CGText object can be scaled in the Y direction. The default setting is 1.0.
*Shadow (Boolean). The entire CGText object can given a shadow object. The default settings is False. When set to true the values for the shadow are, offset width 3.0, offset height -3.0 and blur value of 1.0.
*Should Alias (Boolean). The CGText object can be drawn without anti alias, i.e. jaggies. The default settings is False.
*Text (String). This is the text that the CGText object will draw. The default settings is empty (“”).
*Draw (Method). This is the method you call to show your CGText object. This Method should be called in the Paint Event of its associated Canvas.
*Constructor (Canvas). The CGText object is created by passing it the Rb Canvas you want it to be drawn in.

Original article (http://mauitom.maui.net/Real_Studio_Projects/CGText_Class.html
Copyright © Xojo.pro | Created by Rbcafe