Copy link to clipboard
Copied
I have the following code that creates "labels" (adds text to my document). That all works. What I want to do is to make the "labels" a uniformed width so that I can align them. The result will be that they all end at the same place when justified. Any suggestions? I was trying to use GetArtBounds(), GetArtTransformBounds() to set the width but no luck.
AIRealPoint anchor = { frmX, frmY };
AIArtHandle textFrame = NULL;
error = sAITextFrame->NewPointText(kPlaceAboveAll, NULL, kHorizontalTextOrientation, anchor, &textFrame);
//Create the ATE range
ATE::TextRangeRef textRangeRef = NULL;
error = sAITextFrame->GetATETextRange(textFrame, &textRangeRef);
ATE::ITextRange textRange(textRangeRef);
ATE::ICharFeatures features;
features.SetFontSize(fontSize);
features.SetFillColor(fontColor);
textRange.SetLocalCharFeatures(features);
// Set the contents of the text range.
textRange.InsertAfter(ai::UnicodeString(frmText).as_ASUnicode().c_str());
I was able to figure this one out.
Copy link to clipboard
Copied
I was able to figure this one out.