| 86 | } |
| 87 | |
| 88 | void LineBreakTestApp::draw() |
| 89 | { |
| 90 | // clear out the window with black |
| 91 | gl::enableAlphaBlending(); |
| 92 | gl::clear( Color( 0, 0, 0 ) ); |
| 93 | gl::color( ColorA::white() ); |
| 94 | |
| 95 | pos.x = 0; |
| 96 | pos.y = 10; |
| 97 | // const char *s = "a just."; |
| 98 | const char *s = "just some stuff\n\nthat\nis longer than one line. I mean substantially longer..."; |
| 99 | // const char *s = "消費増税\n\n法案をめぐる事前事前事前審査を行っていた民主党税調などの合同総会は28日未明、「名目3%程度、実質2%程度」の経済成長率の数値目標を付則に盛り込んだ新たな修正案を了承し、前原誠司政調会長に対応を一任した。野内閣は30日に閣議決定を行う。"; |
| 100 | // for( size_t l = 1; l < 30; ++l ) { |
| 101 | // std::cout << l << ":" << std::endl; |
| 102 | lineBreakUtf8( s,std::bind( lineWidth, std::placeholders::_1, std::placeholders::_2, maxWidth ), print ); |
| 103 | // } |
| 104 | gl::color( ColorA( 1, 0, 0, 0.5 ) ); |
| 105 | TextBox box; |
| 106 | box.setSize( ivec2( maxWidth, TextBox::GROW ) ); |
| 107 | box.setFont( font ); |
| 108 | box.setText( s ); |
| 109 | gl::TextureRef t = gl::Texture2d::create( box.render() ); |
| 110 | gl::draw( t ); |
| 111 | gl::color( Color( 0, 1, 0 ) ); |
| 112 | gl::drawStrokedRect( Rectf( 0, 10, maxWidth, 800 ) ); |
| 113 | } |
| 114 | |
| 115 | CINDER_APP( LineBreakTestApp, RendererGl ) |
nothing calls this directly
no test coverage detected