Skip to main content
Known Participant
March 23, 2009
Question

Retrive text in textmodel with same font attributes

  • March 23, 2009
  • 1 reply
  • 372 views
Hello All ,
I have text with different font style and size .
I want to retrive text from textmodel with same font attributes like bold , regular , italic and it's size.
I want to iterate textmodel data and retive text one by one with same font attributes.
So, Please give me the solution.
This topic has been closed for replies.

1 reply

Known Participant
March 26, 2009
Hello All,<br /> <br />InterfacePtr<IComposeScanner> composeScanner(textModel, UseDefaultIID());<br />if (composeScanner == nil) <br />{<br /> ASSERT(composeScanner);<br /> break;<br />}<br />InterfacePtr<const IAttrReport> fontStyleAttrReport(composeScanner->QueryAttributeAt((const RangeData &)range, kTextAttrFontStyleBoss));<br />if (fontStyleAttrReport == nil)<br />{<br /> ASSERT(fontStyleAttrReport);<br /> break;<br />}<br />InterfacePtr<ITextAttrFont> fontStyleAttr(fontStyleAttrReport, UseDefaultIID());<br />if (fontStyleAttr == nil)<br />{<br /> ASSERT_MSG(fontStyleAttr, "fontStyleAttr == nil");<br /> break;<br />}<br />PMString fontStyleName(fontStyleAttr->GetFontName());<br /><br />Using this code I am getting fontStyleName as null.<br />I have indesign text with 2 byte font having font style as Bold , Regular. <br />Please give some solution to solve this problem.