## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

1.     -----------------------------------------------------------------------

2.     --               GtkAda - Ada95 binding for Gtk+/Gnome               --

3.     --                                                                   --

4.     --                    Copyright (C) 2010-2013, AdaCore               --

5.     --                                                                   --

6.     -- This library is free software; you can redistribute it and/or     --

7.     -- modify it under the terms of the GNU 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.     -- General Public License for more details.                          --

15.     --                                                                   --

16.     -- You should have received a copy of the GNU 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.     -- As a special exception, if other files instantiate generics from  --

22.     -- this unit, or you link this unit with other files to produce an   --

23.     -- executable, this  unit  does not  by itself cause  the resulting  --

24.     -- executable to be covered by the GNU General Public License. This  --

25.     -- exception does not however invalidate any other reasons why the   --

26.     -- executable file  might be covered by the  GNU Public License.     --

27.     -----------------------------------------------------------------------

29.     --  <description>

30.     --  Utilities for manipulating font faces.

31.     --  </description>

32.     --

33.     --  <c_version>1.8.8</c_version>

34.     --  <group>Cairo</group>

36.     with Interfaces.C.Strings;

38.     package Cairo.Scaled_FontTo API docTo spec is

40.        function ReferenceTo API docTo body

41.          (Scaled_Font : Cairo_Scaled_FontTo API docTo spec)

42.           return        Cairo_Scaled_FontTo API docTo spec;

43.        --  Scaled_Font: a Cairo.Scaled_Font.T, (may be null in which case

44.        --  this function does nothing)

45.        --

46.        --  Increases the reference count on scaled_font by one. This prevents

47.        --  scaled_font from being destroyed until a matching call to

48.        --  Cairo.Scaled_Font.Destroy is made.

49.        --

50.        --  The number of references to a Cairo_Scaled_Font can be get using

51.        --  Cairo.Scaled_Font.Get_Reference_Count.

52.        --

53.        --  Returns: the referenced Cairo_Scaled_Font

55.        procedure DestroyTo API docTo body (Scaled_Font : Cairo_Scaled_FontTo API docTo spec);

56.        --  Scaled_Font: a Cairo_Scaled_Font

57.        --

58.        --  Decreases the reference count on font by one. If the result

59.        --  is zero, then font and all associated resources are freed.

60.        --  See Cairo.Scaled_Font.Reference.

62.        function Get_Reference_CountTo API docTo body

63.          (Scaled_Font : Cairo_Scaled_FontTo API docTo spec)

64.           return        GuintTo API docTo spec;

65.        --  Scaled_Font: a Cairo_Scaled_Font

66.        --

67.        --  Returns the current reference count of scaled_font.

68.        --

69.        --  Return value: the current reference count of scaled_font.  If the

70.        --  object is a nil object, 0 will be returned.

71.        --

72.        --  Since: 1.4

74.        function StatusTo API docTo body (Scaled_Font : Cairo_Scaled_FontTo API docTo spec) return Cairo_StatusTo API docTo spec;

75.        --  Scaled_Font: a Cairo_Scaled_Font

76.        --

77.        --  Checks whether an error has previously occurred for this

78.        --  scaled_font.

79.        --

80.        --  Return value: Cairo_Status_Success or another error such as

81.        --    Cairo_Status_No_Memory.

83.        function Get_TypeTo API docTo body

84.          (Scaled_Font : Cairo_Scaled_FontTo API docTo spec)

85.           return        Cairo_Font_TypeTo API docTo spec;

86.        --  Scaled_Font: a Cairo_Scaled_Font

87.        --

88.        --  This function returns the type of the backend used to create

89.        --  a scaled font. See Cairo_Font_Type for available types.

90.        --

91.        --  Return value: The type of scaled_font.

92.        --

93.        --  Since: 1.2

95.        procedure ExtentsTo API docTo body

96.          (Scaled_Font : Cairo_Scaled_FontTo API docTo spec;

97.           Extents     : access Cairo_Font_ExtentsTo API docTo spec);

98.        --  Scaled_Font: a Cairo_Scaled_Font

99.        --  Extents: a Cairo_Font_Extents which to store the retrieved Extents.

100.        --

101.        --  Gets the metrics for a Cairo_Scaled_Font.

103.        procedure Text_ExtentsTo API docTo body

104.          (Scaled_Font : Cairo_Scaled_FontTo API docTo spec;

105.           Utf8        : Interfaces.C.Strings.chars_ptr;

106.           Extents     : Cairo_Text_ExtentsTo API docTo spec);

107.        --  Scaled_Font: a Cairo_Scaled_Font

108.        --  Utf8: a NUL-terminated string of text, encoded in UTF-8

109.        --  Extents: a Cairo_Text_Extents which to store the retrieved Extents.

110.        --

111.        --  Gets the extents for a string of text. The extents describe a

112.        --  user-space rectangle that encloses the "inked" portion of the text

113.        --  drawn at the origin (0,0) (as it would be drawn by Cairo_Show_Text

114.        --  if the cairo graphics state were set to the same font_face,

115.        --  font_matrix, ctm, and font_options as scaled_font).  Additionally,

116.        --  the x_advance and y_advance values indicate the amount by which the

117.        --  current point would be advanced by Cairo_Show_Text.

118.        --

119.        --  Note that whitespace characters do not directly contribute to the

120.        --  size of the rectangle (extents.width and extents.height). They do

121.        --  contribute indirectly by changing the position of non-whitespace

122.        --  characters. In particular, trailing whitespace characters are

123.        --  likely to not affect the size of the rectangle, though they will

124.        --  affect the x_advance and y_advance values.

125.        --

126.        --  Since: 1.2

128.        procedure Glyph_ExtentsTo API docTo body

129.          (Scaled_Font : Cairo_Scaled_FontTo API docTo spec;

130.           Glyphs      : access Cairo_GlyphTo API docTo spec;

131.           Num_Glyphs  : GintTo API docTo spec;

132.           Extents     : Cairo_Text_ExtentsTo API docTo spec);

133.        --  Scaled_Font: a Cairo_Scaled_Font

134.        --  Glyphs: an array of glyph IDs with X and Y offsets.

135.        --  Num_Glyphs: the number of glyphs in the glyphs array

136.        --  Extents: a Cairo_Text_Extents which to store the retrieved Extents.

137.        --

138.        --  Gets the extents for an array of glyphs. The extents describe a

139.        --  user-space rectangle that encloses the "inked" portion of the

140.        --  glyphs, (as they would be drawn by Cairo.Show_Glyphs if the cairo

141.        --  graphics state were set to the same Font_Face, Font_Matrix, Ctm,

142.        --  and Font_Options as Scaled_Font).  Additionally, the x_advance and

143.        --  Y_Advance values indicate the amount by which the current point

144.        --  would be advanced by Cairo.Show_Glyphs.

145.        --

146.        --  Note that whitespace glyphs do not contribute to the size of the

147.        --  rectangle (extents.width and extents.height).

149.        function Get_Font_FaceTo API docTo body

150.          (Scaled_Font : Cairo_Scaled_FontTo API docTo spec)

151.           return        Cairo_Font_FaceTo API docTo spec;

152.        --  Scaled_Font: a Cairo_Scaled_Font

153.        --

154.        --  Gets the font face that this scaled font was created for.

155.        --

156.        --  Return value: The Cairo_Font_Face with which Scaled_Font was

157.        --  created.

158.        --

159.        --  Since: 1.2

161.        procedure Get_Font_MatrixTo API docTo body

162.          (Scaled_Font : Cairo_Scaled_FontTo API docTo spec;

163.           Font_Matrix : access Cairo_MatrixTo API docTo spec);

164.        --  Scaled_Font: a Cairo_Scaled_Font

165.        --  Font_Matrix: return value for the matrix

166.        --

167.        --  Stores the font matrix with which Scaled_Font was created into

168.        --  matrix.

169.        --

170.        --  Since: 1.2

172.        procedure Get_CtmTo API docTo body

173.          (Scaled_Font : Cairo_Scaled_FontTo API docTo spec;

174.           Ctm         : access Cairo_MatrixTo API docTo spec);

175.        --  Scaled_Font: a Cairo_Scaled_Font

176.        --  Ctm: return value for the CTM

177.        --

178.        --  Stores the CTM with which Scaled_Font was created into Ctm.

179.        --

180.        --  Since: 1.2

182.        procedure Get_Scale_MatrixTo API docTo body

183.          (Scaled_Font  : Cairo_Scaled_FontTo API docTo spec;

184.           Scale_Matrix : access Cairo_MatrixTo API docTo spec);

185.        --  Scaled_Font: a Cairo_Scaled_Font

186.        --  Scale_Matrix: return value for the matrix

187.        --

188.        --  Stores the scale matrix of scaled_font into matrix.

189.        --  The scale matrix is product of the font matrix and the ctm

190.        --  associated with the scaled font, and hence is the matrix mapping from

191.        --  font space to device space.

192.        --

193.        --  Since: 1.8

195.        procedure Get_Font_OptionsTo API docTo body

196.          (Scaled_Font : Cairo_Scaled_FontTo API docTo spec;

197.           Options     : Cairo_Font_OptionsTo API docTo spec);

198.        --  Scaled_Font: a Cairo_Scaled_Font

199.        --  Options: return value for the font Options

200.        --

201.        --  Stores the font options with which scaled_font was created into

202.        --  options.

203.        --

204.        --  Since: 1.2

206.     private

208.        pragma Import (C, ReferenceTo API docTo spec, "cairo_scaled_font_reference");

209.        pragma Import (C, DestroyTo API docTo spec, "cairo_scaled_font_destroy");

210.        pragma Import

211.          (C,

212.           Get_Reference_CountTo API docTo spec,

213.           "cairo_scaled_font_get_reference_count");

214.        pragma Import (C, StatusTo API docTo spec, "cairo_scaled_font_status");

215.        pragma Import (C, Get_TypeTo API docTo spec, "cairo_scaled_font_get_type");

216.        pragma Import (C, ExtentsTo API docTo spec, "cairo_scaled_font_extents");

217.        pragma Import (C, Text_ExtentsTo API docTo spec, "cairo_scaled_font_text_extents");

218.        pragma Import (C, Glyph_ExtentsTo API docTo spec, "cairo_scaled_font_glyph_extents");

219.        pragma Import (C, Get_Font_FaceTo API docTo spec, "cairo_scaled_font_get_font_face");

220.        pragma Import (C, Get_Font_MatrixTo API docTo spec, "cairo_scaled_font_get_font_matrix");

221.        pragma Import (C, Get_CtmTo API docTo spec, "cairo_scaled_font_get_ctm");

222.        pragma Import (C, Get_Scale_MatrixTo API docTo spec, "cairo_scaled_font_get_scale_matrix");

223.        pragma Import (C, Get_Font_OptionsTo API docTo spec, "cairo_scaled_font_get_font_options");

225.        --  Not bound :

226.     --     pragma Import (C, Text_To_Glyphs, "cairo_scaled_font_text_to_glyphs");

227.     --     pragma Import (C, Create, "cairo_scaled_font_create");

228.     --     pragma Import (C, Get_User_Data, "cairo_scaled_font_get_user_data");

229.     --     pragma Import (C, Set_User_Data, "cairo_scaled_font_set_user_data");

230.     end Cairo.Scaled_FontTo API docTo spec;