ruby-****@sourc*****
ruby-****@sourc*****
2005年 11月 7日 (月) 18:08:45 JST
------------------------- REMOTE_ADDR = 15.211.169.100 REMOTE_HOST = REMOTE_USER = ruby-gnome2-hiki URL = /hiki.cgi?Pango%3A%3AContext ------------------------- @@ -16,6 +16,16 @@ == Instance Methods +--- itemize(text, start_index, length, attrs, cached_iter = nil) + Breaks a piece of text into segments with consistent directional level and shaping engine. Each byte of text will be contained in exactly one of the items in the returned list; the generated list of items will be in logical order (the start offsets of the items are ascending). + cached_iter should be an iterator over attrs currently positioned at a range before or containing start_index; cached_iter will be advanced to the range covering the position just after start_index + length. (i.e. if itemizing in a loop, just keep passing in the same cached_iter). + * text: the text(String) to itemize. + * start_index: first byte in text to process + * length: the number of bytes (not characters) to process after start_index. This must be >= 0. + * attrs: the set of attributes that apply to text. (Pango::AttrList) + * cached_iter : Cached attribute iterator, or nil + * Returns: an Array of Pango::Item. + --- font_map Gets the Pango::Fontmap used to look up fonts for this context. ((* Sinece 1.6 *)) * Returns : the font map for the Pango::Context. This value is owned by Pango and should not be unreferenced. @@ -24,86 +34,117 @@ * font_map: the Pango::FontMap to set. * Returns: font_map --- set_font_map(font_map) - Same as font_map=. + Same as Pango::FontDescription#font_map=. * font_map: the Pango::FontMap to set. * Returns: self +--- font_description + Retrieve the default font description for the context. + * Returns: the context's default Pango::FontDescription +--- font_description=(desc) + Set the default font description for the context + * desc: the new pango font description + * Returns: desc +--- set_font_description(desc) + Same as Pango::Context#font_description=. + * desc: the new pango font description + * Returns: self + +--- language + Retrieves the global language tag for the context. + * Returns: the global language tag (Pango::Language). +--- language=(language) + Sets the global language tag for the context. + * language: the new language tag (Pango::Language). + * Returns: language +--- set_language(language) + Same as Pango::Context#language=. + * language: the new language tag (Pango::Language). + * Returns: self + --- base_dir - - * Returns: self ---- base_dir= - - * Returns: self + Retrieves the base direction for the context. See Pango::Context#base_dir=. + * Returns: the base direction(Pango::Context#Direction) for the context. +--- base_dir=(direction) + Sets the base direction for the context. The base direction is used in applying the Unicode bidirectional algorithm; if the direction is Pango::Context::DIRECTION_LTR or Pango::Context::DIRECTION_RTL, then the value will be used as the paragraph direction in the Unicode bidirectional algorithm. A value of Pango::Context::DIRECTION_WEAK_LTR or Pango::Context::DIRECTION_WEAK_RTL is used only for paragraphs that do not contain any strong characters themselves. + * direction: the new base direction(Pango::Context#Direction) + * Returns: direction +--- set_base_dir(direction) + Same as Pango::Context#base_dir=. + * direction: the new base direction(Pango::Context#Direction) + * Returns: self + +--- matrix + Gets the transformation matrix that will be applied when rendering with this context. See Pango::Context#matrix=. ((* Since 1.6 *)) + * Returns: the matrix, or nil if no matrix has been set (which is the same as the identity matrix). +--- matrix=(matrix) + Sets the transformation matrix that will be applied when rendering with this context. Note that reported metrics are in the user space coordinates before the application of the matrix, not device-space coordiantes after the application of the matrix. So, they don't scale with the matrix, though they may change slightly for different matrices, depending on how the text is fit to the pixel grid. ((* Since 1.6 *)) + * matrix: a Pango::Matrix, or nil to unset any existing matrix. (No matrix set is the same as setting the identity matrix.) + * Returns: matrix +--- set_matrix(matrix) + Same as Pango::Context#matrix=. ((* Since 1.6 *)) + * matrix: a Pango::Matrix, or nil to unset any existing matrix. (No matrix set is the same as setting the identity matrix.) + * Returns: self + +--- load_font(desc) + Loads the font in one of the fontmaps in the context that is the closest match for desc. + * desc: a Pango::FontDescription describing the font to load + * Returns: the Pango::Font loaded, or nil if no font matched. + +--- load_fontset(desc, language) + Load a set of fonts in the context that can be used to render a font matching desc. + * desc: a Pango::FontDescription describing the fonts to load + * language: a Pango::Language the fonts will be used for + * Returns: the Pango::Fontset, or nil if no font matched. + +--- get_metrics(desc, language = nil) + Get overall metric information for a font particular font description. Since the metrics may be substantially different for different scripts, a language tag can be provided to indicate that the metrics should be retrieved that correspond to the script(s) used by that language. + The Pango::FontDescription is interpreted in the same way as by Pango::Context#itemize, and the family name may be a comma separated list of figures. If characters from multiple of these families would be used to render the string, then the returned fonts would be a composite of the metrics for the fonts loaded for the individual families. + * desc: a Pango::FontDescription + * language: language tag used to determine which script to get the metrics for. nil means that the language tag from the context will be used. If no language tag is set on the ccontext, metrics large enough to cover a range of languages will be returned. The process of determining such metrics is slow, so it is best to always make sure some real language tag will be used. + * Returns: a Pango::FontMetrics object. + --- families + List all families for a context. + * Returns: an Array of Pango::FontFamily. + +--- list_families + Same as Pango::Context#families. ((* Deprecated *)) + * Returns: an Array of Pango::FontFamily. + +--- resolution + Gets the resolution for the context. See Pango::Context#resolution=. + * Returns: the resolution in "dots per inch". A negative value will be returned if no resolution has previously been set. ((* Since 1.10 *)), ((* Ruby/Cairo *)) +--- resolution= * Returns: self ---- font_description +--- set_resolution * Returns: self ---- font_description= - - * Returns: self + --- font_options * Returns: self --- font_options= * Returns: self ---- get_metrics - - * Returns: self ---- itemize - - * Returns: self ---- language - - * Returns: self ---- language= - - * Returns: self ---- list_families - - * Returns: self ---- load_font - - * Returns: self ---- load_fontset - - * Returns: self ---- matrix - - * Returns: self ---- matrix= - - * Returns: self ---- resolution - - * Returns: self ---- resolution= - - * Returns: self ---- set_base_dir - - * Returns: self --- set_colormap * Returns: self --- set_colormap= * Returns: self ---- set_font_description - - * Returns: self --- set_font_options - - * Returns: self ---- set_language - - * Returns: self ---- set_matrix - - * Returns: self ---- set_resolution * Returns: self @@ -132,4 +163,36 @@ == ChangeLog +* 2005-11-07 Modified. - ((<Masao>)) * 2005-11-04 Added. - ((<Masao>))