Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
pangocairo.h
Go to the documentation of this file.
1/* Pango
2 * pangocairo.h:
3 *
4 * Copyright (C) 1999, 2004 Red Hat, Inc.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
22#ifndef __PANGOCAIRO_H__
23#define __PANGOCAIRO_H__
24
25#include <pango/pango.h>
26#include <cairo.h>
27
29
30/**
31 * PangoCairoFont:
32 *
33 * `PangoCairoFont` is an interface exported by fonts for
34 * use with Cairo.
35 *
36 * The actual type of the font will depend on the particular
37 * font technology Cairo was compiled to use.
38 *
39 * Since: 1.18
40 **/
41typedef struct _PangoCairoFont PangoCairoFont;
42
43/* This is a hack because PangoCairo is hijacking the Pango namespace, but
44 * consumers of the PangoCairo API expect these symbols to live under the
45 * PangoCairo namespace.
46 */
47#ifdef __GI_SCANNER__
48#define PANGO_CAIRO_TYPE_FONT (pango_cairo_font_get_type())
49#define PANGO_CAIRO_FONT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PANGO_CAIRO_TYPE_FONT, PangoCairoFont))
50#define PANGO_CAIRO_IS_FONT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PANGO_CAIRO_TYPE_FONT))
51#else
52#define PANGO_TYPE_CAIRO_FONT (pango_cairo_font_get_type ())
53#define PANGO_CAIRO_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_FONT, PangoCairoFont))
54#define PANGO_IS_CAIRO_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_FONT))
55#endif
56
57/**
58 * PangoCairoFontMap:
59 *
60 * `PangoCairoFontMap` is an interface exported by font maps for
61 * use with Cairo.
62 *
63 * The actual type of the font map will depend on the particular
64 * font technology Cairo was compiled to use.
65 *
66 * Since: 1.10
67 **/
68typedef struct _PangoCairoFontMap PangoCairoFontMap;
69
70#ifdef __GI_SCANNER__
71#define PANGO_CAIRO_TYPE_FONT_MAP (pango_cairo_font_map_get_type())
72#define PANGO_CAIRO_FONT_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PANGO_CAIRO_TYPE_FONT_MAP, PangoCairoFontMap))
73#define PANGO_CAIRO_IS_FONT_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PANGO_CAIRO_TYPE_FONT_MAP))
74#else
75#define PANGO_TYPE_CAIRO_FONT_MAP (pango_cairo_font_map_get_type ())
76#define PANGO_CAIRO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_FONT_MAP, PangoCairoFontMap))
77#define PANGO_IS_CAIRO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_FONT_MAP))
78#endif
79
80/**
81 * PangoCairoShapeRendererFunc:
82 * @cr: a Cairo context with current point set to where the shape should
83 * be rendered
84 * @attr: the %PANGO_ATTR_SHAPE to render
85 * @do_path: whether only the shape path should be appended to current
86 * path of @cr and no filling/stroking done. This will be set
87 * to %TRUE when called from pango_cairo_layout_path() and
88 * pango_cairo_layout_line_path() rendering functions.
89 * @data: (closure): user data passed to pango_cairo_context_set_shape_renderer()
90 *
91 * Function type for rendering attributes of type %PANGO_ATTR_SHAPE
92 * with Pango's Cairo renderer.
93 */
95 PangoAttrShape *attr,
96 gboolean do_path,
97 gpointer data);
98
99/*
100 * PangoCairoFontMap
101 */
104
115
118 double dpi);
121#ifndef PANGO_DISABLE_DEPRECATED
124#endif
125
126/*
127 * PangoCairoFont
128 */
131
134
135/* Update a Pango context for the current state of a cairo context
136 */
139 PangoContext *context);
140
143 const cairo_font_options_t *options);
146
149 double dpi);
152
156 gpointer data,
157 GDestroyNotify dnotify);
160 gpointer *data);
161
162/* Convenience
163 */
170 PangoLayout *layout);
171
172/*
173 * Rendering
174 */
177 PangoFont *font,
178 PangoGlyphString *glyphs);
181 const char *text,
182 PangoGlyphItem *glyph_item);
185 PangoLayoutLine *line);
188 PangoLayout *layout);
189
192 double x,
193 double y,
194 double width,
195 double height);
196
197/*
198 * Rendering to a path
199 */
202 PangoFont *font,
203 PangoGlyphString *glyphs);
206 PangoLayoutLine *line);
209 PangoLayout *layout);
210
213 double x,
214 double y,
215 double width,
216 double height);
217
219
220#endif /* __PANGOCAIRO_H__ */
struct _cairo cairo_t
Definition cairo.h:135
enum _cairo_font_type cairo_font_type_t
struct _cairo_scaled_font cairo_scaled_font_t
Definition cairo.h:1113
struct _cairo_font_options cairo_font_options_t
Definition cairo.h:1462
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
void * gpointer
Definition gtypes.h:109
void(* GDestroyNotify)(gpointer data)
Definition gtypes.h:140
PANGO_AVAILABLE_IN_1_22 PangoContext * pango_font_map_create_context(PangoFontMap *fontmap)
typedefG_BEGIN_DECLS struct _PangoGlyphItem PangoGlyphItem
typedefG_BEGIN_DECLS struct _PangoLayout PangoLayout
struct _PangoContext PangoContext
Definition pango-types.h:44
#define PANGO_AVAILABLE_IN_1_10
#define PANGO_AVAILABLE_IN_1_22
#define PANGO_AVAILABLE_IN_1_14
#define PANGO_AVAILABLE_IN_1_18
#define PANGO_DEPRECATED_IN_1_22_FOR(f)
#define PANGO_AVAILABLE_IN_ALL
PANGO_AVAILABLE_IN_1_18 cairo_scaled_font_t * pango_cairo_font_get_scaled_font(PangoCairoFont *font)
PANGO_AVAILABLE_IN_1_10 void pango_cairo_update_context(cairo_t *cr, PangoContext *context)
PangoContext * pango_cairo_font_map_create_context(PangoCairoFontMap *fontmap)
PANGO_AVAILABLE_IN_1_22 void pango_cairo_font_map_set_default(PangoCairoFontMap *fontmap)
void(* PangoCairoShapeRendererFunc)(cairo_t *cr, PangoAttrShape *attr, gboolean do_path, gpointer data)
Definition pangocairo.h:94
PANGO_AVAILABLE_IN_1_10 void pango_cairo_show_layout_line(cairo_t *cr, PangoLayoutLine *line)
PANGO_AVAILABLE_IN_1_10 void pango_cairo_show_glyph_string(cairo_t *cr, PangoFont *font, PangoGlyphString *glyphs)
PANGO_AVAILABLE_IN_1_10 PangoFontMap * pango_cairo_font_map_get_default(void)
PANGO_AVAILABLE_IN_1_10 double pango_cairo_font_map_get_resolution(PangoCairoFontMap *fontmap)
PANGO_AVAILABLE_IN_1_22 PangoContext * pango_cairo_create_context(cairo_t *cr)
PANGO_AVAILABLE_IN_1_18 PangoCairoShapeRendererFunc pango_cairo_context_get_shape_renderer(PangoContext *context, gpointer *data)
PANGO_AVAILABLE_IN_1_18 cairo_font_type_t pango_cairo_font_map_get_font_type(PangoCairoFontMap *fontmap)
PANGO_AVAILABLE_IN_1_14 void pango_cairo_error_underline_path(cairo_t *cr, double x, double y, double width, double height)
PANGO_AVAILABLE_IN_1_10 void pango_cairo_show_layout(cairo_t *cr, PangoLayout *layout)
PANGO_AVAILABLE_IN_1_10 void pango_cairo_glyph_string_path(cairo_t *cr, PangoFont *font, PangoGlyphString *glyphs)
PANGO_AVAILABLE_IN_1_10 void pango_cairo_context_set_font_options(PangoContext *context, const cairo_font_options_t *options)
PANGO_AVAILABLE_IN_ALL PangoLayout * pango_cairo_create_layout(cairo_t *cr)
PANGO_AVAILABLE_IN_1_10 double pango_cairo_context_get_resolution(PangoContext *context)
PANGO_AVAILABLE_IN_1_10 void pango_cairo_layout_line_path(cairo_t *cr, PangoLayoutLine *line)
PANGO_AVAILABLE_IN_1_10 void pango_cairo_font_map_set_resolution(PangoCairoFontMap *fontmap, double dpi)
PANGO_AVAILABLE_IN_1_18 PangoFontMap * pango_cairo_font_map_new_for_font_type(cairo_font_type_t fonttype)
PANGO_AVAILABLE_IN_1_10 void pango_cairo_update_layout(cairo_t *cr, PangoLayout *layout)
PANGO_AVAILABLE_IN_1_14 void pango_cairo_show_error_underline(cairo_t *cr, double x, double y, double width, double height)
typedefG_BEGIN_DECLS struct _PangoCairoFont PangoCairoFont
Definition pangocairo.h:41
PANGO_AVAILABLE_IN_1_10 GType pango_cairo_font_map_get_type(void) G_GNUC_CONST
PANGO_AVAILABLE_IN_1_10 void pango_cairo_layout_path(cairo_t *cr, PangoLayout *layout)
PANGO_AVAILABLE_IN_1_10 void pango_cairo_context_set_resolution(PangoContext *context, double dpi)
PANGO_AVAILABLE_IN_1_10 const cairo_font_options_t * pango_cairo_context_get_font_options(PangoContext *context)
struct _PangoCairoFontMap PangoCairoFontMap
Definition pangocairo.h:68
PANGO_AVAILABLE_IN_1_18 GType pango_cairo_font_get_type(void) G_GNUC_CONST
PANGO_AVAILABLE_IN_1_22 void pango_cairo_show_glyph_item(cairo_t *cr, const char *text, PangoGlyphItem *glyph_item)
PANGO_AVAILABLE_IN_1_10 PangoFontMap * pango_cairo_font_map_new(void)
PANGO_AVAILABLE_IN_1_18 void pango_cairo_context_set_shape_renderer(PangoContext *context, PangoCairoShapeRendererFunc func, gpointer data, GDestroyNotify dnotify)