| 1602 | } |
| 1603 | |
| 1604 | void text_align( canvas &that, float width, float height ) |
| 1605 | { |
| 1606 | that.set_font( &font_a[ 0 ], static_cast< int >( font_a.size() ), 0.2f * height ); |
| 1607 | that.rotate( 0.2f ); |
| 1608 | that.set_color( fill_style, 0.0f, 0.0f, 0.0f, 1.0f ); |
| 1609 | align_style const alignments[] = { leftward, center, rightward, start, ending }; |
| 1610 | for ( int index = 0; index < 5; ++index ) |
| 1611 | { |
| 1612 | float base = ( 0.1f + 0.2f * static_cast< float >( index ) ) * height; |
| 1613 | that.text_align = alignments[ index ]; |
| 1614 | that.fill_text( "HIty", 0.5f * width, base ); |
| 1615 | } |
| 1616 | that.set_color( stroke_style, 1.0f, 0.0f, 0.0f, 0.5f ); |
| 1617 | that.set_line_width( 1.0f ); |
| 1618 | that.move_to( 0.0f, 0.5f * height ); |
| 1619 | that.line_to( width, 0.5f * height ); |
| 1620 | that.move_to( 0.5f * width, 0.0f ); |
| 1621 | that.line_to( 0.5f * width, height ); |
| 1622 | that.stroke(); |
| 1623 | } |
| 1624 | |
| 1625 | void text_baseline( canvas &that, float width, float height ) |
| 1626 | { |