Module: PangoFT2

Defined in:
pango/lib/pango.rb

Overview

Version:

  • 1.0

Defined Under Namespace

Classes: FontMap

Instance Method Summary collapse

Instance Method Details

#font_get_coverage(font, language) ⇒ Pango::Coverage

Gets the Pango::Coverage for a <type>PangoFT2Font</type>. Use pango_font_get_coverage() instead.

Parameters:

  • font (Pango::Font)

    a <type>PangoFT2Font</type>.

  • language (Pango::Language)

    a language tag.

Returns:

#font_get_face(font) ⇒ freetype2::Face

Returns the native FreeType2 <type>FT_Face</type> structure used for this Pango::Font. This may be useful if you want to use FreeType2 functions directly.

Use pango_fc_font_lock_face() instead; when you are done with a face from pango_fc_font_lock_face() you must call pango_fc_font_unlock_face().

Parameters:

Returns:

  • (freetype2::Face)

    a pointer to a <type>FT_Face</type> structure, with the size set correctly, or nil if font is nil.

#font_get_kerning(font, left, right) ⇒ Integer

Retrieves kerning information for a combination of two glyphs.

Use pango_fc_font_kern_glyphs() instead. the given combination of glyphs.

Parameters:

  • font (Pango::Font)

    a Pango::Font

  • left (Pango::Glyph)

    the left Pango::Glyph

  • right (Pango::Glyph)

    the right Pango::Glyph

Returns:

  • (Integer)

    The amount of kerning (in Pango units) to apply for

#get_context(dpi_x, dpi_y) ⇒ Pango::Context

Retrieves a Pango::Context for the default PangoFT2 fontmap (see pango_ft2_font_map_for_display()) and sets the resolution for the default fontmap to dpi_x by dpi_y.

Parameters:

  • dpi_x (Float)

    the horizontal DPI of the target device

  • dpi_y (Float)

    the vertical DPI of the target device

Returns:

#get_unknown_glyph(font) ⇒ Pango::Glyph

Return the index of a glyph suitable for drawing unknown characters with font, or %PANGO_GLYPH_EMPTY if no suitable glyph found.

If you want to draw an unknown-box for a character that is not covered by the font, use PANGO_GET_UNKNOWN_GLYPH() instead.

Parameters:

Returns:

  • (Pango::Glyph)

    a glyph index into font, or %PANGO_GLYPH_EMPTY

#render(bitmap, font, glyphs, x, y) ⇒ nil

Renders a Pango::GlyphString onto a FreeType2 bitmap.

Parameters:

  • bitmap (freetype2::Bitmap)

    the FreeType2 bitmap onto which to draw the string

  • font (Pango::Font)

    the font in which to draw the string

  • glyphs (Pango::GlyphString)

    the glyph string to draw

  • x (Integer)

    the x position of the start of the string (in pixels)

  • y (Integer)

    the y position of the baseline (in pixels)

Returns:

  • (nil)

#render_layout(bitmap, layout, x, y) ⇒ nil

Render a Pango::Layout onto a FreeType2 bitmap

Parameters:

  • bitmap (freetype2::Bitmap)

    a <type>FT_Bitmap</type> to render the layout onto

  • layout (Pango::Layout)

    a Pango::Layout

  • x (Integer)

    the X position of the left of the layout (in pixels)

  • y (Integer)

    the Y position of the top of the layout (in pixels)

Returns:

  • (nil)

#render_layout_line(bitmap, line, x, y) ⇒ nil

Render a Pango::LayoutLine onto a FreeType2 bitmap

Parameters:

  • bitmap (freetype2::Bitmap)

    a <type>FT_Bitmap</type> to render the line onto

  • line (Pango::LayoutLine)

    a Pango::LayoutLine

  • x (Integer)

    the x position of start of string (in pixels)

  • y (Integer)

    the y position of baseline (in pixels)

Returns:

  • (nil)

#render_layout_line_subpixel(bitmap, line, x, y) ⇒ nil

Render a Pango::LayoutLine onto a FreeType2 bitmap, with he location specified in fixed-point Pango units rather than pixels. (Using this will avoid extra inaccuracies from rounding to integer pixels multiple times, even if the final glyph positions are integers.)

Parameters:

  • bitmap (freetype2::Bitmap)

    a <type>FT_Bitmap</type> to render the line onto

  • line (Pango::LayoutLine)

    a Pango::LayoutLine

  • x (Integer)

    the x position of start of string (in Pango units)

  • y (Integer)

    the y position of baseline (in Pango units)

Returns:

  • (nil)

#render_layout_subpixel(bitmap, layout, x, y) ⇒ nil

Render a Pango::Layout onto a FreeType2 bitmap, with he location specified in fixed-point Pango units rather than pixels. (Using this will avoid extra inaccuracies from rounding to integer pixels multiple times, even if the final glyph positions are integers.)

Parameters:

  • bitmap (freetype2::Bitmap)

    a <type>FT_Bitmap</type> to render the layout onto

  • layout (Pango::Layout)

    a Pango::Layout

  • x (Integer)

    the X position of the left of the layout (in Pango units)

  • y (Integer)

    the Y position of the top of the layout (in Pango units)

Returns:

  • (nil)

#render_transformed(bitmap, matrix, font, glyphs, x, y) ⇒ nil

Renders a Pango::GlyphString onto a FreeType2 bitmap, possibly transforming the layed-out coordinates through a transformation matrix. Note that the transformation matrix for font is not changed, so to produce correct rendering results, the font must have been loaded using a Pango::Context with an identical transformation matrix to that passed in to this function.

Parameters:

  • bitmap (freetype2::Bitmap)

    the FreeType2 bitmap onto which to draw the string

  • matrix (Pango::Matrix)

    a Pango::Matrix, or nil to use an identity transformation

  • font (Pango::Font)

    the font in which to draw the string

  • glyphs (Pango::GlyphString)

    the glyph string to draw

  • x (Integer)

    the x position of the start of the string (in Pango units in user space coordinates)

  • y (Integer)

    the y position of the baseline (in Pango units in user space coordinates)

Returns:

  • (nil)

#shutdown_displaynil

Free the global fontmap. (See pango_ft2_font_map_for_display()) Use of the global PangoFT2 fontmap is deprecated.

Returns:

  • (nil)