Graphi...tLayout(3pm)

πŸ“¦
version 0.67 Β· 2 versions
  • 0.67 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.67 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, this is Graphics::Primitive::Driver::TextLayout β€” it's a TextLayout role, from the User Contributed Perl Documentation corner of the world. Yes it's Graphi...tLayout(3pm) when your terminal truncates it, no that's not a typo, that's just man pages being man pages. πŸ™ˆ


🌸 DESCRIPTION 🌸

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

That's it. That's the whole description. Short, sweet, iconic. It's a role β€” you don't use it, you become it. Main character energy, but for a class. πŸ‘‘


✨ SYNOPSIS ✨

the way you just consume it:

package MyLayout;
use Moose;

with 'Graphics::Primitive::Driver::TextLayout';

...

slay. you with it and suddenly you're a whole text layout engine. πŸ’…


πŸŽ€ METHODS πŸŽ€

  • component β€” Set/Get the component from which to draw layout information. it's giving "where do I get my info from" energy. πŸ¦‹
  • height β€” Set/Get this layout's height. tall. vertically blessed. ✨
  • slice β€” bestie, this one is Implemented by role consumer β€” meaning you have to write it, it's not coming pre-made, no cap. Given an offset and an optional size, it returns a TextBox containing lines from this layout that come as close to $size without exceeding it. πŸ“

This method exists so you can render text incrementally β€” like, a little at a time instead of all at once. 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
}

so clean, so incremental, we love a for loop that just works. πŸ”₯

  • width β€” Set/Get this layout's width. Defaults to the width of the component supplied. so if you don't set it, it just matches the component, effortless. πŸ‘‘

πŸ’œ AUTHOR πŸ’œ

Cory Watson, "<gphat@cpan.org>" β€” we stan a legend. 🫢


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. (the classic Perl license vibe, you already know iykyk πŸ’€)


fr fr that's the whole page. no hidden extras, no secret flags, nothing sneaky. just a role doing role things. 🧚

and that's a wrap, bestie β€” this page came to you via perl v5.34.0, dated 2022-06-14. blow it a kiss, log off, hydrate. πŸ’–πŸŒΈβœ¨

πŸ“¦ where this page comes from