---
name: "Graphics::Primitive::Driver::TextLayout"
section: "3pm"
platform: "linux"
package: "libgraphics-primitive-perl"
version: "0.67-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Graphics::Primitive::Driver::TextLayout"
---

# Graphics::Primitive::Driver::TextLayout(3pm)

TextLayout role

## NAME

Graphics::Primitive::Driver::TextLayout - TextLayout role

## DESCRIPTION

Graphics::Primitive::Driver::TextLayout is a role for Driver text layout engines.

## SYNOPSIS

```
    package MyLayout;
    use Moose;
    with 'Graphics::Primitive::Driver::TextLayout';
    ...
```

## METHODS

- *component*

  Set/Get the component from which to draw layout information.

- *height*

  Set/Get this layout's height

- *slice*

  Implemented by role consumer. Given an offset and an optional size, returns a TextBox containing lines from this layout that come as close to `$size` without exceeding it.  This method is provided to allow incremental rendering of text.  For example, if you have a series of containers 80 units high, you might write code like this:

  ```
    for(my $i = 0; $i < 3; $i++) {
        $textbox = $layout->slice($i * 80, 80);
        # render the text
    }
  ```

- *width*

  Set/Get this layout's width.  Defaults to the width of the component supplied.

## AUTHOR

Cory Watson, `"<gphat@cpan.org>"`

## COPYRIGHT & LICENSE

Copyright 2008-2010 by Cory G Watson.

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