Hey @drewish,
Thanks for still engaging me in the matter. If you put any text strings I’ve provided you with into the TextureFontApp
, you’ll see the spaces disappear. In fact, in your initial screenshot, the first space before the characters ‘3000’ is also missing. It’s just hard to tell because there’s no other line to compare it too. If you want some easy copy-paste code, you can just substitute this into the draw function:
void TextureFontApp::draw()
{
gl::setMatricesWindow( getWindowSize() );
gl::enableAlphaBlending();
gl::clear( Color( 0, 0, 0 ) );
std::string str( "Granted, then, that certain transformations do happen, it is essential that we should regard them in the philosophic manner of fairy tales, not in the unphilosophic manner of science and the \"Laws of Nature.\" When we are asked why eggs turn into birds or fruits fall in autumn, we must answer exactly as the fairy godmother would answer if Cinderella asked her why mice turned into horses or her clothes fell from her at twelve o'clock. We must answer that it is MAGIC. It is not a \"law,\" for we do not understand its general formula." );
str = " a\n"
" a\n";
Rectf boundsRect( 40, mTextureFont->getAscent() + 40, getWindowWidth() - 40, getWindowHeight() - 40 );
gl::color( ColorA( 1, 0.5f, 0.25f, 1.0f ) );
mTextureFont->drawStringWrapped( str, boundsRect );
auto mGlyphs = mTextureFont->getGlyphPlacements( str );
// Draw FPS
gl::color( Color::white() );
mTextureFont->drawString( toString( floor(getAverageFps()) ) + " FPS", vec2( 10, getWindowHeight() - mTextureFont->getDescent() ) );
// Draw Font Name
float fontNameWidth = mTextureFont->measureString( mTextureFont->getName() ).x;
mTextureFont->drawString( mTextureFont->getName(), vec2( getWindowWidth() - fontNameWidth - 10, getWindowHeight() - mTextureFont->getDescent() ) );
}
I debugged the process myself now that I got my head on a little better and in the Unicode.cpp
file at line 296 (which is part of Cinder), I found the following snippet:
// eat any spaces we'd start on on the next line
size_t tempByte = lineStartByte;
while( nextCharUtf8( line, &tempByte, lengthInBytes ) == (uint32_t)' ') {
lineStartByte = tempByte;
++lineStartChar;
}
So… I suppose this behavior is intended? Which honestly surprises me a tad…