Class: PangoFc::Font

Inherits:
Pango::Font show all
Defined in:
(unknown)

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pango::Font

#describe, #describe_with_absolute_size, descriptions_free, deserialize, #face, #font_map, #get_coverage, #get_features, #get_glyph_extents, #get_metrics, #hb_font, #serialize

Class Method Details

.description_from_pattern(pattern, include_size) ⇒ Pango::FontDescription

Creates a PangoFontDescription that matches the specified Fontconfig pattern as closely as possible.

Many possible Fontconfig pattern values, such as %FC_RASTERIZER or %FC_DPI, don't make sense in the context of PangoFontDescription, so will be ignored.

Parameters:

  • pattern (fontconfig::Pattern)

    a FcPattern

  • include_size (Boolean)

    if true, the pattern will include the size from the pattern; otherwise the resulting pattern will be unsized. (only %FC_SIZE is examined, not %FC_PIXEL_SIZE)

Returns:

Instance Method Details

#fontmapPangoFc::FontMap

The PangoFc font map this font is associated with.

Returns:

#fontmap=(fontmap) ⇒ PangoFc::FontMap

The PangoFc font map this font is associated with.

Parameters:

Returns:

#get_glyph(wc) ⇒ Integer

Gets the glyph index for a given Unicode character for font.

If you only want to determine whether the font has the glyph, use [methodPangoFc.Font.has_char].

Parameters:

  • wc (String)

    Unicode character to look up

Returns:

  • (Integer)

    the glyph index, or 0, if the Unicode character doesn't exist in the font.

#get_unknown_glyph(wc) ⇒ Pango::Glyph

Returns the index of a glyph suitable for drawing wc as an unknown character.

Use PANGO_GET_UNKNOWN_GLYPH() instead.

Parameters:

  • wc (String)

    the Unicode character for which a glyph is needed.

Returns:

  • (Pango::Glyph)

    a glyph index into font.

#has_char(wc) ⇒ Boolean

Determines whether font has a glyph for the codepoint wc.

Parameters:

  • wc (String)

    Unicode codepoint to look up

Returns:

  • (Boolean)

    true if font has the requested codepoint.

#kern_glyphs(glyphs) ⇒ nil

This function used to adjust each adjacent pair of glyphs in glyphs according to kerning information in font.

Since 1.44, it does nothing.

Parameters:

  • glyphs (Pango::GlyphString)

    a PangoGlyphString

Returns:

  • (nil)

#languagesArray<Pango::Language>

Returns the languages that are supported by font.

This corresponds to the FC_LANG member of the FcPattern.

The returned array is only valid as long as the font and its fontmap are valid.

Returns:

#lock_facefreetype2::Face

Gets the FreeType FT_Face associated with a font.

This face will be kept around until you call [methodPangoFc.Font.unlock_face].

Returns:

  • (freetype2::Face)

    the FreeType FT_Face associated with font.

#patternGObject

The fontconfig pattern for this font.

Returns:

  • (GObject)

    pattern

#pattern=(pattern) ⇒ GObject

The fontconfig pattern for this font.

Parameters:

  • pattern (GObject)

Returns:

  • (GObject)

    pattern

  • (GObject)

    pattern

#unlock_facenil

Releases a font previously obtained with [methodPangoFc.Font.lock_face].

Returns:

  • (nil)