Mixing multiple fonts in one string

Hey guys!

As our master thesis project we are developing an interactive installation. We are generating different shapes out of ofCurveVertex and ofVertex, and so on (doing rotation/transformation/etc). This works really well.

Additionally we are adding typography to this generated shape. At the moment each shape is assigned a random font out of a manually created pool (see an example below):

    fonts.push_back("Impact");
    fonts.push_back("Helvetica");
    fonts.push_back("Verdana");
    fonts.push_back("Symbol");
    ...
    myfont.loadFont(fonts[fontGamble], fontSize, true);        
    ...
    myfont.drawString(...);

This works as well!

WHERE I AM STUCK // WHAT I WANT TO DO:
I want to set a random font for each character of the string. I have no clue how to do this. Maybe someone of you guys has any idea if this is possible? I am really thankful for any idea!

Thanks in advance
Padde

Hi,

All I can think of would be to take care of the text layout yourself, something like (untested and off the top of my head):

ofTruetypeFont* font = NULL:

ofVec2f textPos(50,50);

for( int i = 0; i < myString.length(); i++ )
{
  font = getRandomFontPointer();
  font->drawString( myString[i], textPos.x, textPos.y );
  textPos.x += font->stringWidth( myString[i] ) + 1.0;
}