7 if ( SDL::Config->has('SDL_ttf') ) {
10 plan( skip_all => 'SDL_ttf support not compiled' );
15 use_ok('SDL::Surface');
16 use_ok('SDL::TTF_Font');
20 my $ttf_font = SDL::TTF_OpenFont( 'test/data/aircut3.ttf', 12 );
21 isa_ok( $ttf_font, 'SDL::TTF_Font' );
22 my ( $w, $h ) = @{ SDL::TTF_SizeText( $ttf_font, 'Hello!' ) };
23 is( ($w == 27) || ($w == 28), 1, '"Hello!" has width 27' );
24 is( ($h == 14) || ($h == 15), 1, '"Hello!" has width 14' );
26 my $surface = SDL::TTF_RenderText_Blended( $ttf_font, 'Hello!',
27 SDL::Color->new( 255, 0, 0 ) );
28 isa_ok( $surface, 'SDL::Surface' );
29 ($w,$h) = ( $surface->w, $surface->h) ;
30 is( ($w == 27) || ($w == 28), 1 ,'Surface has width 27' );
31 is( ($h == 14) || ($h == 15), 1, 'Surface has width 14' );