re: Pango Layout, Cairo, and Drawing Areas
- From: "Roy, Andre Robert" <t5pk1 unb ca>
- To: gtkmm-list gnome org
- Subject: re: Pango Layout, Cairo, and Drawing Areas
- Date: Wed, 2 Jan 2008 11:31:07 -0400
Quoting "Roy, Andre Robert" <t5pk1 unb ca>:
>
>
>
>
> Hi folks,
>
> Just an update, I figured out how to render pango layouts with cairo!! :)
>
> here are a few lines of text to demonstrate:
>
> Cairo::RefPtr<Cairo::Context> cr = window->create_cairo_context();
> Glib::RefPtr<Pango::Layout> pangoLayout = Pango::Layout::create (cr);
> cr->move_to(doublexpos,doubleypos);
> pangoLayout->set_text("text");
> pangoLayout->update_from_cairo_context(cr); //gets cairo cursor position
> pangoLayout->add_to_cairo_context(cr); //adds text to cairos stack of stuff
> to
> be drawn
> cr->stroke(); //tells Cairo to render
> it's
> stack
>
> So That should now help all the folks who pulled their hair just like me trying to
> figure out how to use pango with cairo and gtkmm.
>
> I have an extra question to pose which may not get an answer since noone was able to
> tell me how to render pango text: How do I rotate text?
>
> Thanks
>
> Andre
>
Nevermind, I figured out how to rotate text
example:
cr->rotate(double radians);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]