ruby-****@sourc*****
ruby-****@sourc*****
2005年 3月 29日 (火) 18:23:57 JST
------------------------- REMOTE_ADDR = 15.211.169.100 REMOTE_HOST = REMOTE_USER = ruby-gnome2-hiki URL = http://ruby-gnome2.sourceforge.jp/cgi-bin/hiki/hiki.cgi?pango-markup ------------------------- @@ -1,6 +1,4 @@ -Simple markup language to encode text with attributes - -== Pango Text Attribute Markup Language += Pango Text Attribute Markup Language Frequently, you want to display some text to the user with attributes applied to part of the text (for example, you might want bold or italicized words). With the base Pango interfaces, you could create a Pango::AttrList and apply it to the text; the problem is that you'd need to apply attributes to some numeric range of characters, for example "characters 12-17." This is broken from an internationalization standpoint; once the text is translated, the word you wanted to italicize could be in a different position. The solution is to include the text attributes in the string to be translated. Pango provides this feature with a small markup language. You can parse a marked-up string into the string text plus a Pango::AttrList using the function Pango.parse_markup.