newObjects Active Label TextDefaults object

Obtained from the VisiLabel object:
td = VisiLabel.TextDefaults;
The TextDefaults object exposes several text formatting related properties. They are used for initialization by the drawing objects (elements) which display text. For example when you add a new text label element it will use the font specified by the TextDefaults unless you change it explicitly by changing the new element's properties. Note that the different elements have different features and they will use only the text defaults they support. For instance the Alignment is inappropriate for a Barcode element because the alignment of the text shown in a barcode element is a subject of more sophisticated placement rules, on the other hand the FontFace, FontSize and so on are obviously applicable and the newly created Barcode elements will use them as initial settings.

Members reference:

Properties
FontFace String. Specifies the default face name for the font used by the elements on the label.
Syntax:
obj.FontFace = "Arial"; // Specifies font face Arial
vfontface = obj.FontFace;

Remarks:
In WEB applications you should use fonts that are installed on the client machines. Because Active Label is most often used in intranets this is not a problem, but the administrators should make sure all the fonts in use are installed on the workstations.  
FontSize Specifies the default size of the font used by the elements on the label. The size is specified in the current measurement units.
Syntax:
obj.FontSize = 300; // If the default settings are in effect this specifies font size of 3 millimeters
vsize = obj.FontSize;

Remarks:
Note that in contrast with the most applications Active Label uses the same measurement units for all the sizes and locations - including the font size. We believe this is more convenient when the content must be fit on very small sized areas such as sticky labels.
Bold Boolean. Specifies if the default font used by the elements is bold.
Syntax:
obj.Bold = true; // Make the text bold
vbold = obj.Bold;
Itallic Boolean. Specifies if the default font used by the elements is italic.
Syntax:
obj.Itallic = true; // Make the text itallic.
vbold = obj.Itallic;
Underline Boolean. Specifies if the default font used by the elements is underlined.
Syntax:
obj.Underline = true; // Make the text underlined.
vbold = obj.Underline;
Charset Specifies the default font charset to be used by the elements on the label. See the remarks below.
Syntax:
obj.Charset = 204; // Sets cyrillic charset
v = obj.Charset;

Remarks:
Active Label is implemented for the ANSI subsystem and not for the UNICODE subsystem. This makes it compatible with all the Windows versions - even Windows 95 without need of additional system updates. Thus when working with fonts that contain characters for multiple alphabets you will need to specify which one to use. Each element may have different charset thus you can display elements in different languages on the same label. See also the CodePage property.
Alignment Specifies the default text alignment: -1 - left (default); 0 - centered; 1 - right.
Syntax:
obj.Alignment = 1; // Make the text alignment
vcuralign = obj.Alignment;

Remarks:
For text labels the alignment is actually the location of the element's reference point (i.e. the point which is specified by the X and Y properties - see Label coordinate space).
Orientation Long integer. Specifies the default text orientation in degrees. The angle grows in clockwise direction.
Syntax:
obj.Orientation = 90; Rotate the text 90 degrees clockwise
vdirection = obj.Orientation;
Transparent Specifies the draw mode for texts: True - Transparent, False - opaque
Syntax:
obj.Transparent = true; // Makes the element transparent
v = obj.Transparent;

Remarks:
The effect of this property may differ for the different element types. For example a text label or a text box will draw the text background if this is set to false. Otherwise they will draw only the text not touching the background.
CodePage Sets/gets the default code page as numeric value. The code page is used for all the text translations from UNICODE to ANSI and reverse.
Syntax:
obj.CodePage = value;
cp = obj.CodePage;

Remarks:
By default the system's code page is used. This is usually enough for the most applications, but if you need to place texts in different languages on the label you may need to change the code page of some of the text elements.
VisiLabel Returns the VisiLabel object to which the TextDefaults object belongs.
For example: oVisiLabel.TextDefaults.VisiLabel will return reference to the same object that is referred by oVisiLabel
Methods
ShowProperties Displays the property sheets of the default text settings.
Syntax:
obj.ShowProperties();

Remarks: 

 

 

 

newObjects Copyright 2001-2006 newObjects [ ]