%%PageItemTitle%%

VectorDraw Web Library

JsPropertiesExtractor Send comments on this topic.
textstyle Method
See Also  Example
vdWebLibrary Namespace > ScriptCommands Class : textstyle Method
name
The name of an existing textstyle in the GetTextStyles. If the passed name does not exist then the last selected is used.
height
A positive number greater than 0 that represents the height of text objects in Drawing Units
horjustify
A constant string value for the horizondal text justification. Valid values are 'left' or 'right' or 'center'.Set it to empty '' string in order the last selected to be used.
verjustify
A constant string value for the vertical text justification. Valid values are 'bottom' or 'top' or 'center' or 'base'. Set it to empty '' string in order the last selected to be used.
Set the passed textstyle name as active. Commands that create new text objects like text select this textstyle for created entities.

Syntax

JScript 
public function textstyle( 
   name : String,
   height : double,
   horjustify : String,
   verjustify : String
);

Parameters

name
The name of an existing textstyle in the GetTextStyles. If the passed name does not exist then the last selected is used.
height
A positive number greater than 0 that represents the height of text objects in Drawing Units
horjustify
A constant string value for the horizondal text justification. Valid values are 'left' or 'right' or 'center'.Set it to empty '' string in order the last selected to be used.
verjustify
A constant string value for the vertical text justification. Valid values are 'bottom' or 'top' or 'center' or 'base'. Set it to empty '' string in order the last selected to be used.

Example

C#Copy Code
vdrawobj.scriptCommand.textstyle('standard', 2.5, 'center', 'center'); 
vdrawobj.scriptCommand.text();//all the user text will be added using the 'standard' textstyle with height 2.5 drawing units and center justification.

See Also