Templat...t::Align(3)
π Templat...t::Align(3) β bestie edition
ok so real talk, this page is from the User Contributed Perl Documentation (that's the manual name, it's giving β¨community-maintainedβ¨) and it's about drawing text in GD images. picture that. text. in images. aligned. iconic.
π¦ NAME
Template::Plugin::GD::Text::Align β draws aligned strings in GD images. that's the whole vibe, no cap.
πΈ SYNOPSIS
[% USE align = GD.Text.Align(gd_image); %]
literally one line, she's effortless π
π EXAMPLES
ok here's the full demo, drink it in:
[% FILTER null;
USE im = GD.Image(100,100);
USE gdc = GD.Constants;
# allocate some colors
black = im.colorAllocate(0, 0, 0);
red = im.colorAllocate(255,0, 0);
blue = im.colorAllocate(0, 0, 255);
# Draw a blue oval
im.arc(50,50,95,75,0,360,blue);
USE a = GD.Text.Align(im);
a.set_font(gdc.gdLargeFont);
a.set_text("Hello");
a.set(colour => red, halign => "center");
a.draw(50,70,0);
# Output image in PNG format
im.png | stdout(1);
END;
-%]
so she makes a 100,100 image, grabs her colors from GD.Constants, draws a blue oval with im.arc(50,50,95,75,0,360,blue), then sets up GD.Text.Align(im), picks gdc.gdLargeFont, says "Hello", sets colour => red, halign => "center", calls a.draw(50,70,0) and pipes out a PNG to stdout(1). the whole glow-up in one template π₯
β¨ DESCRIPTION
the GD.Text.Align plugin is basically the middleman β it gives you an interface to the GD::Text::Align module, so you can draw text in GD images with all sorts of alignments and orientations. main character text placement tbh π
for the deeper lore, go read GD::Text::Align. and if you want wrapped text in GD images instead, head over to Template::Plugin::GD::Text::Wrap β that's the plugin that does the wrapping iykyk π«Ά
π AUTHOR
- Thomas Boutell wrote the GD graphics library.
- Lincoln D. Stein wrote the Perl GD modules that interface to it, and Martien Verbruggen wrote the
GD::Textmodule. - Craig Barratt
<craig@arraycomm.com>wrote the original GD plugins for the Template Toolkit (2001). - Andy Wardley
<abw@cpan.org>extracted them from the TT core into a separate distribution for TT version 2.15.
π₯Ί and listen β these modules are looking for a new maintainer. please contact Andy Wardley if you're willing to help out. adopt these icons, bestie, they deserve it π
π COPYRIGHT
Copyright (C) 2001 Craig Barratt <craig@arraycomm.com>, 2006 Andy Wardley <abw@cpan.org>.
GD::Text is copyright 1999 Martien Verbruggen.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, free software rights π«Ά
π₯ SEE ALSO
Template::Plugin::GDTemplate::Plugin::GD::TextTemplate::Plugin::GD::Text::WrapGD
the whole friend group fr fr π
β cute little sign-off: this was perl v5.42.0, dated 2017-10-08 β and that's the whole page, bestie, you ate that πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Template-GD 2.66-bp160.1.11 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms