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

Method run

test/cairoTest/cairoTest.cpp:385–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383// text
384struct TestText : public TestBase {
385 virtual void run( fli::cairo::Context &ctx ) {
386 ctx.selectFontFace( "Batang", fli::cairo::FONT_SLANT_NORMAL, fli::cairo::FONT_WEIGHT_BOLD );
387 ctx.setFontSize( 90.0 );
388
389 ctx.moveTo( 10.0, 135.0 );
390 ctx.showText( "Hello" );
391
392 ctx.moveTo( 70.0, 165.0 );
393
394// This code crashes PDF on the Mac
395// fli::cairo::FontFace *otherFont = new fli::cairo::FontFace( "Baskerville" );
396// cairo_set_font_face( ctx.getCairo(), cf );
397
398 ctx.textPath( "World" );
399 ctx.setSourceRgb( 0.5, 0.5, 1 );
400 ctx.fillPreserve();
401 ctx.setSourceRgb( 0, 0, 0 );
402 ctx.setLineWidth( 2.56 );
403 ctx.stroke();
404
405 // draw helping lines
406 ctx.setSourceRgba( 1, 0.2, 0.2, 0.6 );
407 ctx.arc( 10.0, 135.0, 5.12, 0, 2 * M_PI );
408 ctx.closePath();
409 ctx.arc( 70.0, 165.0, 5.12, 0, 2 * M_PI );
410 ctx.fill();
411 }
412};
413
414// text align center

Callers

nothing calls this directly

Calls 13

selectFontFaceMethod · 0.80
setFontSizeMethod · 0.80
showTextMethod · 0.80
textPathMethod · 0.80
setSourceRgbMethod · 0.80
fillPreserveMethod · 0.80
setLineWidthMethod · 0.80
strokeMethod · 0.80
setSourceRgbaMethod · 0.80
closePathMethod · 0.80
moveToMethod · 0.45
arcMethod · 0.45

Tested by

no test coverage detected