开发者

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?


  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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜