Pango::Cairo(3)

Pango::Cairo(3) but make it make sense πŸ’…

okay so bestie, this is the Pango::Cairo(3) page from the User Contributed Perl Documentation. it's literally the glue between Pango (the text layout queen) and Cairo (the drawing icon), and i'm gonna walk you through every single method so you can slay your rendering game. no cap, let's get into it. ✨


✨ METHODS ✨

layout = Pango::Cairo::create_layout ($cr)

makes you a fresh new layout tied to that cairo context. main character energy fr.

  • $cr β€” a Cairo::Context, the canvas bestie we're all drawing on 🎨

Pango::Cairo::error_underline_path ($cr, $x, $y, $width, $height)

builds the path for that squiggly error underline. you know the vibe β€” the little red wiggle under a typo. it's giving "your code has issues" but make it art.

  • $cr β€” a Cairo::Context πŸ–ŒοΈ
  • $x β€” a double, the x coord
  • $y β€” a double, the y coord
  • $width β€” a double, how wide
  • $height β€” a double, how tall
Since: pango 1.14 🫢

Pango::Cairo::glyph_string_path ($cr, $font, $glyphs)

adds the path for a whole glyph string to the context. this is the "draw the letters as outlines" moment. lowkey iconic.

  • $cr β€” a Cairo::Context 🌈
  • $font β€” a Pango::Font, the font doing the heavy lifting
  • $glyphs β€” a Pango::GlyphString, all the glpyhs in a cute little row

Pango::Cairo::layout_line_path ($cr, $line)

path-ifies one single line of a layout. one line, one vibe, one path. periodt.

  • $cr β€” a Cairo::Context πŸŽ€
  • $line β€” a Pango::LayoutLine, the line in question

Pango::Cairo::layout_path ($cr, $layout)

now we're doing the WHOLE layout as a path. every line, all at once. highkey satisfying.

  • $cr β€” a Cairo::Context πŸ¦‹
  • $layout β€” a Pango::Layout, the full layout

Pango::Cairo::show_error_underline ($cr, $x, $y, $width, $height)

same squiggly error underline energy as above, but this one draws it directly instead of just making a path. instant gratification, no waiting. πŸ’€

  • $cr β€” a Cairo::Context ✏️
  • $x β€” a double
  • $y β€” a double
  • $width β€” a double
  • $height β€” a double
Since: pango 1.14 🫢

Pango::Cairo::show_glyph_string ($cr, $font, $glyphs)

draws the glyph string straight onto the context. no path middleman, we're going direct. slay.

  • $cr β€” a Cairo::Context πŸ’–
  • $font β€” a Pango::Font
  • $glyphs β€” a Pango::GlyphString

Pango::Cairo::show_layout ($cr, $layout)

renders the entire layout right there on the context. the full text, all of it, rendered. obsessed. πŸ”₯

  • $cr β€” a Cairo::Context 🎨
  • $layout β€” a Pango::Layout

Pango::Cairo::show_layout_line ($cr, $line)

just one line of the layout, drawn directly. sometimes you only need a little snack, not the whole meal. πŸ“

  • $cr β€” a Cairo::Context ✨
  • $line β€” a Pango::LayoutLine

Pango::Cairo::update_context ($cr, $context)

syncs your cairo context's font options and stuff over to the pango context. keeping them on the same page, as besties do. 🫢

  • $cr β€” a Cairo::Context πŸ’œ
  • $context β€” a Pango::Context

Pango::Cairo::update_layout ($cr, $layout)

updates a layout with whatever the cairo context is doing. keeps your layout vibing correctly with the graphics context. no cap.

  • $cr β€” a Cairo::Context 🌸
  • $layout β€” a Pango::Layout

🌟 SEE ALSO 🌟

Pango β€” go check the parent page, it's the whole universe this lives in πŸ‘‘


Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Pango for a full notice.


and that's the whole page bestie! πŸ’… this was perl v5.42.0, dated 2019-09-16, Pango::Cairo(3) β€” go forth and render your little heart out. you got this. πŸ¦‹βœ¨

πŸ“¦ where this page comes from