Get the matrix of global position for each character of text

This message follows this related post.

I need to get the position and orientation of the first and the last character in a text frame art, in other words, I need its matrix.

There are a number of functions of the API that is supposed to help you; An excerpt from the ATESuites.h file

/ * Return of this race transformation matrix.

The returned array spesify transformation complete the given execution.  You must transform the original by IGlyphRun::GetOrigins() and

Concat with ITextFrame::GetMatrix() in order to get the location of the glyphs.

*/

ATEErr (* GetMatrix) (GlyphRunRef glyphrun, ASRealMatrix * ret);

Therefore, get the matrix of the first character or glyph should look like this:

AIErr

VMGetFirstTextMatrix (AIArtHandle textArt, AIRealMatrix * matrix)

{

ASRealMatrix frameMatrix, glyphMatrix;

ASRealPoint firstPoint;

Try

{

TextFrameRef ateTextRef;

sAITextFrame-> GetATETextFrame (textArt, & ateTextRef);

TextFrame ITextFrame (ateTextRef);

ITextLinesIterator lnItr = textFrame.GetTextLinesIterator ();

TxtLine = lnItr.Item () ITextLine;

IGlyphRunsIterator grItr = txtLine.GetGlyphRunsIterator ();

GlyphRun IGlyphRun = grItr.Item ();

IArrayRealPoint pointArray = glyphRun.GetOrigins ();

firstPoint = pointArray.Item (0);   dating bad values!

frameMatrix = textFrame.GetMatrix ();

glyphMatrix = glyphRun.GetMatrix ();

Scissor-> AIRealMatrixConcatTranslate (& glyphMatrix,

(firstPoint.h, firstPoint.v);

Scissor-> AIRealMatrixConcat ((AIRealMatrix *) & glyphMatrix,)

(AIRealMatrix *) & frameMatrix,.

matrix);

return kNoErr.

}

catch (ATE::Exception e)

{

return e.error;

}

return kNoErr.

}

But the coordinates is returned in frameMatrix (tx and ty) or the firstPoint are clearly wrong. It seems they have a lag that is allmost constant.  The values of x are about 7664 too great points (give and take a few decimals), and values are about 7893 too large (also give and take a few decimals).

I'm puzzled by this, reall because I need to get precise positions...

Well, it worked eventually.

The ITextFrame::GetMatrix() method generally returns an identity matrix, unless I moved or transformed the object frame of text on the artboard.  For example, if I duplicated a text image object by dragging the object while pressing the alt key, this matrix will be transformation relative to the object that it was created. Since it is a relative transformation, it is not hard or soft coordinates, so it is foolish to harden or soften (in fact, you shouldn't do).

Then the IGlyphRun::GetMatrix() method typically returns the identity matrix, but will contain a rotation for example, if the object is a text on a path.

Finally, the IGlyphRun::GetOrigins() method returns hard coordinates for each glyph, but without the frame matrix transformation.  This method is insensitive to the GetCoordinateSystem / SetCoordinateSystem functions of the following system and returns the hard coordinates launch.

Thus, in order to get the actual art contact information for the Board of Directors of a glyph, the following code will do:

    IArrayRealPoint pointArray = glyphRun.GetOrigins();

    AIRealPoint firstPoint = pointArray.Item(0);

    AIRealMatrix frameMatrix = textFrame.GetMatrix();

    sMath->AIRealMatrixXformPoint( &frameMatrix, &firstPoint, &hardPoint);

    sHardSoft->AIRealPointSoften( &hardPoint, &glyphPoint);

In order to obtain the matrix of the absolute position of the first glyph of an art of text frame, the following function seems to work:

AIErr

GetFirstTextMatrix(  AIArtHandle textArt, AIRealMatrix *matrix)

{

    ASRealMatrix frameMatrix, glyphMatrix;

    ASRealPoint firstPoint, softPoint, hardPoint;

    try

    {

        TextFrameRef ateTextRef;

        sAITextFrame->GetATETextFrame( textArt, &ateTextRef);

        ITextFrame textFrame( ateTextRef);

 

        ITextLinesIterator lnItr = textFrame.GetTextLinesIterator();

        ITextLine txtLine = lnItr.Item();   

 

        IGlyphRunsIterator grItr = txtLine.GetGlyphRunsIterator();

        IGlyphRun glyphRun = grItr.Item();

 

        IArrayRealPoint pointArray = glyphRun.GetOrigins();

        firstPoint = pointArray.Item(0);

        sHardSoft->AIRealPointSoften( &firstPoint, &softPoint);

 

        frameMatrix = textFrame.GetMatrix();

        glyphMatrix = glyphRun.GetMatrix();

 

        sMath->AIRealMatrixXformPoint( &frameMatrix, &firstPoint, &hardPoint);

        sHardSoft->AIRealPointSoften( &hardPoint, &softPoint);

 

        sMath->AIRealMatrixConcat( (AIRealMatrix*) &glyphMatrix,

                  (AIRealMatrix*) &frameMatrix,

                  matrix);

 

        matrix->tx = softPoint.h;

        matrix->ty = softPoint.v;

 

        return kNoErr; 

    }

    catch (ATE::Exception e)

    {

        return e.error;

    }

}

But, this has not come easily, and I must be allowed to blame poor documentation on this subject...

Agnar

Tags: Illustrator

Similar Questions

  • How can I create a slide show 100% width, but have the caption in different positions for each slide.

    How can I create a slide show 100% width, but have the caption in different positions for each slide.

    There is placement of the legend only one for all the images in a slide show.

    The slideshow widget is specialized to create slideshows of the image. The widget of composition is a much more flexible widget which allows any combination of images and text in the trigger containers or containers of target of the widget. A widget of composition could be used to create a slide show with several legends by image and/or legends of different places for each image. The disadvantage of the widget of composition is that, due to the nature flexible widget, very little is automated for you and so it is much more intensive work to create a slideshow of images using the widget of composition.

    Thank you

    Sanjit

  • Where can I get the SRS Premium Sound Technology for my g7-1365dx

    I recently did a clean installation of Windows 8 on my HP Pavilion laptop 1365dx g7. I would like to know where I can get the SRS Premium Sound Technology for it. (the same one that was / is on my Windows 7 Home Premium)

    * I am dual-booting Windows 8 and my original Windows 7 Home Premium. Can I extract the files of this installation? *

    Any help would be greatly appreciated. In addition, I want to get all software of this facility (YouCam full HP Software Wizard, etc.)

    Thank you

    Stan [personal information deleted]

    If you want to install any software supplied with unit, then you will need to find the swsetup folder. To find the right folder program, will make you more than likely need to try running Setup in each file to find what you are looking for. The installer must list what it is and it can be cancelled. Some may have a file readme.txt as well, so this could be another way, if it is present.

    If you go to the folder of the application via the context menu, it will take you to the program folder files, that it has been installed. I can't guarantee a functioning copy / paste from there. Some programs must go through the registry to create a registry key to work and this is done during the installation process. Honestly, you should be able to access a partition from Windows. The partition of Windows 8 should be accessible from Windows 7 and the Windows 7 partition should be accessible from Windows 8.

  • I can't get the file number I need for the license transfer process. Help, please.

    I can't get the file number I need for the license transfer process. Help, please.

    To the link below, click on the still need help? the option in the blue box below and choose the option to chat...
    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If it fails to connect, try to use another browser.

    Get help from cat with orders, refunds and exchanges (non - CC)
    http://helpx.Adobe.com/x-productkb/global/service-b.html ( http://adobe.ly/1d3k3a5 )

  • The sum of total revenue for each customer unique and graphic it!

    Sunny greetings from Athens!  I walked for 5 hours for an elegant solution to the following:

    I want to add the total amount of revenue for each customer unique and graphic to view what customers bring in most of the species.

    Example of this in it:

    Customers Charged €
    A 100
    B 200
    C 250
    A 130
    A 120
    B 100

    Customers

    Total €
    A 350
    B 300
    C 250

    How this can be implemented by the numbers? As elegantly as possible?

    Hi menick,.

    SUMIF () will do the job.

    the formula in table 2::B2 =.

    SUMIF (table 1::A, A2, table 1::B)

    It is filled down.

    Quinn

  • whenever I type in the google box to search for each letter i firefox type which application I would like to use to open this file, this is so embarrassing, how to stop this?

    whenever I type in the google box to search for each letter i firefox type which application I would like to use to open this file, this is so embarrassing, how to stop this?

    You are welcome

    Can you tell us which extension caused your problem?

  • Hi, I have two decimal strings, each of them contains the numbers change over time. I want to plot them on the graph XY, a string for each axis. Can you show me how do?

    Hi, I have two decimal strings, each of them contains the numbers change over time. I want to plot them on the graph XY, a string for each axis. Can you show me how do?

    This is not a formula, but a constant simple schema of a table complex. Wire remains, then do a right click of the terminal of the initializer of the feedback node and select "create constant. That should do it.

  • How to find the value max and min for each column in a table 2d?

    How to find the value max and min for each column in a table 2d?

    For example, in the table max/min for the first three columns would be 45/23, 14/10, 80/67.

    Thank you

    Chuck,

    With color on your bars, you should have enough experience to understand this.

    You're a loop in the table already.  Now you just need a function like table Max and min. loop.  And you may need to transpose the table 2D.

  • Could not get the matrix of pixels per 'ImageToArray' VI...

    I have run the 'ImageToArray' example, but you see, I can't get the matrix of pixels in the image.

    could someone help me?

    Thank you very much!

    I deal with problems, thank you!

  • Whenever I caonnect my internet home, McAfee start poping of alerts, and after a few minutes (5-10 min) get the errors of generic host for Win32 process has encountered a problem and must be closed.

    Generic host win32 problem...

    HI, I have soundcards XP SP2, version 2002. Whenever I caonnect my internet home, McAfee start poping of alerts, and after a few minutes (5-10 min) get the errors of generic host for Win32 process has encountered a problem and must be closed. After all that, my internet stops working and against hepatitis a to erboot to make it work again. Help, please

    Hello

    ·         Did you do changes on the computer before the show?

    Follow these methods.

    Method 1: Follow these steps:

    Step 1: Start the computer in safe mode with network and check if the problem persists.

    Step 2: If the problem does not still in safe mode, perform a clean boot to see if there is a software conflict as the clean boot helps eliminate software conflicts.

    Note: After completing the steps in the clean boot troubleshooting, follow the section How to configure Windows to use a Normal startup state of the link to return the computer to a Normal startupmode.

    After the clean boot used to resolve the problem, you can follow these steps to configure Windows XP to start normally.

    (a) click Start, run.

    (b) type msconfigand click OK.

    (c) the System Configuration Utility dialog box appears.

    (d) click the general tab, click Normal startup - load all services and device drivers and then click OK.

    (e) when you are prompted, click on restart to restart the computer.

    Method 2: Temporarily disable the security software.

    Note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you do not disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network during the time that your antivirus software is disabled, your computer is vulnerable to attacks.

    Method 3: Follow the steps in the article.

    How to troubleshoot a network home in Windows XP

    Windows wireless and wired network connection problems

    For reference:

    How to reset the Protocol Internet (TCP/IP)

  • When trying to start the disk check procedure, I get the answer, "cannot open volume for direct access. How can I fix?

    I get the above answer everytime I turn on the computer. (This is with AutoCorrect blocks checked). If I leave blocks unchecked, it follows a procedure 3 pass without rebooting and does not produce a result.

    * original title - to try to start the procedure of checking disk I get the answer, "cannot open volume for direct access. How can I fix? I ran the GET Microsoft virus check tnd an own result.*

    The application-specific permission settings do not authorization for the application server COM with the CLSID
    {DCBCA92E-7DBE-4EDA-8B7B-3AAEA4DD412B}
    the user NT AUTHORITY\SYSTEM SID (S-1-5-18). This security permission can be modified using the Component Services administrative tool.

    In the opposite case

    http://blog.ray1.NET/2008/01/WinXP-SP3-DCOM-system-error-dcbca92e.html

    http://TechNet.Microsoft.com/en-us/network/bb545879

    http://www.blackviper.com/wiki/Network_Access_Protection_Agent

  • Where can I get the spare parts (circuit boards) for my HP 2509 m monitor?

    Where can I get the spare parts (circuit boards) for my HP 2509 m monitor?

    Hello tsmit32,

    Here is a link to the parts list of what HP considers to be user replaceable.

    Replaceable parts by the user (Europe, Middle East and Africa)

    Since the part is not on the list as a replaceable user then HP does not provide the part for sale. The circuit boards are going to be hard to find, perhaps ebay and other online retailers research is your best option.

    The other option that you have is to create your own heel to tear the other monitors that ppl may be getting rid of. If you can find a job of monitoring of 2509 m on ebay with a fairly cheap crack screen then you essentially buy the guts and that's what you're looking for.

  • Switch to the correct encryption certificate I get the error: "Key not valid for use is specified state."

    Used
    Now cannot open encrypted files.

    When you try to pass the correct encryption certificate I get the error:
    "Key not valid for use is specified state."

    See this http://answers.microsoft.com/en-us/windows/forum/windows_7-security/keeping-passwords-secure-microsoft-policy-on/39f56ef0-5d68-41ad-9daa-6e6019c25d37

    It is as it's supposed to as an anti theft precautions. I mean that data is encrypted, if somebody stole your hard drive and the hard drive boots and the other account it can receive data.

    If you not export recovery certificates and encrypting the data, you cannot redo the decryption.

    http://Windows.Microsoft.com/en-us/Windows/back-up-EFS-certificate#1TC=Windows-7

    If it's a default domain recovery agent. admin area. If it's home, to look for recovery certified you have exported.

    But third-party tools are there if you can remember old password the is to encrypt you can recover. But they are not free... and premium software is not be recommended or guided through support free forum due to the effort of preventing unnecessary advertising.

    You can do you own research about recovering data... just try to get you using the favorite search engine... "Restore access to encrypted EFS format files" or "Advanced EFS Data Recovery.

    Many more free guides will be available... Just keep in mind this is not a method to escape... you must remember your old password at least for decryption in the case where you export a certificate.

  • What is the difference in verses apps for each of the programs to purchase and download it?  They are the same thing and they are simply called "apps"?  Are the applications of complete programs?

    What is the difference in verses apps for each of the programs to purchase and download it?  They are the same thing and they are simply called "apps"?  Are the applications of complete programs?

    Yes.

    Adobe uses confusion of terminology in their efforts to explain things.

    Cloud desktop applications are the same as the purchase of the software on disk in the days avant-nuage. for example, the Photoshop Cloud desktop application is the full version of Photoshop CC 2015.

  • The blur tool.  I can not get the blur tool to work for me.

    The blur tool.  I used Photoshop for photo editing until 2 years ago.  I just started to use Photoshop again, and I can't get the blur tool to work for me.  I just does not affect the pixels at all.  I think I'm following the correct process for click on the blur tool and then configure the brush to do my procedure of blur.  Help, please.

    Hi Robert,.

    Please do not forget that you work directly on the layer on which is the image you want to blur. Where you work on an empty layer, make sure that your auto to check the ' sample all layers ' (mine is unchecked) property in the top bar. Also, as has been suggested previously, check if the blending mode is set to normal.

    If the problem persists, please let us know,

    Kind regards
    Martin Benes

Maybe you are looking for