Graphi...e::Font(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

πŸ’– 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 are default, none, gray and subpixel. 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 are default, none, slight, medium and full.
  • size β€” set/get the size of this font. how big is she πŸ’…
  • slant β€” set/get the slant of this font. Valid values are normal, italic and oblique. ✨
  • subpixel_order β€” set the order of color elements within each pixel on the display device when rendering with subpixel antialiasing. The values are default, rgb, bgr, vrgb and vbgr. 🌈
  • variant β€” set/get the variant of this font. Valid values are normal or small-caps. πŸŽ€
  • weight β€” set/get the weight of this font. The values are normal and bold. πŸ”₯

πŸ’œ 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 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 was perl v5.34.0, dated 2022-06-14, and it's the Graphics::Primitive::Font(3pm) page from the Perl user-contributed documentation. mwah, go render something gorgeous πŸ«ΆπŸ’–
πŸ“¦ where this page comes from