user1109856
user1109856

Reputation: 61

Gtkmm+Pango::layout

How can i set different different text attributes to Pango::layout.

For example: I have a Text "WELCOME" and lets say "W" is bold,"E" is italic and "L" has red color and so on.. then if i render this text in cairo context using Pango::Layout, like

Glib::RefPtr layout = ...->create_pango_layout(); layout->set_text("WELCOME"). 1. But I want individual character of this should be rendered with different Attributes. 2. I should be able to set line by line alignment also.

Please anyone help me to resole rendering issue with Pango::layout?

Upvotes: 0

Views: 1061

Answers (1)

Ivarpoiss
Ivarpoiss

Reputation: 1035

  1. You can use layout->set_markup for that. http://developer.gnome.org/pango/stable/PangoMarkupFormat.html

  2. Pango layout is designed to deal with whole paragraphs of text. So you would need a separate layout for each alignment.

Upvotes: 1

Related Questions