If i construct an empty AttributedString, and append a line of text, how many attributes that object should have ? I’m getting two, identical ones, can i ask why? I’d like to iterate the object somehow:
AttributedString text;
text.append ("My Text", Font(10), Colours::black)
for (int i=0; i<text.getNumAttributes(); i++)
{
const AttributedString::Attribute *a = text.getAttribute(i);
if (a->getFont())
textEditor->setFont (*a->getFont());
if (a->getColour())
textEditor->setColour (TextEditor::textColourId, *a->getColour());
textEditor->insertTextAtCaret (text.getText().substring (a->range.getStart(), a->range.getEnd()));
}