Skip navigation
swisnies256
Currently Being Moderated

Drawing a text string on the document

Feb 18, 2012 5:23 PM

I'm new to illustrator, how to I put a text string on a document.

 
Replies
  • Currently Being Moderated
    Feb 21, 2012 7:25 AM   in reply to swisnies256

    Take a look at the SnpText.cpp in samplecode/CodeSnippets/

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 21, 2012 10:24 AM   in reply to swisnies256

    The snippet panel is kind of simplistic, and I suspect its dropping new version of text on top of one another so you're probably looking at a pile of text objects (you've probably figured that out though).

     

    To change the text of existing text, you'll need to the handle of the text you want to change. I don't reccommend hanging on to these handles outside of a 'session' -- there are things that cause handles to change, and the object might be deleted after all. Still, assumg you've got the handle, maybe by pulling it from the set of selected art. Then you'd do something like this:

     

    void SetText(AIArtHandle handle, const ASUnicode* text, int length)
    {

    TextRangeRef ref = 0;

    sAITextFrame->GetATETextRange(handle, &ref);

     

    ATE::ITextRange range(ref);

     

    // clear it first

    range.Remove();

     

    // now set it

    range.InsertAfter(text, length);

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points