Gtk2::PrintContext(3)

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

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

  • Gtk2
  • Glib::Object

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