Advertisement
Vultraz

Untitled

Jul 16th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1.     // Add a path to the cairo context encompassing the current text settings.
  2.     pango_cairo_layout_path(cr.get(), &layout);
  3.  
  4.     // Set color for background outline.
  5.     cairo_set_source_rgba(cr.get(), 0.0, 0.0, 0.0, 1.0);
  6.  
  7.     cairo_set_line_join(cr.get(), CAIRO_LINE_JOIN_ROUND);
  8.     cairo_set_line_width(cr.get(), 2.0); // Adjust as necessary
  9.  
  10.     // Stroke path to draw outline, but don't delete it.
  11.     cairo_stroke_preserve(cr.get());
  12.  
  13.     // Set main text color.
  14.     cairo_set_source_rgba(cr.get(),
  15.         foreground_color_.r / 255.0,
  16.         foreground_color_.g / 255.0,
  17.         foreground_color_.b / 255.0,
  18.         foreground_color_.a / 255.0
  19.     );
  20.  
  21.     // Draw main text.
  22.     cairo_fill(cr.get());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement