# File gtk/sample/gtk-demo/textview.rb, line 69
    def create_tags(buffer)
      ##
      #  Create a bunch of tags. Note that it's also possible to
      #  create tags with Gtk::TextTag.new then add them to the
      #  tag table for the buffer, Gtk::TextBuffer#create_tag is
      #  just a convenience function. Also note that you don't have
      #  to give tags a name; pass NULL for the name to create an
      #  anonymous tag.
      # 
      #  In any real app, another useful optimization would be to create
      #  a Gtk::TextTagTable in advance, and reuse the same tag table for
      #  all the buffers with the same tag set, instead of creating
      #  new copies of the same tags for every buffer.
      # 
      #  Tags are assigned default priorities in order of addition to the
      #  tag table.      That is, tags created later that affect the same text
      #  property affected by an earlier tag will override the earlier
      #  tag.  You can modify tag priorities with
      #  Gtk::TextTag#set_priority.
      #

      buffer.create_tag('heading',
                        'weight' => Pango::FontDescription::WEIGHT_BOLD,
                        'size' => 15 * Pango::SCALE)
      
      buffer.create_tag("italic",
                        "style" => Pango::FontDescription::STYLE_ITALIC)

      buffer.create_tag("bold",
                        "weight" => Pango::FontDescription::WEIGHT_BOLD)
      
      buffer.create_tag("big",
                        # points times the PANGO_SCALE factor 
                        "size" => 20 * Pango::SCALE)

      buffer.create_tag("xx-small",
                        "scale" => Pango::AttrScale::XX_SMALL)

      buffer.create_tag("x-large",
                        "scale" => Pango::AttrScale::X_LARGE)
      
      buffer.create_tag("monospace", "family" => "monospace")
      
      buffer.create_tag("blue_foreground", "foreground" => "blue")

      buffer.create_tag("red_background", "background" => "red")

      stipple = Gdk::Pixmap.create_from_data(nil, GRAY50_BITS, GRAY50_WIDTH,
                                             GRAY50_HEIGHT)
      
      buffer.create_tag("background_stipple",
                        "background_stipple" => stipple)

      buffer.create_tag("foreground_stipple",
                        "foreground_stipple" => stipple)

      buffer.create_tag("big_gap_before_line",
                        "pixels_above_lines" => 30)

      buffer.create_tag("big_gap_after_line",
                        "pixels_below_lines" => 30)

      buffer.create_tag("double_spaced_line",
                        "pixels_inside_wrap" => 10)

      buffer.create_tag("not_editable",
                         "editable" => false)
      
      buffer.create_tag("word_wrap",
                        "wrap_mode" => Gtk::TextTag::WRAP_WORD)

      buffer.create_tag("char_wrap",
                        "wrap_mode" => Gtk::TextTag::WRAP_CHAR)

      buffer.create_tag("no_wrap",
                        "wrap_mode" => Gtk::TextTag::WRAP_NONE)
      
      buffer.create_tag("center",
                        "justification" => Gtk::JUSTIFY_CENTER)

      buffer.create_tag("right_justify",
                        "justification" => Gtk::JUSTIFY_RIGHT)

      buffer.create_tag("wide_margins",
                        "left_margin" => 50,
                          "right_margin" => 50)
      
      buffer.create_tag("strikethrough",
                        "strikethrough" => true)
      
      buffer.create_tag("underline",
                        "underline" => Pango::AttrUnderline::SINGLE)

      buffer.create_tag("double_underline",
                        "underline" => Pango::AttrUnderline::DOUBLE)

      buffer.create_tag("superscript",
                        "rise" => 10 * Pango::SCALE, #  10 pixels 
                        "size" => 8 * Pango::SCALE)  #  8 points 
      
      buffer.create_tag("subscript",
                        "rise" => -10 * Pango::SCALE, #  10 pixels 
                        "size" => 8 * Pango::SCALE) #  8 points 

      buffer.create_tag("rtl_quote",
                        "wrap_mode" => Gtk::TextTag::WRAP_WORD,
                        "direction" => Gtk::Widget::TEXT_DIR_RTL,
                        "indent" => 30,
                        "left_margin" => 20,
                        "right_margin" => 20)
    end