Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Back  Login

Pango::GlyphItem Diff - Ruby-GNOME2 Project Website

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

= class Pango::GlyphItem

A Pango::GlyphItem is a pair of a Pango::Item and the glyphs resulting from shaping the text corresponding to an item. As an example of the usage of Pango::GlyphItem, the results of shaping text with Pango::Layout is a list of Pango::LayoutLine, each of which contains a list of Pango::GlyphItem.

== Object Hierarchy

* Object
  * GLib::Boxed
    * Pango::GlyphItem

== Instance Methods

--- item

    Gets a Pango::Item that provides information about a segment of text.
    * Returns: a Pango::Item

--- glyphs

    the glyphs obtained by shaping the text corresponding to item.
    * Returns: the Pango::GlyphString

--- split(text, split_index)

    Modifies self to cover only the text after split_index, and returns a new item that covers the text before split_index that used to be in self. You can think of split_index as the length of the returned item. split_index may not be 0, and it may not be greater than or equal to the length of self (that is, there must be at least one byte assigned to each item, you can't create a zero-length item).
    This method is similar in function to Pango::Item#split (and uses it internally). ((* Since 1.2 *))
    * text: text to which positions in self apply.  
    * split_index: byte index of position to split item, relative to the start of the item  
    * Returns: new Pango::GlyphItem representing text before split_index

--- appy_attrs(text, attrs)

    Splits a shaped item (Pango::GlyphItem) into multiple items based on an attribute list. The idea is that if you have attributes that don't affect shaping, such as color or underline, to avoid affecting shaping, you filter them out (Pango::AttrList#filter), apply the shaping process and then reapply them to the result using this method.
    All attributes that start or end inside a cluster are applied to that cluster; for instance, if half of a cluster is underlined and the other-half strikethough, then the cluster will end up with both underline and strikethrough attributes. In these cases, it may happen that item.extra_attrs for some of the result items can have multiple attributes of the same type. ((* Since 1.2 *))
    * text: text that list applies to  
    * list: a Pango::AttrList  
    * Returns: an Array of Pango::GlyphItem resulting from splitting self

--- letter_space(text, log_attrs, letter_spacing)

    Adds spacing between the graphemes of self to give the effect of typographic letter spacing. ((* Since 1.6*))
    * text: text that self corresponds to (self.item.offset is an offset from the start of text)  
    * log_attrs: logical attributes(Pango::LogAttr) for the item (the first logical attribute refers to the position before the first character in the item)
    * letter_spacing : amount of letter spacing to add in Pango units. May be negative, though too large negative values will give ugly results.  
    * Returns: self

== See Also

== ChangeLog

* 2005-12-09 Added. - ((<Masao>))