Gtk2::PrintContext(3)
π Gtk2::PrintContext π
okay bestie, so this is Gtk2::PrintContext β the wrapper for GtkPrintContext in gtk2-perl. It's the lil guy that carries all your printing context around while you're doing printy stuff. She's the main character of your print job, no cap. π¨οΈβ¨
πΈ HIERARCHY πΈ
Glib::Object
+----Gtk2::PrintContext
so yeah, she's a Glib::Object at heart, and Gtk2::PrintContext is her whole personality. Classy lineage fr fr. π
β¨ METHODS β¨
context = $context->get_cairo_contextβ hands you back the Cairo context, bestie. your drawing canvas, basically. π¨$context->set_cairo_context ($cr, $dpi_x, $dpi_y)β sets that Cairo context up with your own, and you gotta tell her the resolution too. the args are giving:$cr(Cairo::Context) β the cairo context itself, iconic$dpi_x(double) β dots per inch, horizontal direction π$dpi_y(double) β dots per inch, vertical direction π
context = $context->create_pango_contextβ mints you a fresh pango context. text rendering era. π€layout = $context->create_pango_layoutβ and here's a pango layout to go with it, slay. πdouble = $context->get_dpi_xβ tells you the horizontal dpi. a number, a vibe, a whole mood.double = $context->get_dpi_yβ same energy but vertical. the y-axis is also valid okay π€(top, bottom, left, right) = $context->get_hard_marginsβ returns your hard margins in that order: top, bottom, left, right. the immovable boundaries, the ones that said "not today" to your content. π§
heads up bestie: it returns an empty list if the hard margins could not be retrieved. not an error, not a crash, just... nothing. a void. π
Since: gtk+ 2.20
double = $context->get_heightβ the height. she's tall, she's giving verticality. πpagesetup = $context->get_page_setupβ returns the page setup object. all your paper sizes and orientations live in there. ποΈfontmap = $context->get_pango_fontmapβ the pango fontmap, aka the font situation. fonts are literally the whole point of printing tbh. π °οΈdouble = $context->get_widthβ the width. horizontal queen. π
π SEE ALSO π
Gtk2Glib::Object
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
and that's the whole page, bestie!! this was perl v5.42.0, dated 2025-07-25, and it's the Gtk2::PrintContext(3) manual page β go print something gorgeous, ily, bye ππ¦
π¦ 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