Module: PangoFT2
- Defined in:
- lib/pango/ft2-loader.rb,
lib/pango.rb
Overview
Copyright (C) 2021 Ruby-GNOME Project Team
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Defined Under Namespace
Instance Method Summary collapse
-
#font_get_coverage(font, language) ⇒ Pango::Coverage
Gets the
PangoCoveragefor aPangoFT2Font. -
#font_get_face(font) ⇒ freetype2::Face
Returns the native FreeType2
FT_Facestructure used for thisPangoFont. -
#font_get_kerning(font, left, right) ⇒ Integer
Retrieves kerning information for a combination of two glyphs.
-
#get_context(dpi_x, dpi_y) ⇒ Pango::Context
Retrieves a
PangoContextfor 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. -
#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.
-
#render(bitmap, font, glyphs, x, y) ⇒ nil
Renders a
PangoGlyphStringonto a FreeType2 bitmap. -
#render_layout(bitmap, layout, x, y) ⇒ nil
Render a
PangoLayoutonto a FreeType2 bitmap. -
#render_layout_line(bitmap, line, x, y) ⇒ nil
Render a
PangoLayoutLineonto a FreeType2 bitmap. -
#render_layout_line_subpixel(bitmap, line, x, y) ⇒ nil
Render a
PangoLayoutLineonto a FreeType2 bitmap, with he location specified in fixed-point Pango units rather than pixels. -
#render_layout_subpixel(bitmap, layout, x, y) ⇒ nil
Render a
PangoLayoutonto a FreeType2 bitmap, with he location specified in fixed-point Pango units rather than pixels. -
#render_transformed(bitmap, matrix, font, glyphs, x, y) ⇒ nil
Renders a
PangoGlyphStringonto a FreeType2 bitmap, possibly transforming the layed-out coordinates through a transformation matrix. -
#shutdown_display ⇒ nil
Free the global fontmap.
Instance Method Details
#font_get_coverage(font, language) ⇒ Pango::Coverage
Gets the PangoCoverage for a PangoFT2Font.
Use [methodPango.Font.get_coverage] instead.
#font_get_face(font) ⇒ freetype2::Face
Returns the native FreeType2 FT_Face structure
used for this PangoFont.
This may be useful if you want to use FreeType2 functions directly.
Use [methodPangoFc.Font.lock_face] instead; when you are done with a face from [methodPangoFc.Font.lock_face], you must call [methodPangoFc.Font.unlock_face].
#font_get_kerning(font, left, right) ⇒ Integer
Retrieves kerning information for a combination of two glyphs.
Use pango_fc_font_kern_glyphs() instead.
#get_context(dpi_x, dpi_y) ⇒ Pango::Context
Retrieves a PangoContext 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.
#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.
#render(bitmap, font, glyphs, x, y) ⇒ nil
Renders a PangoGlyphString onto a FreeType2 bitmap.
#render_layout(bitmap, layout, x, y) ⇒ nil
Render a PangoLayout onto a FreeType2 bitmap
#render_layout_line(bitmap, line, x, y) ⇒ nil
Render a PangoLayoutLine onto a FreeType2 bitmap
#render_layout_line_subpixel(bitmap, line, x, y) ⇒ nil
Render a PangoLayoutLine 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.)
#render_layout_subpixel(bitmap, layout, x, y) ⇒ nil
Render a PangoLayout 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.)
#render_transformed(bitmap, matrix, font, glyphs, x, y) ⇒ nil
Renders a PangoGlyphString 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 PangoContext with an identical
transformation matrix to that passed in to this function.
#shutdown_display ⇒ nil
Free the global fontmap. (See pango_ft2_font_map_for_display()) Use of the global PangoFT2 fontmap is deprecated.