Brian Cassidy > Image-XBin > Image::XBin::Font

Download:
Image-XBin-0.06.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

Image::XBin::Font - Manipulate XBin font data

SYNOPSIS ^

        use Image::XBin::Font;

        # Create a new font
        my $fnt = Image::XBin::Font->new;

        # Set all of the chars
        $fnt->chars( $chars );

        # Set one of them
        $fnt->char( 65, $char );

        # Accessors
        my $width  = $fnt->width;
        my $height = $fnt->height;
        my $chars  = $fnt->characters;

        # Get output suitable for saving...
        my $out = $fnt->as_string;

        # Clear the data
        $fnt->clear;

DESCRIPTION ^

Xbin images can contain font data. This module will allow you to create, and manipulate that data.

METHODS ^

new( [$chars] )

Creates a new Image::XBin::Font object.

chars( [$chars] )

sets the character set. $chars should be an array (either 256 or 512 [the number of characters]) of arrays (from 1 to 32 [1 bitmask per scanline]).

as_string( )

Returns the font as a pack()'ed string - suitable for saving in an XBin.

as_gd( )

Returns a GD::Font object.

clear( )

Clears any in-memory data.

width( )

Returns "8".

char( $index, [$char] )

Get / set a char in the font.

characters( )

returns the number of characters in the font

height( [$height] )

returns the number of scanlines in each of the characters in the font

AUTHOR ^

COPYRIGHT AND LICENSE ^

Copyright 2003-2009 by Brian Cassidy

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: