1 Reply Latest reply on Apr 11, 2016 1:00 AM by LeoTaro

    How to change the color of the textFrame size

    ss92139721 Level 1
      AIArtHandle textart;
      AIRealPoint pt;
      pt.h = pt.v = 0;
      TextFrameRef textFrame;
      sAITextFrame->NewPointText(kPlaceAboveAll,0,kHorizontalTextOrientation,pt,&textart);
      sAITextFrame->GetATETextFrame(textart,&textFrame);
      ATE::ITextFrame iTextFrame(textFrame);
      ATE::ITextRange textrange(iTextFrame.GetTextRange());
      AIColor color;
      color.kind=kFourColor;
      memset(&color.c.f,0,sizeof(color.c.f));
      color.c.f.magenta=1;
      ATE::ApplicationPaintRef dst;
      sAIATEPaint->CreateATEApplicationPaint(&color, &dst);
      textrange.GetUniqueCharFeatures().SetFillColor(ATE::IApplicationPaint(dst));
      textrange.GetUniqueCharFeatures().SetFontSize(20);
      ASUnicode buff[1024];
      ai::UnicodeString str("hsp");
      str.as_ASUnicode(buff,1024);
      textrange.InsertAfter(buff,3);

       

      this code Don't do??

        • 1. Re: How to change the color of the textFrame size
          LeoTaro Level 4

          Try changing:

           

          textrange.GetUniqueCharFeatures().SetFillColor(ATE::IApplicationPaint(dst));

          textrange.GetUniqueCharFeatures().SetFontSize(20);

           

          To:

           

          ICharFeatures features = textrange.GetUniqueCharFeatures();

          features.SetFillColor(ATE::IApplicationPaint(dst));

          features.SetFontSize(20);

          textrange.SetLocalCharFeatures(features);

           

          1 person found this helpful