• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

How to set the width of an AIArtHandle (textFrame) object

Explorer ,
May 30, 2022 May 30, 2022

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());

 

TOPICS
SDK

Views

57

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jul 04, 2022 Jul 04, 2022

I was able to figure this one out.

Likes

Translate

Translate
Explorer ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

LATEST

I was able to figure this one out.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines