FreeType Fonts and Rendering

Name

FreeType Fonts and Rendering -- 

Synopsis



#define     PANGO_RENDER_TYPE_FT2
PangoContext* pango_ft2_get_context         (void);
PangoFont*  pango_ft2_load_font             (PangoFontMap *fontmap,
                                             FT_Open_Args **open_args,
                                             FT_Long *face_indices,
                                             int n_fonts,
                                             int size);
void        pango_ft2_render                (FT_Bitmap *bitmap,
                                             PangoFont *font,
                                             PangoGlyphString *glyphs,
                                             gint x,
                                             gint y);
void        pango_ft2_render_layout_line    (FT_Bitmap *bitmap,
                                             PangoLayoutLine *line,
                                             int x,
                                             int y);
void        pango_ft2_render_layout         (FT_Bitmap *bitmap,
                                             PangoLayout *layout,
                                             int x,
                                             int y);
typedef     PangoFT2Subfont;
#define     PANGO_FT2_MAKE_GLYPH            (subfont,index)
#define     PANGO_FT2_GLYPH_SUBFONT         (glyph)
#define     PANGO_FT2_GLYPH_INDEX           (glyph)
int         pango_ft2_n_subfonts            (PangoFont *font);
gboolean    pango_ft2_has_glyph             (PangoFont *font,
                                             PangoGlyph glyph);
PangoGlyph  pango_ft2_get_unknown_glyph     (PangoFont *font);
int         pango_ft2_font_get_kerning      (PangoFont *font,
                                             PangoGlyph left,
                                             PangoGlyph right);
struct      PangoFT2FontCache;
PangoFT2FontCache* pango_ft2_font_cache_new (FT_Library library);
void        pango_ft2_font_cache_free       (PangoFT2FontCache *cache);
FT_Face     pango_ft2_font_cache_load       (PangoFT2FontCache *cache,
                                             FT_Open_Args *args,
                                             FT_Long face_index);
void        pango_ft2_font_cache_unload     (PangoFT2FontCache *cache,
                                             FT_Face face);
PangoFontMap* pango_ft2_font_map_for_display
                                            (void);
void        pango_ft2_shutdown_display      (void);
PangoFT2FontCache* pango_ft2_font_map_get_font_cache
                                            (PangoFontMap *font_map);
void        pango_ft2_font_subfont_open_args
                                            (PangoFont *font,
                                             PangoFT2Subfont subfont_id,
                                             FT_Open_Args **open_args,
                                             FT_Long *face_index);
void        pango_ft2_fontmap_dump          (int indent,
                                             PangoFontMap *fontmap);

Description

Details

PANGO_RENDER_TYPE_FT2

#define PANGO_RENDER_TYPE_FT2 "PangoRenderFT2"


pango_ft2_get_context ()

PangoContext* pango_ft2_get_context         (void);

Retrieves a PangoContext appropriate for rendering with Pango fonts.

Returns : the new PangoContext


pango_ft2_load_font ()

PangoFont*  pango_ft2_load_font             (PangoFontMap *fontmap,
                                             FT_Open_Args **open_args,
                                             FT_Long *face_indices,
                                             int n_fonts,
                                             int size);

Loads a logical font based on XXX

fontmap : a PangoFontmap
open_args : parameters that control loading
face_indices : 
n_fonts : 
size : 
Returns : a new PangoFont


pango_ft2_render ()

void        pango_ft2_render                (FT_Bitmap *bitmap,
                                             PangoFont *font,
                                             PangoGlyphString *glyphs,
                                             gint x,
                                             gint y);

Render a PangoGlyphString onto a FreeType2 bitmap

bitmap : the FreeType2 bitmap onto which draw the string
font : the font in which to draw the string
glyphs : the glyph string to draw
x : the x position of start of string (in pixels)
y : the y position of baseline (in pixels)


pango_ft2_render_layout_line ()

void        pango_ft2_render_layout_line    (FT_Bitmap *bitmap,
                                             PangoLayoutLine *line,
                                             int x,
                                             int y);

Render a PangoLayoutLine onto a FreeType2 bitmap

bitmap : a FT_Bitmap to render the line onto
line : a PangoLayoutLine
x : the x position of start of string (in pixels)
y : the y position of baseline (in pixels)


pango_ft2_render_layout ()

void        pango_ft2_render_layout         (FT_Bitmap *bitmap,
                                             PangoLayout *layout,
                                             int x,
                                             int y);

Render a PangoLayoutLine onto a FreeType2 bitmap

bitmap : a FT_Bitmap to render the line onto
layout : a PangoLayout
x : the X position of the left of the layout (in pixels)
y : the Y position of the top of the layout (in pixels)


PangoFT2Subfont

typedef guint16 PangoFT2Subfont;


PANGO_FT2_MAKE_GLYPH()

#define PANGO_FT2_MAKE_GLYPH(subfont,index) ((subfont)<<16 | (index))

subfont : 
index : 


PANGO_FT2_GLYPH_SUBFONT()

#define PANGO_FT2_GLYPH_SUBFONT(glyph) ((glyph)>>16)

glyph : 


PANGO_FT2_GLYPH_INDEX()

#define PANGO_FT2_GLYPH_INDEX(glyph) ((glyph) & 0xFFFF)

glyph : 


pango_ft2_n_subfonts ()

int         pango_ft2_n_subfonts            (PangoFont *font);

Returns number of subfonts in a PangoFT2Font.

font : a PangoFont
Returns : number of subfonts in font


pango_ft2_has_glyph ()

gboolean    pango_ft2_has_glyph             (PangoFont *font,
                                             PangoGlyph glyph);

Check if the given glyph is present in a FT2 font.

font : a PangoFont which must be from the FreeType2 backend.
glyph : the index of a glyph in the font. (Formed using the PANGO_FT2_MAKE_GLYPH macro)
Returns : TRUE if the glyph is present.


pango_ft2_get_unknown_glyph ()

PangoGlyph  pango_ft2_get_unknown_glyph     (PangoFont *font);

Return the index of a glyph suitable for drawing unknown characters.

font : a PangoFont
Returns : a glyph index into font


pango_ft2_font_get_kerning ()

int         pango_ft2_font_get_kerning      (PangoFont *font,
                                             PangoGlyph left,
                                             PangoGlyph right);

font : 
left : 
right : 
Returns : 


struct PangoFT2FontCache

struct PangoFT2FontCache;


pango_ft2_font_cache_new ()

PangoFT2FontCache* pango_ft2_font_cache_new (FT_Library library);

Create a font cache.

library : 
Returns : The new font cache. This must be freed with pango_ft2_font_cache_free().


pango_ft2_font_cache_free ()

void        pango_ft2_font_cache_free       (PangoFT2FontCache *cache);

Free a PangoFT2FontCache and all associated memory. All fonts loaded through this font cache will be freed along with the cache.


pango_ft2_font_cache_load ()

FT_Face     pango_ft2_font_cache_load       (PangoFT2FontCache *cache,
                                             FT_Open_Args *args,
                                             FT_Long face_index);

Load a FT_Face from FT_Open_Args and a face index. The result may be newly loaded, or it may have been previously stored

cache : a PangoFT2FontCache
args : 
face_index : 
Returns : The FT_Face, or NULL if the font could not be loaded. In order to free this structure, you must call pango_ft2_font_cache_unload().


pango_ft2_font_cache_unload ()

void        pango_ft2_font_cache_unload     (PangoFT2FontCache *cache,
                                             FT_Face face);

Free a font structure previously loaded with pango_ft2_font_cache_load()

cache : a PangoFT2FontCache
face : the face to unload


pango_ft2_font_map_for_display ()

PangoFontMap* pango_ft2_font_map_for_display
                                            (void);

Returns : 


pango_ft2_shutdown_display ()

void        pango_ft2_shutdown_display      (void);

Free cached resources.


pango_ft2_font_map_get_font_cache ()

PangoFT2FontCache* pango_ft2_font_map_get_font_cache
                                            (PangoFontMap *font_map);

font_map : 
Returns : 


pango_ft2_font_subfont_open_args ()

void        pango_ft2_font_subfont_open_args
                                            (PangoFont *font,
                                             PangoFT2Subfont subfont_id,
                                             FT_Open_Args **open_args,
                                             FT_Long *face_index);

Determine the FT_Open_Args and face index for the specified subfont.

font : a PangoFont which must be from the FT2 backend
subfont_id : the id of a subfont within the font
open_args : pointer where to store the FT_Open_Args for this subfont
face_index : pointer where to store the face index for this subfont


pango_ft2_fontmap_dump ()

void        pango_ft2_fontmap_dump          (int indent,
                                             PangoFontMap *fontmap);

indent : 
fontmap :