Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

155 lignes
5.6 KiB

  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. #ifndef __PANGOCAIRO_H__
  22. #define __PANGOCAIRO_H__
  23. #include <pango/pango.h>
  24. #include <cairo.h>
  25. G_BEGIN_DECLS
  26. /**
  27. * PangoCairoFont:
  28. *
  29. * #PangoCairoFont is an interface exported by fonts for
  30. * use with Cairo. The actual type of the font will depend
  31. * on the particular font technology Cairo was compiled to use.
  32. *
  33. * Since: 1.18
  34. **/
  35. typedef struct _PangoCairoFont PangoCairoFont;
  36. #define PANGO_TYPE_CAIRO_FONT (pango_cairo_font_get_type ())
  37. #define PANGO_CAIRO_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_FONT, PangoCairoFont))
  38. #define PANGO_IS_CAIRO_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_FONT))
  39. /**
  40. * PangoCairoFontMap:
  41. *
  42. * #PangoCairoFontMap is an interface exported by font maps for
  43. * use with Cairo. The actual type of the font map will depend
  44. * on the particular font technology Cairo was compiled to use.
  45. *
  46. * Since: 1.10
  47. **/
  48. typedef struct _PangoCairoFontMap PangoCairoFontMap;
  49. #define PANGO_TYPE_CAIRO_FONT_MAP (pango_cairo_font_map_get_type ())
  50. #define PANGO_CAIRO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_FONT_MAP, PangoCairoFontMap))
  51. #define PANGO_IS_CAIRO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_FONT_MAP))
  52. typedef void (* PangoCairoShapeRendererFunc) (cairo_t *cr,
  53. PangoAttrShape *attr,
  54. gboolean do_path,
  55. gpointer data);
  56. /*
  57. * PangoCairoFontMap
  58. */
  59. GType pango_cairo_font_map_get_type (void) G_GNUC_CONST;
  60. PangoFontMap *pango_cairo_font_map_new (void);
  61. PangoFontMap *pango_cairo_font_map_new_for_font_type (cairo_font_type_t fonttype);
  62. PangoFontMap *pango_cairo_font_map_get_default (void);
  63. void pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap);
  64. cairo_font_type_t pango_cairo_font_map_get_font_type (PangoCairoFontMap *fontmap);
  65. void pango_cairo_font_map_set_resolution (PangoCairoFontMap *fontmap,
  66. double dpi);
  67. double pango_cairo_font_map_get_resolution (PangoCairoFontMap *fontmap);
  68. #ifndef PANGO_DISABLE_DEPRECATED
  69. PangoContext *pango_cairo_font_map_create_context (PangoCairoFontMap *fontmap);
  70. #endif
  71. /*
  72. * PangoCairoFont
  73. */
  74. GType pango_cairo_font_get_type (void) G_GNUC_CONST;
  75. cairo_scaled_font_t *pango_cairo_font_get_scaled_font (PangoCairoFont *font);
  76. /* Update a Pango context for the current state of a cairo context
  77. */
  78. void pango_cairo_update_context (cairo_t *cr,
  79. PangoContext *context);
  80. void pango_cairo_context_set_font_options (PangoContext *context,
  81. const cairo_font_options_t *options);
  82. const cairo_font_options_t *pango_cairo_context_get_font_options (PangoContext *context);
  83. void pango_cairo_context_set_resolution (PangoContext *context,
  84. double dpi);
  85. double pango_cairo_context_get_resolution (PangoContext *context);
  86. void pango_cairo_context_set_shape_renderer (PangoContext *context,
  87. PangoCairoShapeRendererFunc func,
  88. gpointer data,
  89. GDestroyNotify dnotify);
  90. PangoCairoShapeRendererFunc pango_cairo_context_get_shape_renderer (PangoContext *context,
  91. gpointer *data);
  92. /* Convenience
  93. */
  94. PangoContext *pango_cairo_create_context (cairo_t *cr);
  95. PangoLayout *pango_cairo_create_layout (cairo_t *cr);
  96. void pango_cairo_update_layout (cairo_t *cr,
  97. PangoLayout *layout);
  98. /*
  99. * Rendering
  100. */
  101. void pango_cairo_show_glyph_string (cairo_t *cr,
  102. PangoFont *font,
  103. PangoGlyphString *glyphs);
  104. void pango_cairo_show_glyph_item (cairo_t *cr,
  105. const char *text,
  106. PangoGlyphItem *glyph_item);
  107. void pango_cairo_show_layout_line (cairo_t *cr,
  108. PangoLayoutLine *line);
  109. void pango_cairo_show_layout (cairo_t *cr,
  110. PangoLayout *layout);
  111. void pango_cairo_show_error_underline (cairo_t *cr,
  112. double x,
  113. double y,
  114. double width,
  115. double height);
  116. /*
  117. * Rendering to a path
  118. */
  119. void pango_cairo_glyph_string_path (cairo_t *cr,
  120. PangoFont *font,
  121. PangoGlyphString *glyphs);
  122. void pango_cairo_layout_line_path (cairo_t *cr,
  123. PangoLayoutLine *line);
  124. void pango_cairo_layout_path (cairo_t *cr,
  125. PangoLayout *layout);
  126. void pango_cairo_error_underline_path (cairo_t *cr,
  127. double x,
  128. double y,
  129. double width,
  130. double height);
  131. G_END_DECLS
  132. #endif /* __PANGOCAIRO_H__ */