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

Problems with ITextFrame::GetMatrix function

Explorer ,
Feb 23, 2012 Feb 23, 2012

Can anyone explain the values of the matrix returned from the ITextFrame::GetMatrix() function (wrapper for sTextFrame->GetMatrix()).

The a,b, c and d values which represent the rotation (and possibly the shear deformation) are OK,

but I can't relate the tx and ty values to the position of the text object on the artboard.

As a test I tried the following code:

AIErr

CreatePointText( short paintOrder, AIArtHandle prep,

                 AIRealPoint *textPoint, AIArtHandle *newText)

{

     AIError error;

     error = sAITextFrame->NewPointText( paintOrder, prep,

                                         kHorizontalTextOrientation,

                                         textPoint, newText);

   

     TextFrameRef ateTextRef;

     error = sAITextFrame->GetATETextFrame( *newText, &ateTextRef);

     ATE::ITextFrame ateText( ateTextRef);

         

     AIRealMatrix matrix = (AIRealMatrix) ateText.GetMatrix();


}

But the tx and ty values returned in matrix are now both 0.  They should equal textPoint.h and textPoint.v, shouldn't they?

TOPICS
SDK
1.6K
Translate
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
Adobe
Explorer ,
Feb 23, 2012 Feb 23, 2012

It seems that a newly created point text object will  have tx and ty equal to zero.

If I duplate that object by alt-dragging it to another location,  tx and ty will have location relative to the original object.

If I rotate the original object tx and ty will have non-zero values.

I need absolute coordinates...

Agnar

Translate
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
Guest
Feb 23, 2012 Feb 23, 2012

Looks like you should check out the Hard and Soft coordinates functions.

Translate
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
Explorer ,
Feb 23, 2012 Feb 23, 2012

Tried that now. Didn't make a difference...

Agnar

Translate
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
Explorer ,
Feb 24, 2012 Feb 24, 2012
LATEST

Found a workaround.  I need the coordinates of the text anhor for point text and expected that the ITextFrame::GetMatrix method would provide this in the matrix' tx and ty memebers,  It doesn't! I guess it should, so it's a bug.

However, the AITextFrameSuite (not TextFrameSuite , these are two different suites) has a GetPoinTextAnchor function that gets the coordinates.

Agnar

Translate
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