cairo 1.7.0-x86-mswin32 → 1.8.0-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of cairo might be problematic. Click here for more details.

Files changed (167) hide show
  1. data/ChangeLog +32 -0
  2. data/NEWS +9 -1
  3. data/README +1 -0
  4. data/Rakefile +2 -2
  5. data/cairo/DLL_FAQ.txt +397 -0
  6. data/cairo/README.txt +53 -0
  7. data/cairo/USAGE.txt +94 -0
  8. data/cairo/bin/libcairo-2.dll +0 -0
  9. data/cairo/bin/libpng12-0.dll +0 -0
  10. data/cairo/bin/zlib1.dll +0 -0
  11. data/cairo/include/cairo/cairo-deprecated.h +0 -4
  12. data/cairo/include/cairo/cairo-features.h +7 -22
  13. data/cairo/include/cairo/cairo-pdf.h +1 -1
  14. data/cairo/include/cairo/cairo-ps.h +1 -1
  15. data/cairo/include/cairo/cairo-svg.h +1 -1
  16. data/cairo/include/cairo/cairo-version.h +8 -0
  17. data/cairo/include/cairo/cairo-win32.h +9 -1
  18. data/cairo/include/cairo/cairo.h +420 -32
  19. data/cairo/include/libpng12/png.h +3592 -0
  20. data/cairo/include/libpng12/pngconf.h +1481 -0
  21. data/cairo/include/png.h +36 -13
  22. data/cairo/include/pngconf.h +3 -3
  23. data/cairo/include/zconf.h +332 -0
  24. data/cairo/include/zlib.h +1357 -0
  25. data/cairo/lib/cairo.def +22 -0
  26. data/cairo/lib/cairo.lib +0 -0
  27. data/cairo/lib/libcairo.dll.a +0 -0
  28. data/cairo/lib/libpng.def +1 -0
  29. data/cairo/lib/libpng.lib +0 -0
  30. data/cairo/lib/libpng12.dll.a +0 -0
  31. data/cairo/lib/pkgconfig/cairo-pdf.pc +5 -5
  32. data/cairo/lib/pkgconfig/cairo-png.pc +5 -5
  33. data/cairo/lib/pkgconfig/cairo-ps.pc +5 -5
  34. data/cairo/lib/pkgconfig/cairo-svg.pc +4 -4
  35. data/cairo/lib/pkgconfig/cairo-win32-font.pc +4 -4
  36. data/cairo/lib/pkgconfig/cairo-win32.pc +4 -4
  37. data/cairo/lib/pkgconfig/cairo.pc +4 -4
  38. data/cairo/lib/pkgconfig/libpng.pc +3 -2
  39. data/cairo/lib/pkgconfig/libpng12.pc +3 -2
  40. data/cairo/lib/zdll.exp +0 -0
  41. data/cairo/lib/zdll.lib +0 -0
  42. data/cairo/lib/zlib.def +60 -0
  43. data/cairo/manifest/cairo-dev_1.8.0-1_win32.mft +76 -0
  44. data/cairo/manifest/cairo_1.8.0-1_win32.mft +5 -0
  45. data/cairo/manifest/{libpng-dev-1.2.29.mft → libpng-dev_1.2.32-1_win32.mft} +5 -2
  46. data/cairo/manifest/libpng_1.2.32-1_win32.mft +2 -0
  47. data/cairo/share/doc/{cairo-1.6.4-2 → cairo_1.8.0-1_win32}/COPYING +0 -0
  48. data/cairo/share/doc/{cairo-1.6.4-2 → cairo_1.8.0-1_win32}/COPYING-LGPL-2.1 +0 -0
  49. data/cairo/share/doc/{cairo-1.6.4-2 → cairo_1.8.0-1_win32}/COPYING-MPL-1.1 +0 -0
  50. data/cairo/share/gtk-doc/html/cairo/bindings-errors.html +15 -11
  51. data/cairo/share/gtk-doc/html/cairo/bindings-fonts.html +15 -11
  52. data/cairo/share/gtk-doc/html/cairo/bindings-memory.html +20 -16
  53. data/cairo/share/gtk-doc/html/cairo/bindings-overloading.html +16 -12
  54. data/cairo/share/gtk-doc/html/cairo/bindings-path.html +17 -13
  55. data/cairo/share/gtk-doc/html/cairo/bindings-patterns.html +25 -21
  56. data/cairo/share/gtk-doc/html/cairo/bindings-return-values.html +17 -13
  57. data/cairo/share/gtk-doc/html/cairo/bindings-streams.html +14 -10
  58. data/cairo/share/gtk-doc/html/cairo/bindings-surfaces.html +19 -15
  59. data/cairo/share/gtk-doc/html/cairo/cairo-context.html +2721 -0
  60. data/cairo/share/gtk-doc/html/cairo/cairo-drawing.html +57 -0
  61. data/cairo/share/gtk-doc/html/cairo/cairo-error-status.html +361 -0
  62. data/cairo/share/gtk-doc/html/cairo/cairo-font-face.html +418 -0
  63. data/cairo/share/gtk-doc/html/cairo/cairo-font-options.html +695 -0
  64. data/cairo/share/gtk-doc/html/cairo/cairo-fonts.html +63 -0
  65. data/cairo/share/gtk-doc/html/cairo/cairo-ft-font.html +318 -0
  66. data/cairo/share/gtk-doc/html/cairo/cairo-image-surface.html +486 -0
  67. data/cairo/share/gtk-doc/html/cairo/{cairo-cairo-matrix-t.html → cairo-matrix.html} +137 -156
  68. data/cairo/share/gtk-doc/html/cairo/{cairo-Paths.html → cairo-paths.html} +275 -306
  69. data/cairo/share/gtk-doc/html/cairo/cairo-pattern.html +1524 -0
  70. data/cairo/share/gtk-doc/html/cairo/{cairo-PDF-Surfaces.html → cairo-pdf-surface.html} +60 -70
  71. data/cairo/share/gtk-doc/html/cairo/cairo-png-functions.html +332 -0
  72. data/cairo/share/gtk-doc/html/cairo/{cairo-PostScript-Surfaces.html → cairo-ps-surface.html} +131 -150
  73. data/cairo/share/gtk-doc/html/cairo/cairo-quartz-font.html +153 -0
  74. data/cairo/share/gtk-doc/html/cairo/{cairo-Quartz-Surfaces.html → cairo-quartz-surface.html} +53 -62
  75. data/cairo/share/gtk-doc/html/cairo/cairo-scaled-font.html +1051 -0
  76. data/cairo/share/gtk-doc/html/cairo/cairo-support.html +54 -0
  77. data/cairo/share/gtk-doc/html/cairo/cairo-surface.html +1064 -0
  78. data/cairo/share/gtk-doc/html/cairo/cairo-surfaces.html +69 -0
  79. data/cairo/share/gtk-doc/html/cairo/cairo-svg-surface.html +324 -0
  80. data/cairo/share/gtk-doc/html/cairo/cairo-text.html +1264 -0
  81. data/cairo/share/gtk-doc/html/cairo/{cairo-Transformations.html → cairo-transformations.html} +98 -115
  82. data/cairo/share/gtk-doc/html/cairo/cairo-types.html +134 -0
  83. data/cairo/share/gtk-doc/html/cairo/cairo-user-font.html +769 -0
  84. data/cairo/share/gtk-doc/html/cairo/cairo-version-info.html +355 -0
  85. data/cairo/share/gtk-doc/html/cairo/cairo-win32-font.html +366 -0
  86. data/cairo/share/gtk-doc/html/cairo/cairo-win32-surface.html +321 -0
  87. data/cairo/share/gtk-doc/html/cairo/{cairo-XLib-Surfaces.html → cairo-xlib-surface.html} +104 -121
  88. data/cairo/share/gtk-doc/html/cairo/cairo.devhelp +390 -405
  89. data/cairo/share/gtk-doc/html/cairo/cairo.devhelp2 +390 -405
  90. data/cairo/share/gtk-doc/html/cairo/index-1.2.html +63 -59
  91. data/cairo/share/gtk-doc/html/cairo/index-1.4.html +45 -41
  92. data/cairo/share/gtk-doc/html/cairo/index-1.6.html +29 -23
  93. data/cairo/share/gtk-doc/html/cairo/index-1.8.html +107 -0
  94. data/cairo/share/gtk-doc/html/cairo/index-all.html +759 -0
  95. data/cairo/share/gtk-doc/html/cairo/index.html +51 -41
  96. data/cairo/share/gtk-doc/html/cairo/index.sgml +478 -466
  97. data/cairo/share/gtk-doc/html/cairo/language-bindings.html +22 -18
  98. data/cairo/share/gtk-doc/html/cairo/style.css +14 -2
  99. data/cairo/share/man/man3/libpng.3 +443 -17
  100. data/cairo/share/man/man3/libpngpf.3 +618 -102
  101. data/cairo/share/man/man5/png.5 +1 -1
  102. data/cairo/src/tml/make/cairo_1.8.0-1_win32.log +1021 -0
  103. data/cairo/src/tml/make/cairo_1.8.0-1_win32.sh +68 -0
  104. data/cairo/src/tml/make/libpng_1.2.32-1_win32.log +269 -0
  105. data/cairo/src/tml/make/libpng_1.2.32-1_win32.sh +63 -0
  106. data/cairo/test/example_d.exe +0 -0
  107. data/cairo/test/minigzip_d.exe +0 -0
  108. data/cairo/test/testzlib_d.exe +0 -0
  109. data/cairo/test/untgz_d.exe +0 -0
  110. data/doc/en/cairo-context.html +81 -91
  111. data/doc/en/cairo-font-options.html +11 -26
  112. data/doc/en/cairo-text-cluster-flag.html +35 -0
  113. data/doc/en/cairo-user-font-face-text-to-glyphs-data.html +3 -3
  114. data/doc/en/cairo.html +38 -42
  115. data/doc/en/index.html +129 -142
  116. data/doc/ja/cairo-font-options.html +3 -25
  117. data/doc/ja/cairo-text-cluster-flag.html +46 -0
  118. data/doc/ja/cairo-user-font-face-text-to-glyphs-data.html +16 -15
  119. data/doc/ja/cairo.html +3 -7
  120. data/doc/ja/index.html +9 -17
  121. data/src/cairo.def +1 -1
  122. data/src/cairo.so +0 -0
  123. data/src/lib/cairo/constants.rb +3 -1
  124. data/src/libruby-cairo.a +0 -0
  125. data/src/rb_cairo.c +2 -2
  126. data/src/rb_cairo.h +5 -5
  127. data/src/rb_cairo_constants.c +12 -19
  128. data/src/rb_cairo_context.c +25 -21
  129. data/src/rb_cairo_font_face.c +44 -29
  130. data/src/rb_cairo_font_options.c +1 -23
  131. data/src/rb_cairo_scaled_font.c +5 -5
  132. data/test/test_constants.rb +6 -9
  133. data/test/test_context.rb +0 -12
  134. data/test/test_font_face.rb +7 -7
  135. data/test/test_font_options.rb +2 -21
  136. data/test/test_scaled_font.rb +3 -3
  137. data/test/test_text_to_glyphs_data.rb +19 -15
  138. metadata +68 -45
  139. data/cairo/make/cairo-1.6.4-2.sh +0 -55
  140. data/cairo/make/libpng-1.2.29.sh +0 -35
  141. data/cairo/manifest/cairo-1.6.4-2.mft +0 -6
  142. data/cairo/manifest/cairo-dev-1.6.4-2.mft +0 -72
  143. data/cairo/manifest/libpng-1.2.29.mft +0 -2
  144. data/cairo/share/gtk-doc/html/cairo/Drawing.html +0 -53
  145. data/cairo/share/gtk-doc/html/cairo/Fonts.html +0 -56
  146. data/cairo/share/gtk-doc/html/cairo/Support.html +0 -50
  147. data/cairo/share/gtk-doc/html/cairo/Surfaces.html +0 -65
  148. data/cairo/share/gtk-doc/html/cairo/cairo-Error-Handling.html +0 -328
  149. data/cairo/share/gtk-doc/html/cairo/cairo-Font-Options.html +0 -720
  150. data/cairo/share/gtk-doc/html/cairo/cairo-FreeType-Fonts.html +0 -297
  151. data/cairo/share/gtk-doc/html/cairo/cairo-Image-Surfaces.html +0 -484
  152. data/cairo/share/gtk-doc/html/cairo/cairo-PNG-Support.html +0 -345
  153. data/cairo/share/gtk-doc/html/cairo/cairo-Patterns.html +0 -1560
  154. data/cairo/share/gtk-doc/html/cairo/cairo-Quartz-Fonts.html +0 -161
  155. data/cairo/share/gtk-doc/html/cairo/cairo-SVG-Surfaces.html +0 -337
  156. data/cairo/share/gtk-doc/html/cairo/cairo-Scaled-Fonts.html +0 -823
  157. data/cairo/share/gtk-doc/html/cairo/cairo-Text.html +0 -836
  158. data/cairo/share/gtk-doc/html/cairo/cairo-Types.html +0 -143
  159. data/cairo/share/gtk-doc/html/cairo/cairo-Version-Information.html +0 -325
  160. data/cairo/share/gtk-doc/html/cairo/cairo-Win32-Fonts.html +0 -381
  161. data/cairo/share/gtk-doc/html/cairo/cairo-Win32-Surfaces.html +0 -331
  162. data/cairo/share/gtk-doc/html/cairo/cairo-cairo-font-face-t.html +0 -427
  163. data/cairo/share/gtk-doc/html/cairo/cairo-cairo-surface-t.html +0 -995
  164. data/cairo/share/gtk-doc/html/cairo/cairo-cairo-t.html +0 -2795
  165. data/cairo/share/gtk-doc/html/cairo/ix01.html +0 -693
  166. data/doc/en/cairo-lcd-filter.html +0 -39
  167. data/doc/ja/cairo-lcd-filter.html +0 -63
@@ -1,297 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
- <title>FreeType Fonts</title>
6
- <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
- <link rel="start" href="index.html" title="Cairo: A Vector Graphics Library">
8
- <link rel="up" href="Fonts.html" title="Fonts">
9
- <link rel="prev" href="cairo-Font-Options.html" title="cairo_font_options_t">
10
- <link rel="next" href="cairo-Win32-Fonts.html" title="Win32 Fonts">
11
- <meta name="generator" content="GTK-Doc V1.9 (XML mode)">
12
- <link rel="stylesheet" href="style.css" type="text/css">
13
- <link rel="chapter" href="Drawing.html" title="Drawing">
14
- <link rel="chapter" href="Fonts.html" title="Fonts">
15
- <link rel="chapter" href="Surfaces.html" title="Surfaces">
16
- <link rel="chapter" href="Support.html" title="Utilities">
17
- <link rel="index" href="ix01.html" title="Index">
18
- <link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
19
- <link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
20
- <link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
21
- <link rel="appendix" href="language-bindings.html" title="Appendix&#160;A.&#160;Creating a language binding for cairo">
22
- </head>
23
- <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
24
- <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
25
- <tr valign="middle">
26
- <td><a accesskey="p" href="cairo-Font-Options.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
27
- <td><a accesskey="u" href="Fonts.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
28
- <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
29
- <th width="100%" align="center">Cairo: A Vector Graphics Library</th>
30
- <td><a accesskey="n" href="cairo-Win32-Fonts.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
31
- </tr>
32
- <tr><td colspan="5" class="shortcuts"><nobr><a href="#id2629661" class="shortcut">Top</a>
33
- &#160;|&#160;
34
- <a href="#id2584432" class="shortcut">Description</a></nobr></td></tr>
35
- </table>
36
- <div class="refentry" lang="en">
37
- <a name="cairo-FreeType-Fonts"></a><div class="titlepage"></div>
38
- <div class="refnamediv"><table width="100%"><tr>
39
- <td valign="top">
40
- <h2>
41
- <a name="id2629661"></a><span class="refentrytitle">FreeType Fonts</span>
42
- </h2>
43
- <p>FreeType Fonts &#8212; Font support for FreeType</p>
44
- </td>
45
- <td valign="top" align="right"></td>
46
- </tr></table></div>
47
- <div class="refsynopsisdiv">
48
- <h2>Synopsis</h2>
49
- <pre class="synopsis">
50
-
51
-
52
-
53
- #define <a class="link" href="cairo-FreeType-Fonts.html#CAIRO-HAS-FT-FONT:CAPS">CAIRO_HAS_FT_FONT</a>
54
- <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a>* <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-font-face-create-for-ft-face">cairo_ft_font_face_create_for_ft_face</a>
55
- (FT_Face face,
56
- int load_flags);
57
- <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a>* <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-font-face-create-for-pattern">cairo_ft_font_face_create_for_pattern</a>
58
- (FcPattern *pattern);
59
- void <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-font-options-substitute">cairo_ft_font_options_substitute</a> (const <a class="link" href="cairo-Font-Options.html#cairo-font-options-t">cairo_font_options_t</a> *options,
60
- FcPattern *pattern);
61
- FT_Face <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-scaled-font-lock-face">cairo_ft_scaled_font_lock_face</a> (<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);
62
- void <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-scaled-font-unlock-face">cairo_ft_scaled_font_unlock_face</a> (<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);
63
- </pre>
64
- </div>
65
- <div class="refsect1" lang="en">
66
- <a name="id2584432"></a><h2>Description</h2>
67
- <p>
68
- The FreeType font backend is primarily used to render text on GNU/Linux
69
- systems, but can be used on other platforms too.
70
- </p>
71
- </div>
72
- <div class="refsect1" lang="en">
73
- <a name="id2584449"></a><h2>Details</h2>
74
- <div class="refsect2" lang="en">
75
- <a name="id2584460"></a><h3>
76
- <a name="CAIRO-HAS-FT-FONT:CAPS"></a>CAIRO_HAS_FT_FONT</h3>
77
- <a class="indexterm" name="id2584472"></a><pre class="programlisting">#define CAIRO_HAS_FT_FONT 1
78
- </pre>
79
- <p>
80
-
81
- </p>
82
- </div>
83
- <hr>
84
- <div class="refsect2" lang="en">
85
- <a name="id2584487"></a><h3>
86
- <a name="cairo-ft-font-face-create-for-ft-face"></a>cairo_ft_font_face_create_for_ft_face ()</h3>
87
- <a class="indexterm" name="id2584498"></a><pre class="programlisting"><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a>* cairo_ft_font_face_create_for_ft_face
88
- (FT_Face face,
89
- int load_flags);</pre>
90
- <p>
91
- Creates a new font face for the FreeType font backend from a
92
- pre-opened FreeType face. This font can then be used with
93
- <a class="link" href="cairo-Text.html#cairo-set-font-face"><code class="function">cairo_set_font_face()</code></a> or <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create"><code class="function">cairo_scaled_font_create()</code></a>. The
94
- <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a> returned from <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create"><code class="function">cairo_scaled_font_create()</code></a> is
95
- also for the FreeType backend and can be used with functions such
96
- as <code class="function">cairo_ft_font_lock_face()</code>.</p>
97
- <p>
98
-
99
- </p>
100
- <div class="variablelist"><table border="0">
101
- <col align="left" valign="top">
102
- <tbody>
103
- <tr>
104
- <td><p><span class="term"><em class="parameter"><code>face</code></em>&#160;:</span></p></td>
105
- <td> A FreeType face object, already opened. This must
106
- be kept around until the face's ref_count drops to
107
- zero and it is freed. Since the face may be referenced
108
- internally to Cairo, the best way to determine when it
109
- is safe to free the face is to pass a
110
- <a class="link" href="cairo-Types.html#cairo-destroy-func-t"><span class="type">cairo_destroy_func_t</span></a> to <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-set-user-data"><code class="function">cairo_font_face_set_user_data()</code></a>
111
- </td>
112
- </tr>
113
- <tr>
114
- <td><p><span class="term"><em class="parameter"><code>load_flags</code></em>&#160;:</span></p></td>
115
- <td> flags to pass to FT_Load_Glyph when loading
116
- glyphs from the font. These flags are OR'ed together with
117
- the flags derived from the <a class="link" href="cairo-Font-Options.html#cairo-font-options-t"><span class="type">cairo_font_options_t</span></a> passed
118
- to <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create"><code class="function">cairo_scaled_font_create()</code></a>, so only a few values such
119
- as <code class="literal">FT_LOAD_VERTICAL_LAYOUT</code>, and <code class="literal">FT_LOAD_FORCE_AUTOHINT</code>
120
- are useful. You should not pass any of the flags affecting
121
- the load target, such as <code class="literal">FT_LOAD_TARGET_LIGHT</code>.
122
- </td>
123
- </tr>
124
- <tr>
125
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
126
- <td> a newly created <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t"><span class="type">cairo_font_face_t</span></a>. Free with
127
- <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-destroy"><code class="function">cairo_font_face_destroy()</code></a> when you are done using it.
128
- </td>
129
- </tr>
130
- </tbody>
131
- </table></div>
132
- </div>
133
- <hr>
134
- <div class="refsect2" lang="en">
135
- <a name="id2654334"></a><h3>
136
- <a name="cairo-ft-font-face-create-for-pattern"></a>cairo_ft_font_face_create_for_pattern ()</h3>
137
- <a class="indexterm" name="id2654348"></a><pre class="programlisting"><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a>* cairo_ft_font_face_create_for_pattern
138
- (FcPattern *pattern);</pre>
139
- <p>
140
- Creates a new font face for the FreeType font backend based on a
141
- fontconfig pattern. This font can then be used with
142
- <a class="link" href="cairo-Text.html#cairo-set-font-face"><code class="function">cairo_set_font_face()</code></a> or <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create"><code class="function">cairo_scaled_font_create()</code></a>. The
143
- <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a> returned from <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create"><code class="function">cairo_scaled_font_create()</code></a> is
144
- also for the FreeType backend and can be used with functions such
145
- as <code class="function">cairo_ft_font_lock_face()</code>.
146
- </p>
147
- <p>
148
- Font rendering options are represented both here and when you
149
- call <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create"><code class="function">cairo_scaled_font_create()</code></a>. Font options that have a representation
150
- in a <span class="type">FcPattern</span> must be passed in here; to modify <span class="type">FcPattern</span>
151
- appropriately to reflect the options in a <a class="link" href="cairo-Font-Options.html#cairo-font-options-t"><span class="type">cairo_font_options_t</span></a>, call
152
- <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-font-options-substitute"><code class="function">cairo_ft_font_options_substitute()</code></a>.</p>
153
- <p>
154
-
155
- </p>
156
- <div class="variablelist"><table border="0">
157
- <col align="left" valign="top">
158
- <tbody>
159
- <tr>
160
- <td><p><span class="term"><em class="parameter"><code>pattern</code></em>&#160;:</span></p></td>
161
- <td> A fully resolved fontconfig
162
- pattern. A pattern can be resolved, by, among other things, calling
163
- <code class="function">FcConfigSubstitute()</code>, <code class="function">FcDefaultSubstitute()</code>, then
164
- <code class="function">FcFontMatch()</code>. Cairo will call <code class="function">FcPatternReference()</code> on this
165
- pattern, so you should not further modify the pattern, but you can
166
- release your reference to the pattern with <code class="function">FcPatternDestroy()</code> if
167
- you no longer need to access it.
168
- </td>
169
- </tr>
170
- <tr>
171
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
172
- <td> a newly created <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t"><span class="type">cairo_font_face_t</span></a>. Free with
173
- <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-destroy"><code class="function">cairo_font_face_destroy()</code></a> when you are done using it.
174
- </td>
175
- </tr>
176
- </tbody>
177
- </table></div>
178
- </div>
179
- <hr>
180
- <div class="refsect2" lang="en">
181
- <a name="id2584018"></a><h3>
182
- <a name="cairo-ft-font-options-substitute"></a>cairo_ft_font_options_substitute ()</h3>
183
- <a class="indexterm" name="id2584029"></a><pre class="programlisting">void cairo_ft_font_options_substitute (const <a class="link" href="cairo-Font-Options.html#cairo-font-options-t">cairo_font_options_t</a> *options,
184
- FcPattern *pattern);</pre>
185
- <p>
186
- Add options to a <span class="type">FcPattern</span> based on a <a class="link" href="cairo-Font-Options.html#cairo-font-options-t"><span class="type">cairo_font_options_t</span></a> font
187
- options object. Options that are already in the pattern, are not overridden,
188
- so you should call this function after calling <code class="function">FcConfigSubstitute()</code> (the
189
- user's settings should override options based on the surface type), but
190
- before calling <code class="function">FcDefaultSubstitute()</code>.</p>
191
- <p>
192
-
193
- </p>
194
- <div class="variablelist"><table border="0">
195
- <col align="left" valign="top">
196
- <tbody>
197
- <tr>
198
- <td><p><span class="term"><em class="parameter"><code>options</code></em>&#160;:</span></p></td>
199
- <td> a <a class="link" href="cairo-Font-Options.html#cairo-font-options-t"><span class="type">cairo_font_options_t</span></a> object
200
- </td>
201
- </tr>
202
- <tr>
203
- <td><p><span class="term"><em class="parameter"><code>pattern</code></em>&#160;:</span></p></td>
204
- <td> an existing <span class="type">FcPattern</span>
205
- </td>
206
- </tr>
207
- </tbody>
208
- </table></div>
209
- </div>
210
- <hr>
211
- <div class="refsect2" lang="en">
212
- <a name="id2584150"></a><h3>
213
- <a name="cairo-ft-scaled-font-lock-face"></a>cairo_ft_scaled_font_lock_face ()</h3>
214
- <a class="indexterm" name="id2584163"></a><pre class="programlisting">FT_Face cairo_ft_scaled_font_lock_face (<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);</pre>
215
- <p>
216
- <code class="function">cairo_ft_font_lock_face()</code> gets the <span class="type">FT_Face</span> object from a FreeType
217
- backend font and scales it appropriately for the font. You must
218
- release the face with <code class="function">cairo_ft_font_unlock_face()</code>
219
- when you are done using it. Since the <span class="type">FT_Face</span> object can be
220
- shared between multiple <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a> objects, you must not
221
- lock any other font objects until you unlock this one. A count is
222
- kept of the number of times <code class="function">cairo_ft_font_lock_face()</code> is
223
- called. <code class="function">cairo_ft_font_unlock_face()</code> must be called the same number
224
- of times.
225
- </p>
226
- <p>
227
- You must be careful when using this function in a library or in a
228
- threaded application, because freetype's design makes it unsafe to
229
- call freetype functions simultaneously from multiple threads, (even
230
- if using distinct FT_Face objects). Because of this, application
231
- code that acquires an FT_Face object with this call must add it's
232
- own locking to protect any use of that object, (and which also must
233
- protect any other calls into cairo as almost any cairo function
234
- might result in a call into the freetype library).</p>
235
- <p>
236
-
237
- </p>
238
- <div class="variablelist"><table border="0">
239
- <col align="left" valign="top">
240
- <tbody>
241
- <tr>
242
- <td><p><span class="term"><em class="parameter"><code>scaled_font</code></em>&#160;:</span></p></td>
243
- <td> A <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a> from the FreeType font backend. Such an
244
- object can be created by calling <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create"><code class="function">cairo_scaled_font_create()</code></a> on a
245
- FreeType backend font face (see <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-font-face-create-for-pattern"><code class="function">cairo_ft_font_face_create_for_pattern()</code></a>,
246
- <code class="function">cairo_ft_font_face_create_for_face()</code>).
247
- </td>
248
- </tr>
249
- <tr>
250
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
251
- <td> The <span class="type">FT_Face</span> object for <em class="parameter"><code>font</code></em>, scaled appropriately,
252
- or <code class="literal">NULL</code> if <em class="parameter"><code>scaled_font</code></em> is in an error state (see
253
- <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-status"><code class="function">cairo_scaled_font_status()</code></a>) or there is insufficient memory.
254
- </td>
255
- </tr>
256
- </tbody>
257
- </table></div>
258
- </div>
259
- <hr>
260
- <div class="refsect2" lang="en">
261
- <a name="id2649062"></a><h3>
262
- <a name="cairo-ft-scaled-font-unlock-face"></a>cairo_ft_scaled_font_unlock_face ()</h3>
263
- <a class="indexterm" name="id2649075"></a><pre class="programlisting">void cairo_ft_scaled_font_unlock_face (<a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);</pre>
264
- <p>
265
- Releases a face obtained with <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-scaled-font-lock-face"><code class="function">cairo_ft_scaled_font_lock_face()</code></a>.</p>
266
- <p>
267
-
268
- </p>
269
- <div class="variablelist"><table border="0">
270
- <col align="left" valign="top">
271
- <tbody><tr>
272
- <td><p><span class="term"><em class="parameter"><code>scaled_font</code></em>&#160;:</span></p></td>
273
- <td> A <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a> from the FreeType font backend. Such an
274
- object can be created by calling <a class="link" href="cairo-Scaled-Fonts.html#cairo-scaled-font-create"><code class="function">cairo_scaled_font_create()</code></a> on a
275
- FreeType backend font face (see <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-font-face-create-for-pattern"><code class="function">cairo_ft_font_face_create_for_pattern()</code></a>,
276
- <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-font-face-create-for-ft-face"><code class="function">cairo_ft_font_face_create_for_ft_face()</code></a>).
277
- </td>
278
- </tr></tbody>
279
- </table></div>
280
- </div>
281
- </div>
282
- <div class="refsect1" lang="en">
283
- <a name="id2649175"></a><h2>See Also</h2>
284
- <p>
285
- </p>
286
- <div class="itemizedlist"><ul type="disc"><li><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t"><span class="type">cairo_font_face_t</span></a></li></ul></div>
287
- <p>
288
- </p>
289
- </div>
290
- <div class="refsect1" lang="en">
291
- <a name="id2649198"></a><div class="refsect2" lang="en"><a name="id2649199"></a></div>
292
- <hr>
293
- <div class="refsect2" lang="en"><a name="id2649200"></a></div>
294
- </div>
295
- </div>
296
- </body>
297
- </html>
@@ -1,484 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
- <title>Image Surfaces</title>
6
- <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
- <link rel="start" href="index.html" title="Cairo: A Vector Graphics Library">
8
- <link rel="up" href="Surfaces.html" title="Surfaces">
9
- <link rel="prev" href="cairo-cairo-surface-t.html" title="cairo_surface_t">
10
- <link rel="next" href="cairo-PDF-Surfaces.html" title="PDF Surfaces">
11
- <meta name="generator" content="GTK-Doc V1.9 (XML mode)">
12
- <link rel="stylesheet" href="style.css" type="text/css">
13
- <link rel="chapter" href="Drawing.html" title="Drawing">
14
- <link rel="chapter" href="Fonts.html" title="Fonts">
15
- <link rel="chapter" href="Surfaces.html" title="Surfaces">
16
- <link rel="chapter" href="Support.html" title="Utilities">
17
- <link rel="index" href="ix01.html" title="Index">
18
- <link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
19
- <link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
20
- <link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
21
- <link rel="appendix" href="language-bindings.html" title="Appendix&#160;A.&#160;Creating a language binding for cairo">
22
- </head>
23
- <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
24
- <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
25
- <tr valign="middle">
26
- <td><a accesskey="p" href="cairo-cairo-surface-t.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
27
- <td><a accesskey="u" href="Surfaces.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
28
- <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
29
- <th width="100%" align="center">Cairo: A Vector Graphics Library</th>
30
- <td><a accesskey="n" href="cairo-PDF-Surfaces.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
31
- </tr>
32
- <tr><td colspan="5" class="shortcuts"><nobr><a href="#id2609507" class="shortcut">Top</a>
33
- &#160;|&#160;
34
- <a href="#id2658192" class="shortcut">Description</a></nobr></td></tr>
35
- </table>
36
- <div class="refentry" lang="en">
37
- <a name="cairo-Image-Surfaces"></a><div class="titlepage"></div>
38
- <div class="refnamediv"><table width="100%"><tr>
39
- <td valign="top">
40
- <h2>
41
- <a name="id2609507"></a><span class="refentrytitle">Image Surfaces</span>
42
- </h2>
43
- <p>Image Surfaces &#8212; Rendering to memory buffers</p>
44
- </td>
45
- <td valign="top" align="right"></td>
46
- </tr></table></div>
47
- <div class="refsynopsisdiv">
48
- <h2>Synopsis</h2>
49
- <pre class="synopsis">
50
-
51
-
52
-
53
- enum <a class="link" href="cairo-Image-Surfaces.html#cairo-format-t">cairo_format_t</a>;
54
- int <a class="link" href="cairo-Image-Surfaces.html#cairo-format-stride-for-width">cairo_format_stride_for_width</a> (<a class="link" href="cairo-Image-Surfaces.html#cairo-format-t">cairo_format_t</a> format,
55
- int width);
56
- <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* <a class="link" href="cairo-Image-Surfaces.html#cairo-image-surface-create">cairo_image_surface_create</a> (<a class="link" href="cairo-Image-Surfaces.html#cairo-format-t">cairo_format_t</a> format,
57
- int width,
58
- int height);
59
- <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* <a class="link" href="cairo-Image-Surfaces.html#cairo-image-surface-create-for-data">cairo_image_surface_create_for_data</a> (unsigned char *data,
60
- <a class="link" href="cairo-Image-Surfaces.html#cairo-format-t">cairo_format_t</a> format,
61
- int width,
62
- int height,
63
- int stride);
64
- unsigned char* <a class="link" href="cairo-Image-Surfaces.html#cairo-image-surface-get-data">cairo_image_surface_get_data</a> (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface);
65
- <a class="link" href="cairo-Image-Surfaces.html#cairo-format-t">cairo_format_t</a> <a class="link" href="cairo-Image-Surfaces.html#cairo-image-surface-get-format">cairo_image_surface_get_format</a> (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface);
66
- int <a class="link" href="cairo-Image-Surfaces.html#cairo-image-surface-get-width">cairo_image_surface_get_width</a> (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface);
67
- int <a class="link" href="cairo-Image-Surfaces.html#cairo-image-surface-get-height">cairo_image_surface_get_height</a> (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface);
68
- int <a class="link" href="cairo-Image-Surfaces.html#cairo-image-surface-get-stride">cairo_image_surface_get_stride</a> (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface);
69
- </pre>
70
- </div>
71
- <div class="refsect1" lang="en">
72
- <a name="id2658192"></a><h2>Description</h2>
73
- <p>
74
- Image surfaces provide the ability to render to memory buffers
75
- either allocated by cairo or by the calling code. The supported
76
- image formats are those defined in <a class="link" href="cairo-Image-Surfaces.html#cairo-format-t"><span class="type">cairo_format_t</span></a>.
77
- </p>
78
- </div>
79
- <div class="refsect1" lang="en">
80
- <a name="id2658217"></a><h2>Details</h2>
81
- <div class="refsect2" lang="en">
82
- <a name="id2658228"></a><h3>
83
- <a name="cairo-format-t"></a>enum cairo_format_t</h3>
84
- <a class="indexterm" name="id2658241"></a><pre class="programlisting">typedef enum _cairo_format {
85
- CAIRO_FORMAT_ARGB32,
86
- CAIRO_FORMAT_RGB24,
87
- CAIRO_FORMAT_A8,
88
- CAIRO_FORMAT_A1
89
- /* The value of 4 is reserved by a deprecated enum value.
90
- * The next format added must have an explicit value of 5.
91
- CAIRO_FORMAT_RGB16_565 = 4,
92
- */
93
- } cairo_format_t;
94
- </pre>
95
- <p>
96
- <a class="link" href="cairo-Image-Surfaces.html#cairo-format-t"><span class="type">cairo_format_t</span></a> is used to identify the memory format of
97
- image data.
98
- </p>
99
- <p>
100
- New entries may be added in future versions.</p>
101
- <p>
102
-
103
- </p>
104
- <div class="variablelist"><table border="0">
105
- <col align="left" valign="top">
106
- <tbody>
107
- <tr>
108
- <td><p><span class="term"><a name="CAIRO-FORMAT-ARGB32:CAPS"></a><code class="literal">CAIRO_FORMAT_ARGB32</code></span></p></td>
109
- <td> each pixel is a 32-bit quantity, with
110
- alpha in the upper 8 bits, then red, then green, then blue.
111
- The 32-bit quantities are stored native-endian. Pre-multiplied
112
- alpha is used. (That is, 50% transparent red is 0x80800000,
113
- not 0x80ff0000.)
114
- </td>
115
- </tr>
116
- <tr>
117
- <td><p><span class="term"><a name="CAIRO-FORMAT-RGB24:CAPS"></a><code class="literal">CAIRO_FORMAT_RGB24</code></span></p></td>
118
- <td> each pixel is a 32-bit quantity, with
119
- the upper 8 bits unused. Red, Green, and Blue are stored
120
- in the remaining 24 bits in that order.
121
- </td>
122
- </tr>
123
- <tr>
124
- <td><p><span class="term"><a name="CAIRO-FORMAT-A8:CAPS"></a><code class="literal">CAIRO_FORMAT_A8</code></span></p></td>
125
- <td> each pixel is a 8-bit quantity holding
126
- an alpha value.
127
- </td>
128
- </tr>
129
- <tr>
130
- <td><p><span class="term"><a name="CAIRO-FORMAT-A1:CAPS"></a><code class="literal">CAIRO_FORMAT_A1</code></span></p></td>
131
- <td> each pixel is a 1-bit quantity holding
132
- an alpha value. Pixels are packed together into 32-bit
133
- quantities. The ordering of the bits matches the
134
- endianess of the platform. On a big-endian machine, the
135
- first pixel is in the uppermost bit, on a little-endian
136
- machine the first pixel is in the least-significant bit.
137
- </td>
138
- </tr>
139
- </tbody>
140
- </table></div>
141
- </div>
142
- <hr>
143
- <div class="refsect2" lang="en">
144
- <a name="id2658379"></a><h3>
145
- <a name="cairo-format-stride-for-width"></a>cairo_format_stride_for_width ()</h3>
146
- <a class="indexterm" name="id2658392"></a><pre class="programlisting">int cairo_format_stride_for_width (<a class="link" href="cairo-Image-Surfaces.html#cairo-format-t">cairo_format_t</a> format,
147
- int width);</pre>
148
- <p>
149
- This function provides a stride value that will respect all
150
- alignment requirements of the accelerated image-rendering code
151
- within cairo. Typical usage will be of the form:
152
- </p>
153
- <p>
154
- </p>
155
- <div class="informalexample"><pre class="programlisting">
156
- int stride;
157
- unsigned char *data;
158
- <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface;
159
-
160
- stride = cairo_format_stride_for_width (format, width);
161
- data = malloc (stride * height);
162
- surface = cairo_image_surface_create_for_data (data, format,
163
- width, height);
164
- </pre></div>
165
- <p>
166
-
167
- </p>
168
- <div class="variablelist"><table border="0">
169
- <col align="left" valign="top">
170
- <tbody>
171
- <tr>
172
- <td><p><span class="term"><em class="parameter"><code>format</code></em>&#160;:</span></p></td>
173
- <td> A <a class="link" href="cairo-Image-Surfaces.html#cairo-format-t"><span class="type">cairo_format_t</span></a> value
174
- </td>
175
- </tr>
176
- <tr>
177
- <td><p><span class="term"><em class="parameter"><code>width</code></em>&#160;:</span></p></td>
178
- <td> The desired width of an image surface to be created.
179
- </td>
180
- </tr>
181
- <tr>
182
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
183
- <td> the appropriate stride to use given the desired
184
- format and width, or -1 if either the format is invalid or the width
185
- too large.
186
-
187
- </td>
188
- </tr>
189
- </tbody>
190
- </table></div>
191
- <p class="since">Since 1.6
192
- </p>
193
- </div>
194
- <hr>
195
- <div class="refsect2" lang="en">
196
- <a name="id2656834"></a><h3>
197
- <a name="cairo-image-surface-create"></a>cairo_image_surface_create ()</h3>
198
- <a class="indexterm" name="id2656845"></a><pre class="programlisting"><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* cairo_image_surface_create (<a class="link" href="cairo-Image-Surfaces.html#cairo-format-t">cairo_format_t</a> format,
199
- int width,
200
- int height);</pre>
201
- <p>
202
- Creates an image surface of the specified format and
203
- dimensions. Initially the surface contents are all
204
- 0. (Specifically, within each pixel, each color or alpha channel
205
- belonging to format will be 0. The contents of bits within a pixel,
206
- but not belonging to the given format are undefined).</p>
207
- <p>
208
-
209
- </p>
210
- <div class="variablelist"><table border="0">
211
- <col align="left" valign="top">
212
- <tbody>
213
- <tr>
214
- <td><p><span class="term"><em class="parameter"><code>format</code></em>&#160;:</span></p></td>
215
- <td> format of pixels in the surface to create
216
- </td>
217
- </tr>
218
- <tr>
219
- <td><p><span class="term"><em class="parameter"><code>width</code></em>&#160;:</span></p></td>
220
- <td> width of the surface, in pixels
221
- </td>
222
- </tr>
223
- <tr>
224
- <td><p><span class="term"><em class="parameter"><code>height</code></em>&#160;:</span></p></td>
225
- <td> height of the surface, in pixels
226
- </td>
227
- </tr>
228
- <tr>
229
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
230
- <td> a pointer to the newly created surface. The caller
231
- owns the surface and should call <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-destroy"><code class="function">cairo_surface_destroy()</code></a> when done
232
- with it.
233
-
234
- This function always returns a valid pointer, but it will return a
235
- pointer to a "nil" surface if an error such as out of memory
236
- occurs. You can use <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-status"><code class="function">cairo_surface_status()</code></a> to check for this.
237
- </td>
238
- </tr>
239
- </tbody>
240
- </table></div>
241
- </div>
242
- <hr>
243
- <div class="refsect2" lang="en">
244
- <a name="id2656972"></a><h3>
245
- <a name="cairo-image-surface-create-for-data"></a>cairo_image_surface_create_for_data ()</h3>
246
- <a class="indexterm" name="id2656983"></a><pre class="programlisting"><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* cairo_image_surface_create_for_data (unsigned char *data,
247
- <a class="link" href="cairo-Image-Surfaces.html#cairo-format-t">cairo_format_t</a> format,
248
- int width,
249
- int height,
250
- int stride);</pre>
251
- <p>
252
- Creates an image surface for the provided pixel data. The output
253
- buffer must be kept around until the <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t"><span class="type">cairo_surface_t</span></a> is destroyed
254
- or <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-finish"><code class="function">cairo_surface_finish()</code></a> is called on the surface. The initial
255
- contents of <em class="parameter"><code>buffer</code></em> will be used as the initial image contents; you
256
- must explicitly clear the buffer, using, for example,
257
- <a class="link" href="cairo-Paths.html#cairo-rectangle"><code class="function">cairo_rectangle()</code></a> and <a class="link" href="cairo-cairo-t.html#cairo-fill"><code class="function">cairo_fill()</code></a> if you want it cleared.
258
- </p>
259
- <p>
260
- Note that the stride may be larger than
261
- width*bytes_per_pixel to provide proper alignment for each pixel
262
- and row. This alignment is required to allow high-performance rendering
263
- within cairo. The correct way to obtain a legal stride value is to
264
- call <a class="link" href="cairo-Image-Surfaces.html#cairo-format-stride-for-width"><code class="function">cairo_format_stride_for_width()</code></a> with the desired format and
265
- maximum image width value, and the use the resulting stride value
266
- to allocate the data and to create the image surface. See
267
- <a class="link" href="cairo-Image-Surfaces.html#cairo-format-stride-for-width"><code class="function">cairo_format_stride_for_width()</code></a> for example code.</p>
268
- <p>
269
-
270
- </p>
271
- <div class="variablelist"><table border="0">
272
- <col align="left" valign="top">
273
- <tbody>
274
- <tr>
275
- <td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
276
- <td> a pointer to a buffer supplied by the application in which
277
- to write contents. This pointer must be suitably aligned for any
278
- kind of variable, (for example, a pointer returned by malloc).
279
- </td>
280
- </tr>
281
- <tr>
282
- <td><p><span class="term"><em class="parameter"><code>format</code></em>&#160;:</span></p></td>
283
- <td> the format of pixels in the buffer
284
- </td>
285
- </tr>
286
- <tr>
287
- <td><p><span class="term"><em class="parameter"><code>width</code></em>&#160;:</span></p></td>
288
- <td> the width of the image to be stored in the buffer
289
- </td>
290
- </tr>
291
- <tr>
292
- <td><p><span class="term"><em class="parameter"><code>height</code></em>&#160;:</span></p></td>
293
- <td> the height of the image to be stored in the buffer
294
- </td>
295
- </tr>
296
- <tr>
297
- <td><p><span class="term"><em class="parameter"><code>stride</code></em>&#160;:</span></p></td>
298
- <td> the number of bytes between the start of rows in the
299
- buffer as allocated. This value should always be computed by
300
- <a class="link" href="cairo-Image-Surfaces.html#cairo-format-stride-for-width"><code class="function">cairo_format_stride_for_width()</code></a> before allocating the data
301
- buffer.
302
- </td>
303
- </tr>
304
- <tr>
305
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
306
- <td> a pointer to the newly created surface. The caller
307
- owns the surface and should call <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-destroy"><code class="function">cairo_surface_destroy()</code></a> when done
308
- with it.
309
-
310
- This function always returns a valid pointer, but it will return a
311
- pointer to a "nil" surface in the case of an error such as out of
312
- memory or an invalid stride value. In case of invalid stride value
313
- the error status of the returned surface will be
314
- <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-INVALID-STRIDE:CAPS"><code class="literal">CAIRO_STATUS_INVALID_STRIDE</code></a>. You can use
315
- <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-status"><code class="function">cairo_surface_status()</code></a> to check for this.
316
-
317
- See <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-set-user-data"><code class="function">cairo_surface_set_user_data()</code></a> for a means of attaching a
318
- destroy-notification fallback to the surface if necessary.
319
- </td>
320
- </tr>
321
- </tbody>
322
- </table></div>
323
- </div>
324
- <hr>
325
- <div class="refsect2" lang="en">
326
- <a name="id2658805"></a><h3>
327
- <a name="cairo-image-surface-get-data"></a>cairo_image_surface_get_data ()</h3>
328
- <a class="indexterm" name="id2658821"></a><pre class="programlisting">unsigned char* cairo_image_surface_get_data (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface);</pre>
329
- <p>
330
- Get a pointer to the data of the image surface, for direct
331
- inspection or modification.</p>
332
- <p>
333
-
334
- </p>
335
- <div class="variablelist"><table border="0">
336
- <col align="left" valign="top">
337
- <tbody>
338
- <tr>
339
- <td><p><span class="term"><em class="parameter"><code>surface</code></em>&#160;:</span></p></td>
340
- <td> a <span class="type">cairo_image_surface_t</span>
341
- </td>
342
- </tr>
343
- <tr>
344
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
345
- <td> a pointer to the image data of this surface or <code class="literal">NULL</code>
346
- if <em class="parameter"><code>surface</code></em> is not an image surface.
347
-
348
- </td>
349
- </tr>
350
- </tbody>
351
- </table></div>
352
- <p class="since">Since 1.2
353
- </p>
354
- </div>
355
- <hr>
356
- <div class="refsect2" lang="en">
357
- <a name="id2658914"></a><h3>
358
- <a name="cairo-image-surface-get-format"></a>cairo_image_surface_get_format ()</h3>
359
- <a class="indexterm" name="id2658929"></a><pre class="programlisting"><a class="link" href="cairo-Image-Surfaces.html#cairo-format-t">cairo_format_t</a> cairo_image_surface_get_format (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface);</pre>
360
- <p>
361
- Get the format of the surface.</p>
362
- <p>
363
-
364
- </p>
365
- <div class="variablelist"><table border="0">
366
- <col align="left" valign="top">
367
- <tbody>
368
- <tr>
369
- <td><p><span class="term"><em class="parameter"><code>surface</code></em>&#160;:</span></p></td>
370
- <td> a <span class="type">cairo_image_surface_t</span>
371
- </td>
372
- </tr>
373
- <tr>
374
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
375
- <td> the format of the surface
376
-
377
- </td>
378
- </tr>
379
- </tbody>
380
- </table></div>
381
- <p class="since">Since 1.2
382
- </p>
383
- </div>
384
- <hr>
385
- <div class="refsect2" lang="en">
386
- <a name="id2659004"></a><h3>
387
- <a name="cairo-image-surface-get-width"></a>cairo_image_surface_get_width ()</h3>
388
- <a class="indexterm" name="id2659017"></a><pre class="programlisting">int cairo_image_surface_get_width (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface);</pre>
389
- <p>
390
- Get the width of the image surface in pixels.</p>
391
- <p>
392
-
393
- </p>
394
- <div class="variablelist"><table border="0">
395
- <col align="left" valign="top">
396
- <tbody>
397
- <tr>
398
- <td><p><span class="term"><em class="parameter"><code>surface</code></em>&#160;:</span></p></td>
399
- <td> a <span class="type">cairo_image_surface_t</span>
400
- </td>
401
- </tr>
402
- <tr>
403
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
404
- <td> the width of the surface in pixels.
405
- </td>
406
- </tr>
407
- </tbody>
408
- </table></div>
409
- </div>
410
- <hr>
411
- <div class="refsect2" lang="en">
412
- <a name="id2659086"></a><h3>
413
- <a name="cairo-image-surface-get-height"></a>cairo_image_surface_get_height ()</h3>
414
- <a class="indexterm" name="id2659099"></a><pre class="programlisting">int cairo_image_surface_get_height (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface);</pre>
415
- <p>
416
- Get the height of the image surface in pixels.</p>
417
- <p>
418
-
419
- </p>
420
- <div class="variablelist"><table border="0">
421
- <col align="left" valign="top">
422
- <tbody>
423
- <tr>
424
- <td><p><span class="term"><em class="parameter"><code>surface</code></em>&#160;:</span></p></td>
425
- <td> a <span class="type">cairo_image_surface_t</span>
426
- </td>
427
- </tr>
428
- <tr>
429
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
430
- <td> the height of the surface in pixels.
431
- </td>
432
- </tr>
433
- </tbody>
434
- </table></div>
435
- </div>
436
- <hr>
437
- <div class="refsect2" lang="en">
438
- <a name="id2660933"></a><h3>
439
- <a name="cairo-image-surface-get-stride"></a>cairo_image_surface_get_stride ()</h3>
440
- <a class="indexterm" name="id2660948"></a><pre class="programlisting">int cairo_image_surface_get_stride (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface);</pre>
441
- <p>
442
- Get the stride of the image surface in bytes</p>
443
- <p>
444
-
445
- </p>
446
- <div class="variablelist"><table border="0">
447
- <col align="left" valign="top">
448
- <tbody>
449
- <tr>
450
- <td><p><span class="term"><em class="parameter"><code>surface</code></em>&#160;:</span></p></td>
451
- <td> a <span class="type">cairo_image_surface_t</span>
452
- </td>
453
- </tr>
454
- <tr>
455
- <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
456
- <td> the stride of the image surface in bytes (or 0 if
457
- <em class="parameter"><code>surface</code></em> is not an image surface). The stride is the distance in
458
- bytes from the beginning of one row of the image data to the
459
- beginning of the next row.
460
-
461
- </td>
462
- </tr>
463
- </tbody>
464
- </table></div>
465
- <p class="since">Since 1.2
466
- </p>
467
- </div>
468
- </div>
469
- <div class="refsect1" lang="en">
470
- <a name="id2661034"></a><h2>See Also</h2>
471
- <p>
472
- </p>
473
- <div class="itemizedlist"><ul type="disc"><li><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t"><span class="type">cairo_surface_t</span></a></li></ul></div>
474
- <p>
475
- </p>
476
- </div>
477
- <div class="refsect1" lang="en">
478
- <a name="id2661057"></a><div class="refsect2" lang="en"><a name="id2661058"></a></div>
479
- <hr>
480
- <div class="refsect2" lang="en"><a name="id2661059"></a></div>
481
- </div>
482
- </div>
483
- </body>
484
- </html>