PangoFcFont

PangoFcFont — Base font class for Fontconfig-based backends

Synopsis

                    PangoFcFont;
                    PangoFcFontClass;
#define             PANGO_RENDER_TYPE_FC
FT_Face             pango_fc_font_lock_face             (PangoFcFont *font);
void                pango_fc_font_unlock_face           (PangoFcFont *font);
gboolean            pango_fc_font_has_char              (PangoFcFont *font,
                                                         gunichar wc);
guint               pango_fc_font_get_glyph             (PangoFcFont *font,
                                                         gunichar wc);
PangoGlyph          pango_fc_font_get_unknown_glyph     (PangoFcFont *font,
                                                         gunichar wc);
void                pango_fc_font_kern_glyphs           (PangoFcFont *font,
                                                         PangoGlyphString *glyphs);

Object Hierarchy

  GObject
   +----PangoFont
         +----PangoFcFont
               +----PangoXftFont

Properties

  "pattern"                  gpointer              : Write / Construct Only

Description

PangoFcFont is a base class for font implementation using the Fontconfig and FreeType libraries. It is used in the Xft and FreeType backends shipped with Pango, but can also be used when creating new backends. Any backend deriving from this base class will take advantage of the wide range of shapers implemented using FreeType that come with Pango.

Details

PangoFcFont

typedef struct _PangoFcFont PangoFcFont;

PangoFcFont is a base class for font implementations using the Fontconfig and FreeType libraries and is used in conjunction with PangoFcFontMap. When deriving from this class, you need to implement all of its virtual functions other than shutdown() along with the get_glyph_extents() virtual function from PangoFont.


PangoFcFontClass

typedef struct {
  FT_Face    (*lock_face)         (PangoFcFont      *font);
  void       (*unlock_face)       (PangoFcFont      *font);
  gboolean   (*has_char)          (PangoFcFont      *font,
				   gunichar          wc);
  guint      (*get_glyph)         (PangoFcFont      *font,
				   gunichar          wc);
  PangoGlyph (*get_unknown_glyph) (PangoFcFont      *font,
				   gunichar          wc);
  void       (*shutdown)          (PangoFcFont      *font);
} PangoFcFontClass;

Class structure for PangoFcFont.

lock_face ()

Returns the FT_Face of the font and increases the reference count for the face by one.

unlock_face ()

Decreases the reference count for the FT_Face of the font by one. When the count is zero, the PangoFcFont subclass is allowed to free the FT_Face.

has_char ()

Return TRUE if the the font contains a glyph corresponding to the specified character.

get_glyph ()

Gets the glyph that corresponds to the given Unicode character.

get_unknown_glyph ()

Gets the glyph that should be used to display an unknown-glyph indication for the specified Unicode character. May be NULL.

shutdown ()

Performs any font-specific shutdown code that needs to be done when pango_fc_font_map_shutdown is called. May be NULL.

PANGO_RENDER_TYPE_FC

#define PANGO_RENDER_TYPE_FC "PangoRenderFc"

A string constant used to identify shape engines that work with the fontconfig based backends. See the engine_type field of PangoEngineInfo.


pango_fc_font_lock_face ()

FT_Face             pango_fc_font_lock_face             (PangoFcFont *font);

Gets the FreeType FT_Face associated with a font, This face will be kept around until you call pango_fc_font_unlock_face().

font :

a PangoFcFont.

Returns :

the FreeType FT_Face associated with font.

Since 1.4


pango_fc_font_unlock_face ()

void                pango_fc_font_unlock_face           (PangoFcFont *font);

Releases a font previously obtained with pango_fc_font_lock_face().

font :

a PangoFcFont.

Since 1.4


pango_fc_font_has_char ()

gboolean            pango_fc_font_has_char              (PangoFcFont *font,
                                                         gunichar wc);

Determines whether font has a glyph for the codepoint wc.

font :

a PangoFcFont

wc :

Unicode codepoint to look up

Returns :

TRUE if font has the requested codepoint.

Since 1.4


pango_fc_font_get_glyph ()

guint               pango_fc_font_get_glyph             (PangoFcFont *font,
                                                         gunichar wc);

Gets the glyph index for a given Unicode character for font. If you only want to determine whether the font has the glyph, use pango_fc_font_has_char().

font :

a PangoFcFont

wc :

Unicode character to look up

Returns :

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

Since 1.4


pango_fc_font_get_unknown_glyph ()

PangoGlyph          pango_fc_font_get_unknown_glyph     (PangoFcFont *font,
                                                         gunichar wc);

Warning

pango_fc_font_get_unknown_glyph is deprecated and should not be used in newly-written code.

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

Use PANGO_GET_UNKNOWN_GLYPH() instead.

font :

a PangoFcFont

wc :

the Unicode character for which a glyph is needed.

Returns :

a glyph index into font.

Since 1.4


pango_fc_font_kern_glyphs ()

void                pango_fc_font_kern_glyphs           (PangoFcFont *font,
                                                         PangoGlyphString *glyphs);

Adjust each adjacent pair of glyphs in glyphs according to kerning information in font.

font :

a PangoFcFont

glyphs :

a PangoGlyphString

Since 1.4

Property Details

The "pattern" property

  "pattern"                  gpointer              : Write / Construct Only

The fontconfig pattern for this font.

See Also

PangoFcFontMap

The base class for font maps; creating a new Fontconfig-based backend involves deriving from both PangoFcFontMap and PangoFcFont. .