![]() | ![]() | ![]() | PangoPDF Reference Manual | ![]() |
---|
PDFlib Fonts and Rendering — Functions for shape engines to manipulate FreeType fonts for the PDFlib renderer
struct PangoPDFLIBLayout; #define PANGO_RENDER_TYPE_PDFLIB struct PangoPDFLIBFontMap; void (*PangoPDFLIBSubstituteFunc) (FcPattern *pattern,gpointer data); PangoContext* pango_pdflib_get_context (double dpi_x,double dpi_y); PangoFontMap* pango_pdflib_font_map_for_display (void); void pango_pdflib_shutdown_display (void); void pango_pdflib_render (gchar *layout_text, PangoLayoutRun *run, PangoFont *font, PangoGlyphString *glyphs,gint x,gint y); void pango_pdflib_render_layout_line (gchar *layout_text, PangoLayoutLine *line,gint x,gint y); void pango_pdflib_render_layout_lines (gint line_first,gint line_last,gint x,gint y); void pango_pdflib_render_layout (gint x,gint y); PangoFontMap* pango_pdflib_font_map_new (void); void pango_pdflib_font_map_set_resolution (PangoPDFLIBFontMap *fontmap,double dpi_x,double dpi_y); void pango_pdflib_font_map_set_default_substitute (PangoPDFLIBFontMap *fontmap, PangoPDFLIBSubstituteFunc func,gpointer data,GDestroyNotify notify); void pango_pdflib_font_map_substitute_changed (PangoPDFLIBFontMap *fontmap); PangoContext* pango_pdflib_font_map_create_context (PangoPDFLIBFontMap *fontmap); enum PangoPDFLIBDebugFlags; PangoContext* pango_pdflib_font_map_create_context_with_debug_flags (PangoPDFLIBFontMap *fontmap, PangoPDFLIBDebugFlags debug_flags); void pango_pdflib_layout_set_line_height (PangoLayout *layout,gint line_height); void pango_pdflib_layout_set_line_stacking_strategy (PangoLayout *layout, PangoLineStackingStrategy line_stacking_strategy);gint pango_pdflib_layout_get_item_attrs (PangoItem *item, PangoAttrType first_attribute_type, ...); PangoGlyph pango_pdflib_get_unknown_glyph (PangoFont *font); int pango_pdflib_font_get_kerning (PangoFont *font, PangoGlyph left, PangoGlyph right);FT_Face pango_pdflib_font_get_face (PangoFont *font); PangoCoverage* pango_pdflib_font_get_coverage (PangoFont *font, PangoLanguage *language);
struct PangoPDFLIBLayout;
The PangoPDFLIBLayout is a PDFlib-specific subclass of PangoLayout.
#define PANGO_RENDER_TYPE_PDFLIB "PangoRenderPDFLIB"
A string constant identifying the PDFlib renderer. The associated quark (see
struct PangoPDFLIBFontMap;
The PangoPDFLIBFontMap is the PangoFontMap implementation for FreeType fonts and the PDFlib renderer.
void (*PangoPDFLIBSubstituteFunc) (FcPattern *pattern,gpointer data);
Function type for doing final config tweaking on prepared FcPatterns.
pattern : | the FcPattern to tweak. |
data : | user data. |
PangoContext* pango_pdflib_get_context (double dpi_x,double dpi_y);
Retrieves a PangoContext for the default PangoPDFLIB fontmap
(see
Use of this function is discouraged, see pango_pdflib_font_map_create_context() instead.
dpi_x : | the horizontal dpi of the target device |
dpi_y : | the vertical dpi of the target device |
Returns : | the new PangoContext |
PangoFontMap* pango_pdflib_font_map_for_display (void);
Returns a PangoPDFLIBFontMap. This font map is cached and should not be freed. If the font map is no longer needed, it can be released with pango_pdflib_shutdown_display().
Returns : | a PangoPDFLIBFontMap. |
void pango_pdflib_shutdown_display (void);
Free the global fontmap. (See pango_pdflib_font_map_for_display())
void pango_pdflib_render (gchar *layout_text, PangoLayoutRun *run, PangoFont *font, PangoGlyphString *glyphs,gint x,gint y);
Renders a PangoGlyphString onto a PDFlib PDF document.
pdf_doc : | the PDFlib document onto which to draw layout_text. |
layout_text : | the text of the layout. |
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). |
void pango_pdflib_render_layout_line (gchar *layout_text, PangoLayoutLine *line,gint x,gint y);
Render a PangoLayoutLine onto a FreeType2 bitmap
pdf_doc : | the PDFlib document onto which to draw layout_text. |
layout_text : | the text of the layout. |
line : | a PangoLayoutLine |
x : | the x position of start of string (in PangoGlyphUnit) |
y : | the y position of baseline (in PangoGlyphUnit) |
void pango_pdflib_render_layout_lines (gint line_first,gint line_last,gint x,gint y);
Render some lines from PangoLayout onto a PDFlib PDF document.
pdf_doc : | the PDFlib document onto which to draw layout_text. |
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) |
void pango_pdflib_render_layout (gint x,gint y);
Render a PangoLayout onto a PDFlib PDF document.
pdf_doc : | the PDFlib document onto which to render layout. |
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). |
PangoFontMap* pango_pdflib_font_map_new (void);
Create a new PangoPDFLIBFontMap 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
Returns : | the newly created fontmap object. Unref with g_object_unref when you are finished with it. |
void pango_pdflib_font_map_set_resolution (PangoPDFLIBFontMap *fontmap,double dpi_x,double dpi_y);
Sets the horizontal and vertical resolutions for the fontmap.
fontmap : | a |
dpi_x : | dots per inch in the X direction |
dpi_y : | dots per inch in the Y direction |
void pango_pdflib_font_map_set_default_substitute (PangoPDFLIBFontMap *fontmap, PangoPDFLIBSubstituteFunc func,gpointer data,GDestroyNotify notify);
Sets a function that will be called to do final configuration
substitution on a
Since: 1.2
fontmap : | a PangoPDFLIBFontMap |
func : | function to call to to do final config tweaking
on |
data : | data to pass to func |
notify : | function to call when data is no longer used. |
void pango_pdflib_font_map_substitute_changed (PangoPDFLIBFontMap *fontmap);
Call this function any time the results of the default substitution function set with pango_pdflib_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 |
PangoContext* pango_pdflib_font_map_create_context (PangoPDFLIBFontMap *fontmap);
Create a PangoContext for the given fontmap.
fontmap : | a |
Returns : | the newly created context; free with |
typedef enum { PANGO_PDFLIB_DEBUG_NONE = 0, PANGO_PDFLIB_DEBUG_DEBUG = 1, PANGO_PDFLIB_DEBUG_MASK = 0x01 } PangoPDFLIBDebugFlags;
The PangoPDFLIBDebugFlags determine the debugging mode of the PangoContext
PANGO_PDFLIB_DEBUG_NONE | No debugging is enabled |
PANGO_PDFLIB_DEBUG_DEBUG | Debugging is enabled |
PANGO_PDFLIB_DEBUG_MASK |
PangoContext* pango_pdflib_font_map_create_context_with_debug_flags (PangoPDFLIBFontMap *fontmap, PangoPDFLIBDebugFlags debug_flags);
Create a PangoContext for the given fontmap.
Debug flags are currently ignored.
fontmap : | a |
debug_flags : | PangoPDFLIBDebugFlags. |
Returns : | the newly created context; free with |
void pango_pdflib_layout_set_line_height (PangoLayout *layout,gint line_height);
Sets the line-height of the layout.
layout : | The PangoPDFLIBLayout. |
line_height : | The line-height for the layout. |
void pango_pdflib_layout_set_line_stacking_strategy (PangoLayout *layout, PangoLineStackingStrategy line_stacking_strategy);
Sets the line-stacking-strategy of the layout.
layout : | The PangoPDFLIBLayout. |
line_stacking_strategy : | The line-stacking-strategy for the layout. |
gint pango_pdflib_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
|
Returns : | The number of matches found. |
PangoGlyph pango_pdflib_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 |
int pango_pdflib_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. |
FT_Face pango_pdflib_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 |
PangoCoverage* pango_pdflib_font_get_coverage (PangoFont *font, PangoLanguage *language);
Should not be called directly, use pango_font_get_coverage() instead.
font : | a |
language : | a language tag. |
Returns : | a PangoCoverage. |
<< GNOME Print Fonts and Rendering | Xft Fonts and Rendering >> |