Gtk2::Pango(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– 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 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