MCPcopy Create free account
hub / github.com/cinder/Cinder / drawStringWrapped

Method drawStringWrapped

src/cinder/gl/TextureFont.cpp:733–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

731}
732
733void TextureFont::drawStringWrapped( const std::string &str, const Rectf &fitRect, const vec2 &offset, const DrawOptions &options )
734{
735 TextBox tbox = TextBox().font( mFont ).text( str ).size( fitRect.getSize() ).ligate( options.getLigate() );
736#if defined( CINDER_ANDROID ) || defined( CINDER_LINUX )
737 vector<pair<Font::Glyph,vec2> > glyphMeasures = tbox.measureGlyphs( getCachedGlyphMetrics() );
738#else
739 vector<pair<Font::Glyph,vec2> > glyphMeasures = tbox.measureGlyphs();
740#endif
741 drawGlyphs( glyphMeasures, fitRect.getUpperLeft() + offset, options );
742}
743
744vec2 TextureFont::measureString( const std::string &str, const DrawOptions &options ) const
745{

Callers 1

drawMethod · 0.80

Calls 5

TextBoxFunction · 0.85
getCachedGlyphMetricsFunction · 0.85
measureGlyphsMethod · 0.80
sizeMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected