GNOME Print Fonts and Rendering

GNOME Print Fonts and Rendering —

Synopsis




struct      PangoGPLayout;
#define     PANGO_RENDER_TYPE_GP
struct      PangoGPFontMap;
PangoContext* pango_gp_get_context          (GnomePrintContext *gpc);
PangoFontMap* pango_gp_font_map_for_display (void);
void        pango_gp_shutdown_display       (void);
void        pango_gp_render                 (PangoContext *context,
                                             PangoLayoutRun *run,
                                             PangoFont *font,
                                             PangoGlyphString *glyphs,
                                             gint x,
                                             gint y);
void        pango_gp_render_layout_line     (PangoContext *context,
                                             PangoLayoutLine *line,
                                             gint x,
                                             gint y);
void        pango_gp_render_layout_lines    (PangoContext *context,
                                             PangoLayout *layout,
                                             gint line_first,
                                             gint line_last,
                                             gint x,
                                             gint y);
void        pango_gp_render_layout          (PangoContext *context,
                                             PangoLayout *layout,
                                             gint x,
                                             gint y);
PangoFontMap* pango_gp_font_map_new         (void);
void        pango_gp_font_map_set_resolution
                                            (PangoGPFontMap *fontmap,
                                             double dpi_x,
                                             double dpi_y);
void        pango_gp_font_map_set_default_substitute
                                            (PangoGPFontMap *fontmap,
                                             PangoGPSubstituteFunc func,
                                             gpointer data,
                                             GDestroyNotify notify);
void        pango_gp_font_map_substitute_changed
                                            (PangoGPFontMap *fontmap);
PangoContext* pango_gp_font_map_create_context
                                            (PangoGPFontMap *fontmap);
enum        PangoGPFontEmbed;
enum        PangoGPDebugFlags;
PangoContext* pango_gp_font_map_create_context_with_debug_flags
                                            (PangoGPFontMap *fontmap,
                                             PangoGPDebugFlags debug_flags);
void        pango_gp_layout_set_line_height (PangoLayout *layout,
                                             gint line_height);
void        pango_gp_layout_set_line_stacking_strategy
                                            (PangoLayout *layout,
                                             PangoLineStackingStrategy line_stacking_strategy);
gint        pango_gp_layout_get_item_attrs  (PangoItem *item,
                                             PangoAttrType first_attribute_type,
                                             ...);
PangoGlyph  pango_gp_get_unknown_glyph      (PangoFont *font);
int         pango_gp_font_get_kerning       (PangoFont *font,
                                             PangoGlyph left,
                                             PangoGlyph right);
FT_Face     pango_gp_font_get_face          (PangoFont *font);
PangoCoverage* pango_gp_font_get_coverage   (PangoFont *font,
                                             PangoLanguage *language);


Description

Details

struct PangoGPLayout

struct PangoGPLayout;

pangogp-specific child type of PangoLayout.


PANGO_RENDER_TYPE_GP

#define PANGO_RENDER_TYPE_GP "PangoRenderGP"

A string constant identifying the GNOME Print renderer. The associated quark (see g_quark_from_string()) is used to identify the renderer in pango_find_map().


struct PangoGPFontMap

struct PangoGPFontMap;

pangogp-specific child type of PangoFontMap.


pango_gp_get_context ()

PangoContext* pango_gp_get_context          (GnomePrintContext *gpc);

Retrieves a PangoContext for the default PangoGP fontmap (see pango_gp_fontmap_get_for_display()) and sets the resolution for the default fontmap to dpi_x by dpi_y.

Use of this function is discouraged, see pango_gp_font_map_create_context() instead.

gpc : GnomePrintContext
Returns : the new PangoContext

pango_gp_font_map_for_display ()

PangoFontMap* pango_gp_font_map_for_display (void);

Returns a PangoGPFontMap. This font map is cached and should not be freed. If the font map is no longer needed, it can be released with pango_gp_shutdown_display().

Returns : a PangoGPFontMap.

pango_gp_shutdown_display ()

void        pango_gp_shutdown_display       (void);

Free the global fontmap. (See pango_gp_font_map_for_display())


pango_gp_render ()

void        pango_gp_render                 (PangoContext *context,
                                             PangoLayoutRun *run,
                                             PangoFont *font,
                                             PangoGlyphString *glyphs,
                                             gint x,
                                             gint y);

Renders a PangoGlyphString onto a GNOME Print context.

context : the PangoContext representing where to render.
run : the PangoLayoutRun to render.
font : the font in which to draw the string.
glyphs : the glyph string to draw.
x : the x position of the start of the string (in PangoGlyphUnit).
y : the y position of the baseline (in PangoGlyphUnit).

pango_gp_render_layout_line ()

void        pango_gp_render_layout_line     (PangoContext *context,
                                             PangoLayoutLine *line,
                                             gint x,
                                             gint y);

Render a PangoLayoutLine onto a FreeType2 bitmap

context : the PangoContext representing where to render.
line : a PangoLayoutLine
x : the x position of start of string (in PangoGlyphUnit)
y : the y position of baseline (in PangoGlyphUnit)

pango_gp_render_layout_lines ()

void        pango_gp_render_layout_lines    (PangoContext *context,
                                             PangoLayout *layout,
                                             gint line_first,
                                             gint line_last,
                                             gint x,
                                             gint y);

Render some lines from PangoLayout onto a GNOME Print PDF document.

context : the PangoContext representing where to render.
layout : a PangoLayout
line_first : the first line to render.
line_last : the last line to render.
x : the X position of the left of the layout (in PangoGlyphUnit)
y : the Y position of the top of the layout (in PangoGlyphUnit)

pango_gp_render_layout ()

void        pango_gp_render_layout          (PangoContext *context,
                                             PangoLayout *layout,
                                             gint x,
                                             gint y);

Render a PangoLayout onto a GNOME Print PDF document.

context : the PangoContext representing where to render.
layout : a PangoLayout
x : the X position of the left of the layout (in PangoGlyphUnit)
y : the Y position of the top of the layout (in PangoGlyphUnit)

pango_gp_font_map_new ()

PangoFontMap* pango_gp_font_map_new         (void);

Create a new PangoGPFontMap object; a fontmap is used to cache information about available fonts, and holds certain global parameters such as the resolution and the default substitute function (see pango_font_map_set_default_substitute()).

Returns : the newly created fontmap object. Unref with g_object_unref when you are finished with it.

pango_gp_font_map_set_resolution ()

void        pango_gp_font_map_set_resolution
                                            (PangoGPFontMap *fontmap,
                                             double dpi_x,
                                             double dpi_y);

Sets the horizontal and vertical resolutions for the fontmap.

fontmap : a PangoGPFontmap
dpi_x : dots per inch in the X direction
dpi_y : dots per inch in the Y direction

pango_gp_font_map_set_default_substitute ()

void        pango_gp_font_map_set_default_substitute
                                            (PangoGPFontMap *fontmap,
                                             PangoGPSubstituteFunc func,
                                             gpointer data,
                                             GDestroyNotify notify);

Sets a function that will be called to do final configuration substitution on a FcPattern before it is used to load the font. This function can be used to do things like set hinting and antialiasing options.

Since: 1.2

fontmap : a PangoGPFontMap
func : function to call to to do final config tweaking on FcPattern objects.
data : data to pass to func
notify : function to call when data is no longer used.

pango_gp_font_map_substitute_changed ()

void        pango_gp_font_map_substitute_changed
                                            (PangoGPFontMap *fontmap);

Call this function any time the results of the default substitution function set with pango_gp_font_map_set_default_substitute() change. That is, if your subsitution function will return different results for the same input pattern, you must call this function.

fontmap : a PangoGPFontmap

pango_gp_font_map_create_context ()

PangoContext* pango_gp_font_map_create_context
                                            (PangoGPFontMap *fontmap);

Create a PangoContext for the given fontmap.

fontmap : a PangoGPFontmap.
Returns : the newly created context; free with g_object_unref().

enum PangoGPFontEmbed

typedef enum {
  PANGO_GP_FONT_EMBED_INVALID,
  PANGO_GP_FONT_EMBED_ALL,
  PANGO_GP_FONT_EMBED_NONBASE,
  PANGO_GP_FONT_EMBED_NONE
} PangoGPFontEmbed;

The PangoGPFontEmbed will be used to specify what range of fonts to embed in the output.

PANGO_GP_FONT_EMBED_INVALIDNo valid embedding has been specified.
PANGO_GP_FONT_EMBED_ALLEmbed all fonts.
PANGO_GP_FONT_EMBED_NONBASEEmbed all fonts except the 'base' fonts that are expected to be pre-installed in all viewers/printers.
PANGO_GP_FONT_EMBED_NONEDo not embed any fonts.

enum PangoGPDebugFlags

typedef enum
{
  PANGO_GP_DEBUG_NONE	= 0,
  PANGO_GP_DEBUG_DEBUG	= 1,
  PANGO_GP_DEBUG_MASK	= 0x01
} PangoGPDebugFlags;

The PangoGPDebugFlags will be used to control the level of debugging output.


pango_gp_font_map_create_context_with_debug_flags ()

PangoContext* pango_gp_font_map_create_context_with_debug_flags
                                            (PangoGPFontMap *fontmap,
                                             PangoGPDebugFlags debug_flags);

Create a PangoContext for the given fontmap.

Debug flags are currently ignored.

fontmap : a PangoGPFontmap.
debug_flags : PangoGPDebugFlags.
Returns : the newly created context; free with g_object_unref().

pango_gp_layout_set_line_height ()

void        pango_gp_layout_set_line_height (PangoLayout *layout,
                                             gint line_height);

Sets the line-height of the layout.

layout : The PangoGPLayout.
line_height : The line-height for the layout.

pango_gp_layout_set_line_stacking_strategy ()

void        pango_gp_layout_set_line_stacking_strategy
                                            (PangoLayout *layout,
                                             PangoLineStackingStrategy line_stacking_strategy);

Sets the line-stacking-strategy of the layout.

layout : The PangoGPLayout.
line_stacking_strategy : The line-stacking-strategy for the layout.

pango_gp_layout_get_item_attrs ()

gint        pango_gp_layout_get_item_attrs  (PangoItem *item,
                                             PangoAttrType first_attribute_type,
                                             ...);

Gets specified attribute types, if present, from the extra attributes of item.

For each specified attribute type, if item has an attribute of that type, sets the PangoAttribute pointed to by the following argument to the attribute.

If item does not have an attribute of the specified type, sets the PangoAttribute pointed to by the following argument to NULL.

item : PangoItem which may have extra attributes.
first_attribute_type : PangoAttrType of a predefined or registered attribute type.
... : Remainder of list of PangoAttrType and **PangoAttribute pairs, terminated by PANGO_ATTR_INVALID.
Returns : The number of matches found.

pango_gp_get_unknown_glyph ()

PangoGlyph  pango_gp_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_gp_font_get_kerning ()

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

Retrieves kerning information for a combination of two glyphs.

font : a PangoFont
left : the left PangoGlyph
right : the right PangoGlyph
Returns : The amount of kerning (in Pango units) to apply for the given combination of glyphs.

pango_gp_font_get_face ()

FT_Face     pango_gp_font_get_face          (PangoFont *font);

Returns the native FreeType2 FT_Face structure used for this PangoFont. This may be useful if you want to use FreeType2 functions directly.

font : a PangoFont
Returns : a pointer to a FT_Face structure, with the size set correctly

pango_gp_font_get_coverage ()

PangoCoverage* pango_gp_font_get_coverage   (PangoFont *font,
                                             PangoLanguage *language);

Should not be called directly, use pango_font_get_coverage() instead.

font : a PangoGPFont.
language : a language tag.
Returns : a PangoCoverage.