Skip to content

Commit

Permalink
replacing copyright-dubious aircut3.ttf
Browse files Browse the repository at this point in the history
  • Loading branch information
garu committed Feb 27, 2011
1 parent 8c6646b commit 1be45a9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/pods/SDL/TTF.pod
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ Example:
SDL::init(SDL_INIT_VIDEO);
SDL::TTF::init();
my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE);
my $font = SDL::TTF::open_font('test/data/aircut3.ttf', '24');
my $font = SDL::TTF::open_font('somefont.ttf', '24');
die 'Coudnt make font '. SDL::get_error if !$font;
my $surface = SDL::TTF::render_text_solid($font, 'Hallo!', SDL::Color->new(0xFF,0xFF,0xFF));
SDL::Video::blit_surface($surface, SDL::Rect->new(0, 0, 640, 480), $display, SDL::Rect->new(10, 10, 640, 480));
Expand Down
14 changes: 10 additions & 4 deletions t/ttf.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ use SDL::RWOps;
use SDL::Version;
use Encode;

use FindBin;
use File::Spec;
my $font_filename = File::Spec->catfile(
$FindBin::Bin, '..', 'share', 'GenBasB.ttf'
);

my $videodriver = $ENV{SDL_VIDEODRIVER};
$ENV{SDL_VIDEODRIVER} = 'dummy' unless $ENV{SDL_RELEASE_TESTING};

Expand Down Expand Up @@ -74,19 +80,19 @@ is( SDL::TTF::byte_swapped_unicode(0), undef, "[ttf_byte_swapped_unicode] on" );
is( SDL::TTF::byte_swapped_unicode(1), undef,
"[ttf_byte_swapped_unicode] off"
);
my $font = SDL::TTF::open_font( 'test/data/aircut3.ttf', 24 );
my $font = SDL::TTF::open_font( $font_filename, 24 );
isa_ok( $font, 'SDL::TTF::Font', "[open_font]" );
isa_ok(
SDL::TTF::open_font_index( 'test/data/aircut3.ttf', 8, 0 ),
SDL::TTF::open_font_index( $font_filename, 8, 0 ),
'SDL::TTF::Font', "[open_font_index]"
);
my $file = SDL::RWOps->new_file( 'test/data/aircut3.ttf', 'r' );
my $file = SDL::RWOps->new_file( $font_filename, 'r' );
isa_ok( $file, 'SDL::RWOps', "[new_file]" );
isa_ok(
SDL::TTF::open_font_RW( $file, 0, 12 ),
'SDL::TTF::Font', "[open_font_RW]"
);
$file = SDL::RWOps->new_file( 'test/data/aircut3.ttf', 'r' );
$file = SDL::RWOps->new_file( $font_filename, 'r' );
isa_ok(
SDL::TTF::open_font_index_RW( $file, 0, 16, 0 ),
'SDL::TTF::Font', "[open_font_index_RW]"
Expand Down
10 changes: 8 additions & 2 deletions t/ttf_font.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ use SDL::TTF;
use SDL::TTF::Font;
use SDL::Version;

use FindBin;
use File::Spec;
my $font_filename = File::Spec->catfile(
$FindBin::Bin, '..', 'share', 'GenBasB.ttf'
);

my $lv = SDL::TTF::linked_version();
my $cv = SDL::TTF::compile_time_version();

Expand All @@ -33,12 +39,12 @@ printf(
is( SDL::TTF::init(), 0, "[init] succeeded" );

isa_ok(
SDL::TTF::Font->new( 'test/data/aircut3.ttf', 24 ),
SDL::TTF::Font->new( $font_filename, 24 ),
'SDL::TTF::Font',
"[new] with font and size"
);
isa_ok(
SDL::TTF::Font->new( 'test/data/aircut3.ttf', 24, 0 ),
SDL::TTF::Font->new( $font_filename, 24, 0 ),
'SDL::TTF::Font',
"[new] with font, size and index"
);
Expand Down
Binary file removed test/data/aircut3.ttf
Binary file not shown.

0 comments on commit 1be45a9

Please sign in to comment.