Gtk2::Pango(3)
π Gtk2::Pango β the manual page, but make it make sense π
okay bestie, so this is Gtk2::Pango(3), part of the User Contributed Perl Documentation (yes it's giving official-but-also-community, we love that for it) π«Ά
β¨ NAME β¨
Gtk2::Pango β literally just constants for use with Pango. that's the whole job. that's the gig. π
πΈ SYNOPSIS πΈ
so you load it like this, no cap:
use Gtk2; # gets the actual Pango objects and methods
use Gtk2::Pango; # load extra constants
first line gets you the real Pango objects and methods, second line is where the extra constants come in. two lines, two vibes. iconic. β¨
π¦ DESCRIPTION π¦
okay so here's the tea: to use Pango effectively, you need a few extra constants that the type system or other normal channels just⦠do not supply. like, they're not available through the usual routes, periodt.
this module exports all of those extra constants the moment you load it. and they use the fully-prefixed names from the C documentation, so if you know the C docs you'll recognise everything. iykyk. π
π EXPORT π
okay so, real talk: PangoWeight is defined as an enumerated type, and its values can be used as nickname strings in the perl bindings. cute! but β and this is the plot twist β in several places where a weight is needed, a gint is requested instead. π
why? because PangoWeight is actually just a set of predefined values for an integer-valued property. that's it. that's the lore. so the PANGO_WEIGHT_* constants hand you those predefined values:
PANGO_WEIGHT_ULTRALIGHT
PANGO_WEIGHT_LIGHT
PANGO_WEIGHT_NORMAL
PANGO_WEIGHT_BOLD
PANGO_WEIGHT_ULTRABOLD
PANGO_WEIGHT_HEAVY
those six are #defined in the C source, and thus are not available anywhere except here. literally nowhere else. this module is their only home. π
and these ones? same situation, same energy, also #defined in the C source and also only findable right here:
PANGO_SCALE_XX_SMALL
PANGO_SCALE_X_SMALL
PANGO_SCALE_SMALL
PANGO_SCALE_MEDIUM
PANGO_SCALE_LARGE
PANGO_SCALE_X_LARGE
PANGO_SCALE_XX_LARGE
and finally, the main character of the scale situation:
PANGO_SCALE
PANGO_SCALE is what you need to convert between Pango units and pixels. it's also available as Gtk2::Pango->scale. so you've got options, bestie. π
π BUGS π
ngl, this module shouldn't exist. but some parts of the API just aren't clean, and here we are. not me being the patch for someone else's mess. π
also, important: this stuff is hardcoded directly from the headers of pango 1.2.1. hardcoded. straight from the headers. no cap. π₯
π SEE ALSO π
π AUTHOR π
muppet <scott AT asofyet.org>
π COPYRIGHT AND LICENSE π
Copyright 2003 by muppet
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
and yeah β that warranty disclaimer is doing a LOT of heavy lifting, so don't come for me if something explodes. read it. it's real. π«Ά
okay that's the whole page, bestie, you ate it. π and for the record, this was perl v5.42.0, dated 2025-07-25 β go forth and scale your pixels correctly. mwah. πβ¨π§
π¦ where this page comes from
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms