First commit of SDL_Perl-2.1.3
[sdlgit/SDL_perl.git] / lib / SDL / Font.pm
CommitLineData
8fde61e3 1# Font.pm
2#
3# a SDL perl extension for SFont support
4#
5# Copyright (C) David J. Goehrig 2000,2002
6#
7
8package SDL::Font;
9use strict;
10use SDL;
11use SDL::SFont;
12use SDL::Surface;
13
14use vars qw(@ISA $CurrentFont );
15
16
17@ISA = qw(SDL::Surface);
18
19
20sub new {
21 my $proto = shift;
22 my $class = ref($proto) || $proto;
23 my $self = \SDL::SFont::NewFont(shift);
24 bless $self,$class;
25 return $self;
26}
27
28sub DESTROY {
29 my $self = shift;
30 SDL::FreeSurface($$self);
31}
32
33sub use ($) {
34 my $self = shift;
35 $CurrentFont = $self;
36 if ( $self->isa('SDL::Font')) {
37 SDL::SFont::UseFont($$self);
38 }
39}
40
411;
42
43__END__;
44
45=pod
46
47
48=head1 NAME
49
50SDL::Font - a SDL perl extension
51
52=head1 SYNOPSIS
53
54 $font = new Font "Font.png";
55 $font->use();
56
57=head1 DESCRIPTION
58
59L<SDL::Font> provides an interface to loading and using SFont style
60fonts with L<SDL::Surface> objects.
61
62=head1 AUTHOR
63
64David J. Goehrig
65
66=head1 SEE ALSO
67
68L<perl> L<SDL::Surface>
69
70=cut