The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WE_Frontend::TextLayouter - support functions for layouting text and html

SYNOPSIS

    use WE_Frontend::TextLayouter qw(break_text);
    my(@text_blocks) = break_text($text, $fontinfo, $boxwdith, $boxheight);

DESCRIPTION

This module supplies some support functions for layouting text and html.

FUNCTIONS

break_text($text, $fontinfo, $boxwidth, $boxheight, %args)

Takes a string parameter $text with plain text and breaks this text into several parts (returned as a list of text strings) according to $fontinfo and a box with the dimensions $boxwidth and $boxheight.

See WE_Frontend::FontInfo for more information about the $fontinfo structure.

Optionally, additional arguments can be supplied if a partially filled boxed should be filled further:

-box => $string

The partially filled box (default: empty).

-x => $x

The starting x coordinate (default 0).

-y => $y

The starting y coordinate (default 0).

-maxlineheight => $y

The height of the current line.

-lastbox => $hashref

The -lastbox hash reference, if specified, will be filled with the last values for -x, -y, -maxlineheight and -box for the last box.

AUTHOR

Slaven Rezic - slaven@rezic.de

SEE ALSO

WE_Frontend::FontInfo