Applied patch ready for merge
[sdlgit/SDL_perl.git] / lib / SDL / TTFont.pm
index ab9387e..5aab81e 100644 (file)
@@ -1,8 +1,31 @@
-#      TTFont.pm
+#!/usr/bin/env perl
 #
-#      a SDL perl extension for SDL_ttf support
+# TTFont.pm
 #
-#      Copyright (C) David J. Goehrig 2002
+# Copyright (C) 2005 David J. Goehrig <dgoehrig@cpan.org>
+#
+# ------------------------------------------------------------------------------
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+# 
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+#
+# ------------------------------------------------------------------------------
+#
+# Please feel free to send questions, suggestions or improvements to:
+#
+#      David J. Goehrig
+#      dgoehrig@cpan.org
 #
 
 package SDL::TTFont;
@@ -23,7 +46,7 @@ sub new {
        my $self = {};
        my %options;
        (%options) = @_;
-       $self->{-mode} = $options{-mode}        || $options{-m}  || TEXT_SHADED();
+       $self->{-mode} = $options{-mode}        || $options{-m}  || SDL::TEXT_SHADED();
        $self->{-name} = $options{-name}        || $options{-n};
        $self->{-size} = $options{-size}        || $options{-s};
        $self->{-fg} = $options{-foreground}    || $options{-fg} || $SDL::Color::black;
@@ -88,68 +111,68 @@ sub descent {
 
 sub normal {
        my ($self) = @_;
-       SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_NORMAL());
+       SDL::TTFSetFontStyle($$self{-font},SDL::TTF_STYLE_NORMAL());
 }
 
 sub bold {
        my ($self) = @_;
-       SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_BOLD());
+       SDL::TTFSetFontStyle($$self{-font},SDL::TTF_STYLE_BOLD());
 }
 
 sub italic {
        my ($self) = @_;
-       SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_ITALIC());
+       SDL::TTFSetFontStyle($$self{-font},SDL::TTF_STYLE_ITALIC());
 
 }
 
 sub underline {
        my ($self) = @_;
-       SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_UNDERLINE());
+       SDL::TTFSetFontStyle($$self{-font},SDL::TTF_STYLE_UNDERLINE());
 }
 
 sub text_shaded {
        my ($self) = @_;
-       $$self{-mode} = TEXT_SHADED();
+       $$self{-mode} = SDL::TEXT_SHADED();
 }
 
 sub text_solid {
        my ($self) = @_;
-       $$self{-mode} = TEXT_SOLID();
+       $$self{-mode} = SDL::TEXT_SOLID();
 }
 
 sub text_blended {
        my ($self) = @_;
-       $$self{-mode} = TEXT_BLENDED();
+       $$self{-mode} = SDL::TEXT_BLENDED();
 }
 
 sub utf8_shaded {
        my ($self) = @_;
-       $$self{-mode} = UTF8_SHADED();
+       $$self{-mode} = SDL::UTF8_SHADED();
 }
 
 sub utf8_solid {
        my ($self) = @_;
-       $$self{-mode} = UTF8_SOLID();
+       $$self{-mode} = SDL::UTF8_SOLID();
 }
 
 sub utf8_blended {
        my ($self) = @_;
-       $$self{-mode} = UTF8_BLENDED();
+       $$self{-mode} = SDL::UTF8_BLENDED();
 }
 
 sub unicode_shaded {
        my ($self) = @_;
-       $$self{-mode} = UNICODE_SHADED();
+       $$self{-mode} = SDL::UNICODE_SHADED();
 }
 
 sub unicode_solid {
        my ($self) = @_;
-       $$self{-mode} = UNICODE_SOLID();
+       $$self{-mode} = SDL::UNICODE_SOLID();
 }
 
 sub unicode_blended {
        my ($self) = @_;
-       $$self{-mode} = UNICODE_BLENDED();
+       $$self{-mode} = SDL::UNICODE_BLENDED();
 }
 
 croak "Could not initialize True Type Fonts\n"