Gtkmm+Pango::layout
How can i set different different text attributes to Pango::layout.
For example: I have a Text "WELCOME" 开发者_如何学JAVAand 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?
You can use layout->set_markup for that. http://developer.gnome.org/pango/stable/PangoMarkupFormat.html
Pango layout is designed to deal with whole paragraphs of text. So you would need a separate layout for each alignment.
精彩评论