Character

The character object represents an individual character within the text shape. Each character in the text shape can be customized with various properties, such as font style, size, direction, or even apply different hatching styles to specific characters within the text shape. This flexibility enables the creation of unique text designs for the marking process.

The text shape processes individual characters first and subsequently applies the properties configured within the shape to all of them.

Properties

Angle Gets or Sets the angle of a character
Backward Gets or sets whether the character is reversed in direction.
CharacterGap Gets or sets the gap between two characters.
CharacterUnicode Get or set the associated unicode or regular character.
FontName Gets or sets the font name of the character.
FontStyle Gets or sets the font style used for the character.
Height Gets or sets the character height
ItalicAngle Gets or sets the slant angle of the character.
ScaleX Gets or sets the percentage scaling in the X axis direction.
ScaleY Gets or sets the percentage scaling in the Y axis direction.
UpsideDown Gets or sets whether the character is flipped upside down.

Methods

AddHatchPattern Adds a hatch pattern to the character.
AddHatchPatternHelixFilling Adds a helix type pattern to the character
AddHatchPatternLine Adds a Line type pattern to the character
AddHatchPatternOffsetFilling Adds an Offset filling type pattern to the character
AddHatchPatternOffsetInOut Adds an Offset In Out filling type pattern to the character
ClearHatchPatterns Clears all the associated hatch patterns from the Character
Subscript Subscript this character by the amount specified and size.
Superscript Superscript this character by the amount specified and size.
NoScript Removes any sub or superscript settings associated with this character.

 

The following sample demonstrates the image illustrated above as an example.

Copy
 scanDocument = scanDeviceManager.CreateScanDocument(GetselectedDeviceUniqueName(), DistanceUnit.Millimeters, false);

 if (scanDocument != null)
 {
     VectorImage vectorImage = scanDocument.CreateVectorImage("image1", drillUnits);

     vectorImage.SetMarkSpeed(1000);
     vectorImage.SetJumpSpeed(2000);
     vectorImage.SetJumpDelay(100);
     vectorImage.SetMarkDelay(100);

     //Set Laser Delays
     vectorImage.SetLaserOnDelay(10);
     vectorImage.SetLaserOffDelay(10);


     TextShape text = new TextShape();

     Character character = new Character();
     character.CharacterUnicode = 'A';
     character.Height = 5;
     character.FontName = "Arial";
     character.FontStyle = FontStyle.Regular;

     text.Characters.Add(character);

     character = new Character();
     character.CharacterUnicode = 'B';
     character.Height = 5;
     character.FontName = "Arial";
     character.FontStyle = FontStyle.Regular;
     character.Backward = true;

     text.Characters.Add(character);

     vectorImage.AddText(text);


     character = new Character();
     character.CharacterUnicode = 'C';
     character.Height = 5;
     character.FontName = "Arial";
     character.FontStyle = FontStyle.Regular;

     text.Characters.Add(character);

     vectorImage.AddText(text);

     scanDocument.Scripts.Add(new ScanningScriptChunk("defaultScript", "ScanAll()"));

     try
     {
         scanDocument.StartScanning();
     }
     catch
     {

     }
 }