Missing files added
[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;
084b921f 10use warnings;
11use Carp;
8fde61e3 12use SDL;
13use SDL::SFont;
14use SDL::Surface;
15
16use vars qw(@ISA $CurrentFont );
17
18
19@ISA = qw(SDL::Surface);
20
21
22sub new {
23 my $proto = shift;
24 my $class = ref($proto) || $proto;
25 my $self = \SDL::SFont::NewFont(shift);
26 bless $self,$class;
27 return $self;
28}
29
30sub DESTROY {
31 my $self = shift;
32 SDL::FreeSurface($$self);
33}
34
35sub use ($) {
36 my $self = shift;
37 $CurrentFont = $self;
38 if ( $self->isa('SDL::Font')) {
39 SDL::SFont::UseFont($$self);
40 }
41}
42
431;
44
45__END__;
46
47=pod
48
49
50=head1 NAME
51
52SDL::Font - a SDL perl extension
53
54=head1 SYNOPSIS
55
56 $font = new Font "Font.png";
57 $font->use();
58
59=head1 DESCRIPTION
60
61L<SDL::Font> provides an interface to loading and using SFont style
62fonts with L<SDL::Surface> objects.
63
64=head1 AUTHOR
65
66David J. Goehrig
67
68=head1 SEE ALSO
69
70L<perl> L<SDL::Surface>
71
72=cut