Graphi...e::Font(3pm)
π Graphics::Primitive::Font π
okay bestie, gather round, because we're talking about text styling and it's literally the whole personality of your rendered text. This is Graphics::Primitive::Font from the Perl user-contributed docs, and it's the thing that holds all your font options. π
β¨ NAME β¨
Graphics::Primitive::Font β Text styling π
πΈ DESCRIPTION πΈ
So Graphics::Primitive::Font is the object that represents all the different options you've got when you're rendering text. Iconic, honestly.
But here's the tea, and I need you to hear me on this one: the options here may or may not actually do anything for your rendering. They're a cross-section of what all the different drivers out there support, so setting them should not break anything β but if your driver doesn't understand an option, it might just... not have an effect. No cap. π€·βοΈ
π¦ SYNOPSIS π¦
use Graphics::Primitive::Font;
my $font = Graphics::Primitive::Font->new({
family => 'Arial',
size => 12,
slant => 'normal'
});
look at her go β¨
π METHODS π
π§ Constructor
(yes bestie, this is a subsection of METHODS, we keep it exactly where it was)
π Attributes π
antialias_modesβ set the antialiasing mode for this font. The possible values aredefault,none,grayandsubpixel. smooth that text out, periodt πfamilyβ set this font's family. like, what family is she from π«Άhint_metricsβ controls whether to hint font metrics. Hinting means quantizing them so that they're integer values in device space. This improves the consistency of letter and line spacing, however it also means that text will be laid out differently at different zoom factors. May not be supported by all drivers β so don't come for me if it's a no-show. πhint_styleβ set the type of hinting to do on font outlines. Hinting is the process of fitting outlines to the pixel grid in order to improve the appearance of the result. Since hinting outlines involves distorting them, it also reduces the faithfulness to the original outline shapes. Not all of the outline hinting styles are supported by all drivers. The options aredefault,none,slight,mediumandfull.sizeβ set/get the size of this font. how big is she πslantβ set/get the slant of this font. Valid values arenormal,italicandoblique. β¨subpixel_orderβ set the order of color elements within each pixel on the display device when rendering with subpixel antialiasing. The values aredefault,rgb,bgr,vrgbandvbgr. πvariantβ set/get the variant of this font. Valid values arenormalorsmall-caps. πweightβ set/get the weight of this font. The values arenormalandbold. π₯
π METHODS π
(yes, there are two METHODS sections. we do not question the manpage. we respect the manpage. π)
π new
Creates a new Graphics::Primitive::Font. baby's first font, slay π
π derive
Clone this font but change one or more of its attributes by passing in a hashref of options:
my $new = $font->derive({ attr => $newvalue });
The returned font will be identical to the cloned one, save the attributes you specified. it's giving glow-up but make it a copy π¦
π AUTHOR π
Cory Watson, "<gphat@cpan.org>" β thank you king π
π 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. iconic licensing behavior, we love to see it β¨
okay that's the whole page bestie, you're officially a font girlie now π πΈ
this wasperl v5.34.0, dated2022-06-14, and it's theGraphics::Primitive::Font(3pm)page from the Perl user-contributed documentation. mwah, go render something gorgeous π«Άπ
π¦ where this page comes from
- debian bookworm: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms