PageRenderTime 69ms CodeModel.GetById 7ms app.highlight 57ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/gtk2/src/pango/pango-font.inc

https://github.com/slibre/freepascal
Pascal | 401 lines | 281 code | 67 blank | 53 comment | 0 complexity | 68a52888f63140a2a07f9e27d54c5c7d MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
  1// included by pango.pp
  2{$IFDEF read_forward_definitions}
  3{$ifdef PANGO_ENABLE_BACKEND}
  4   PPangoFont = ^TPangoFont;
  5   PPangoFontMetrics = ^TPangoFontMetrics;
  6{$ENDIF}
  7{$ENDIF read_forward_definitions}
  8
  9//------------------------------------------------------------------------------
 10
 11{$IFDEF read_interface_types}
 12   PPangoStyle = ^TPangoStyle;
 13   TPangoStyle = gint;
 14
 15
 16   PPangoVariant = ^TPangoVariant;
 17   TPangoVariant = gint;
 18
 19   PPangoWeight = ^TPangoWeight;
 20   TPangoWeight = gint;
 21
 22   PPangoStretch = ^TPangoStretch;
 23   TPangoStretch = gint;
 24
 25   PPangoFontMask = ^TPangoFontMask;
 26   TPangoFontMask = longint; // see below for possible values
 27
 28{$ifdef PANGO_ENABLE_BACKEND}
 29   TPangoFontMetrics = record
 30        ref_count               : guint;
 31        ascent                  : longint;
 32        descent                 : longint;
 33        approximate_char_width  : longint;
 34        approximate_digit_width : longint;
 35    end;
 36
 37   PPangoFontFamily   = ^TPangoFontFamily;
 38   PPPangoFontFamily  = ^PPangoFontFamily;
 39   PPPPangoFontFamily = ^PPPangoFontFamily;
 40   TPangoFontFamily   = record
 41        parent_instance : TGObject;
 42     end;
 43
 44{ Padding for future expansion  }
 45{}
 46
 47   PPangoFontFace   = ^TPangoFontFace;
 48   PPPangoFontFace  = ^PPangoFontFace;
 49   PPPPangoFontFace = ^PPPangoFontFace;
 50   TPangoFontFace   = record
 51        parent_instance : TGObject;
 52     end;
 53
 54   TPangoFontFamilyClassListFaces =
 55     procedure (family:PPangoFontFamily; faces:PPPPangoFontFace;
 56                                n_faces:Plongint); cdecl;
 57   TPangoFontFamilyClassGetName =
 58     function (family:PPangoFontFamily):Pchar; cdecl;
 59
 60   PPangoFontFamilyClass = ^TPangoFontFamilyClass;
 61   TPangoFontFamilyClass = record
 62        parent_class : TGObjectClass;
 63        list_faces : TPangoFontFamilyClassListFaces;
 64        get_name : TPangoFontFamilyClassGetName;
 65        _pango_reserved1 : procedure; cdecl;
 66        _pango_reserved2 : procedure; cdecl;
 67        _pango_reserved3 : procedure; cdecl;
 68        _pango_reserved4 : procedure; cdecl;
 69     end;
 70
 71{ Padding for future expansion  }
 72   PPangoFontFaceClass = ^TPangoFontFaceClass;
 73   TPangoFontFaceClass = record
 74        parent_class : TGObjectClass;
 75        get_face_name : function (face:PPangoFontFace):Pchar; cdecl;
 76        describe : function (face:PPangoFontFace):PPangoFontDescription; cdecl;
 77        _pango_reserved1 : procedure ; cdecl;
 78        _pango_reserved2 : procedure ; cdecl;
 79        _pango_reserved3 : procedure ; cdecl;
 80        _pango_reserved4 : procedure ; cdecl;
 81     end;
 82
 83   TPangoFont = record
 84        parent_instance : TGObject;
 85     end;
 86
 87   TPangoFontClassDescribe =
 88     function (font:PPangoFont):PPangoFontDescription; cdecl;
 89   TPangoFontClassGetCoverage =
 90     function (font:PPangoFont; lang:PPangoLanguage):PPangoCoverage;
 91   TPangoFontClassFindShaper =
 92     function (font:PPangoFont; lang:PPangoLanguage;
 93               ch:guint32):PPangoEngineShape;
 94   TPangoFontClassGetGlyphExtents =
 95     procedure (font:PPangoFont; glyph:TPangoGlyph; ink_rect:PPangoRectangle;
 96                logical_rect:PPangoRectangle);
 97   TPangoFontClassGetMetrics =
 98     function (font:PPangoFont; language:PPangoLanguage):PPangoFontMetrics;
 99
100   { Padding for future expansion  }
101   PPangoFontClass = ^TPangoFontClass;
102   TPangoFontClass = record
103        parent_class : TGObjectClass;
104        describe : TPangoFontClassDescribe;
105        get_coverage : TPangoFontClassGetCoverage;
106        find_shaper : TPangoFontClassFindShaper;
107        get_glyph_extents : TPangoFontClassGetGlyphExtents;
108        get_metrics : TPangoFontClassGetMetrics;
109        _pango_reserved1 : procedure ; cdecl;
110        _pango_reserved2 : procedure ; cdecl;
111        _pango_reserved3 : procedure ; cdecl;
112        _pango_reserved4 : procedure ; cdecl;
113     end;
114
115{$ENDIF PANGO_ENABLE_BACKEND}
116
117{$ENDIF read_interface_types}
118
119//-----------------------------------------------------------------------------
120
121{$IFDEF read_interface_functions}
122const
123   // values for TPangoStyle
124   PANGO_STYLE_NORMAL  = 0;  // the font is upright
125   PANGO_STYLE_OBLIQUE = 1;  // the font is slanted, but in a roman style
126   PANGO_STYLE_ITALIC  = 2;  // the font is slanted in an italic style
127
128   //values for TPangoVariant
129   PANGO_VARIANT_NORMAL      = 0;
130   PANGO_VARIANT_SMALL_CAPS  = 1;
131
132   // values for TPangoWeight
133   PANGO_WEIGHT_ULTRALIGHT = 200;
134   PANGO_WEIGHT_LIGHT      = 300;
135   PANGO_WEIGHT_NORMAL     = 400;
136   PANGO_WEIGHT_BOLD       = 700;
137   PANGO_WEIGHT_ULTRABOLD  = 800;
138   PANGO_WEIGHT_HEAVY      = 900;
139
140   //values for TPangoStretch
141   PANGO_STRETCH_ULTRA_CONDENSED = 0;
142   PANGO_STRETCH_EXTRA_CONDENSED = 1;
143   PANGO_STRETCH_CONDENSED       = 2;
144   PANGO_STRETCH_SEMI_CONDENSED  = 3;
145   PANGO_STRETCH_NORMAL          = 4;
146   PANGO_STRETCH_SEMI_EXPANDED   = 5;
147   PANGO_STRETCH_EXPANDED        = 6;
148   PANGO_STRETCH_EXTRA_EXPANDED  = 7;
149   PANGO_STRETCH_ULTRA_EXPANDED  = 8;
150
151
152   // values for TPangoFontMask
153   PANGO_FONT_MASK_FAMILY  = 1 shl 0;
154   PANGO_FONT_MASK_STYLE   = 1 shl 1;
155   PANGO_FONT_MASK_VARIANT = 1 shl 2;
156   PANGO_FONT_MASK_WEIGHT  = 1 shl 3;
157   PANGO_FONT_MASK_STRETCH = 1 shl 4;
158   PANGO_FONT_MASK_SIZE    = 1 shl 5;
159
160{ CSS scale factors (1.2 factor between each size)  }
161   PANGO_SCALE_XX_SMALL = 0.5787037037037;
162   PANGO_SCALE_X_SMALL  = 0.6444444444444;
163   PANGO_SCALE_SMALL    = 0.8333333333333;
164   PANGO_SCALE_MEDIUM   = 1.0;
165   PANGO_SCALE_LARGE    = 1.2;
166   PANGO_SCALE_X_LARGE  = 1.4399999999999;
167   PANGO_SCALE_XX_LARGE = 1.728;
168
169  {
170   PangoFontDescription
171  }
172
173function PANGO_TYPE_FONT_DESCRIPTION : GType;
174function pango_font_description_get_type:GType; cdecl; external pangolib;
175function pango_font_description_new:PPangoFontDescription; cdecl; external pangolib;
176function pango_font_description_copy(desc:PPangoFontDescription):PPangoFontDescription; cdecl; external pangolib;
177function pango_font_description_copy_static(desc:PPangoFontDescription):PPangoFontDescription; cdecl; external pangolib;
178function pango_font_description_hash(desc:PPangoFontDescription):guint; cdecl; external pangolib;
179function pango_font_description_equal(desc1:PPangoFontDescription; desc2:PPangoFontDescription):gboolean; cdecl; external pangolib;
180procedure pango_font_description_free(desc:PPangoFontDescription); cdecl; external pangolib;
181procedure pango_font_descriptions_free(var descs:PPangoFontDescription; n_descs:longint); cdecl; external pangolib;
182procedure pango_font_description_set_family(desc:PPangoFontDescription; family:Pchar); cdecl; external pangolib;
183procedure pango_font_description_set_family_static(desc:PPangoFontDescription; family:Pchar); cdecl; external pangolib;
184function pango_font_description_get_family(desc:PPangoFontDescription):Pchar; cdecl; external pangolib;
185procedure pango_font_description_set_style(desc:PPangoFontDescription; style:TPangoStyle); cdecl; external pangolib;
186function pango_font_description_get_style(desc:PPangoFontDescription):TPangoStyle; cdecl; external pangolib;
187procedure pango_font_description_set_variant(desc:PPangoFontDescription; variant:TPangoVariant); cdecl; external pangolib;
188function pango_font_description_get_variant(desc:PPangoFontDescription):TPangoVariant; cdecl; external pangolib;
189procedure pango_font_description_set_weight(desc:PPangoFontDescription; weight:TPangoWeight); cdecl; external pangolib;
190function pango_font_description_get_weight(desc:PPangoFontDescription):TPangoWeight; cdecl; external pangolib;
191procedure pango_font_description_set_stretch(desc:PPangoFontDescription; stretch:TPangoStretch); cdecl; external pangolib;
192function pango_font_description_get_stretch(desc:PPangoFontDescription):TPangoStretch; cdecl; external pangolib;
193procedure pango_font_description_set_size(desc:PPangoFontDescription; size:gint); cdecl; external pangolib;
194function pango_font_description_get_size(desc:PPangoFontDescription):gint; cdecl; external pangolib;
195procedure pango_font_description_set_absolute_size(desc:PPangoFontDescription;size:double); cdecl; external pangolib;
196function pango_font_description_get_size_is_absolute (desc:PPangoFontDescription):gboolean; cdecl; external pangolib;
197function pango_font_description_get_set_fields(desc:PPangoFontDescription):TPangoFontMask; cdecl; external pangolib;
198procedure pango_font_description_unset_fields(desc:PPangoFontDescription; to_unset:TPangoFontMask); cdecl; external pangolib;
199procedure pango_font_description_merge(desc:PPangoFontDescription; desc_to_merge:PPangoFontDescription; replace_existing:gboolean); cdecl; external pangolib;
200procedure pango_font_description_merge_static(desc:PPangoFontDescription; desc_to_merge:PPangoFontDescription; replace_existing:gboolean); cdecl; external pangolib;
201function pango_font_description_better_match(desc:PPangoFontDescription; old_match:PPangoFontDescription; new_match:PPangoFontDescription):gboolean; cdecl; external pangolib;
202function pango_font_description_from_string(str:Pchar):PPangoFontDescription; cdecl; external pangolib;
203function pango_font_description_to_string(desc:PPangoFontDescription):Pchar; cdecl; external pangolib;
204function pango_font_description_to_filename(desc:PPangoFontDescription):Pchar; cdecl; external pangolib;
205{
206   PangoFontMetrics
207}
208function PANGO_TYPE_FONT_METRICS:GType;
209function pango_font_metrics_get_type:GType; cdecl; external pangolib;
210function pango_font_metrics_ref(metrics:PPangoFontMetrics):PPangoFontMetrics; cdecl; external pangolib;
211procedure pango_font_metrics_unref(metrics:PPangoFontMetrics); cdecl; external pangolib;
212function pango_font_metrics_get_ascent(metrics:PPangoFontMetrics):longint; cdecl; external pangolib;
213function pango_font_metrics_get_descent(metrics:PPangoFontMetrics):longint; cdecl; external pangolib;
214function pango_font_metrics_get_approximate_char_width(metrics:PPangoFontMetrics):longint; cdecl; external pangolib;
215function pango_font_metrics_get_approximate_digit_width(metrics:PPangoFontMetrics):longint; cdecl; external pangolib;
216
217
218{$ifdef PANGO_ENABLE_BACKEND}
219
220function pango_font_metrics_new:PPangoFontMetrics; cdecl; external pangolib;
221
222{$endif PANGO_ENABLE_BACKEND}
223{ PANGO_ENABLE_BACKEND  }
224{
225   PangoFontFamily
226}
227
228function PANGO_TYPE_FONT_FAMILY: GType;
229function PANGO_FONT_FAMILY(anObject: Pointer): PPangoFontFamily;
230function PANGO_IS_FONT_FAMILY(anObject : Pointer) : boolean;
231
232function pango_font_family_get_type:GType; cdecl; external pangolib;
233procedure pango_font_family_list_faces(family:PPangoFontFamily;
234                     faces:PPPPangoFontFace; n_faces:Plongint); cdecl; external pangolib;
235function pango_font_family_get_name(family:PPangoFontFamily):Pchar; cdecl; external pangolib;
236function pango_font_family_is_monospace(family:PPangoFontFamily):gboolean; cdecl; external pangolib;
237
238{$ifdef PANGO_ENABLE_BACKEND}
239function PANGO_FONT_FAMILY_CLASS(klass : pointer) : PPangoFontFamilyClass;
240function PANGO_IS_FONT_FAMILY_CLASS(klass : pointer) : boolean;
241function PANGO_FONT_FAMILY_GET_CLASS(obj : PPangoFontFamily) : PPangoFontFamilyClass;
242{$endif}
243{ PANGO_ENABLE_BACKEND  }
244
245
246{
247   PangoFontFace
248}
249function PANGO_TYPE_FONT_FACE : GType;
250function PANGO_FONT_FACE(anObject : pointer) : PPangoFontFace;
251function PANGO_IS_FONT_FACE(anObject : pointer) : boolean;
252
253function pango_font_face_get_type:GType; cdecl; external pangolib;
254function pango_font_face_describe(face:PPangoFontFace):PPangoFontDescription; cdecl; external pangolib;
255function pango_font_face_get_face_name(face:PPangoFontFace):Pchar; cdecl; external pangolib;
256{$ifdef PANGO_ENABLE_BACKEND}
257function PANGO_FONT_FACE_CLASS(klass : pointer) : PPangoFontFaceClass;
258function PANGO_IS_FONT_FACE_CLASS(klass : pointer) : boolean;
259function PANGO_FONT_FACE_GET_CLASS(obj : pointer) : PPangoFontFaceClass;
260{$endif}
261{ PANGO_ENABLE_BACKEND  }
262
263{
264   PangoFont
265}
266function PANGO_TYPE_FONT : GType;
267function PANGO_FONT(anObject : pointer) : PPangoFont;
268function PANGO_IS_FONT(anObject : pointer) : boolean;
269
270function pango_font_get_type:GType; cdecl; external pangolib;
271function pango_font_describe(font:PPangoFont):PPangoFontDescription; cdecl; external pangolib;
272function pango_font_get_coverage(font:PPangoFont; language:PPangoLanguage):PPangoCoverage; cdecl; external pangolib;
273function pango_font_find_shaper(font:PPangoFont; language:PPangoLanguage; ch:guint32):PPangoEngineShape; cdecl; external pangolib;
274function pango_font_get_metrics(font:PPangoFont; language:PPangoLanguage):PPangoFontMetrics; cdecl; external pangolib;
275procedure pango_font_get_glyph_extents(font:PPangoFont; glyph:TPangoGlyph; ink_rect:PPangoRectangle; logical_rect:PPangoRectangle); cdecl; external pangolib;
276
277{$ifdef PANGO_ENABLE_BACKEND}
278function PANGO_FONT_CLASS(klass : pointer) : PPangoFontClass;
279function PANGO_IS_FONT_CLASS(klass : pointer) : boolean;
280function PANGO_FONT_GET_CLASS(obj : PPangoFont) : PPangoFontClass;
281{$endif}
282{ PANGO_ENABLE_BACKEND  }
283
284{$ENDIF read_interface_functions}
285
286//------------------------------------------------------------------------------
287
288{$IFDEF read_implementation}
289
290function PANGO_TYPE_FONT_DESCRIPTION : GType;
291begin
292  PANGO_TYPE_FONT_DESCRIPTION:=pango_font_description_get_type;
293end;
294
295function PANGO_TYPE_FONT_METRICS : GType;
296begin
297  PANGO_TYPE_FONT_METRICS:=pango_font_metrics_get_type;
298end;
299
300function PANGO_TYPE_FONT_FAMILY : GType;
301begin
302  PANGO_TYPE_FONT_FAMILY:=pango_font_family_get_type;
303end;
304
305function PANGO_FONT_FAMILY(anObject : pointer) : PPangoFontFamily;
306begin
307  PANGO_FONT_FAMILY:=PPangoFontFamily(G_TYPE_CHECK_INSTANCE_CAST(anObject,
308                                                       PANGO_TYPE_FONT_FAMILY));
309end;
310
311function PANGO_IS_FONT_FAMILY(anObject : Pointer) : boolean;
312begin
313  PANGO_IS_FONT_FAMILY:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,
314                                                   PANGO_TYPE_FONT_FAMILY);
315end;
316
317function PANGO_FONT_FAMILY_CLASS(klass : Pointer) : PPangoFontFamilyClass;
318begin
319  PANGO_FONT_FAMILY_CLASS:=PPangoFontFamilyClass(G_TYPE_CHECK_CLASS_CAST(klass,
320                                                       PANGO_TYPE_FONT_FAMILY));
321end;
322
323function PANGO_IS_FONT_FAMILY_CLASS(klass : Pointer) : boolean;
324begin
325  PANGO_IS_FONT_FAMILY_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,
326                                                        PANGO_TYPE_FONT_FAMILY);
327end;
328
329function PANGO_FONT_FAMILY_GET_CLASS(obj : PPangoFontFamily) : PPangoFontFamilyClass;
330begin
331  PANGO_FONT_FAMILY_GET_CLASS:=PPangoFontFamilyClass(G_TYPE_INSTANCE_GET_CLASS(
332                                                   obj,PANGO_TYPE_FONT_FAMILY));
333end;
334
335function PANGO_TYPE_FONT_FACE : GType;
336begin
337  PANGO_TYPE_FONT_FACE:=pango_font_face_get_type;
338end;
339
340function PANGO_FONT_FACE(anObject : Pointer) : PPangoFontFace;
341begin
342  PANGO_FONT_FACE:=PPangoFontFace(G_TYPE_CHECK_INSTANCE_CAST(anObject,
343                                                         PANGO_TYPE_FONT_FACE));
344end;
345
346function PANGO_IS_FONT_FACE(anObject : Pointer) : boolean;
347begin
348  PANGO_IS_FONT_FACE:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,PANGO_TYPE_FONT_FACE);
349end;
350
351function PANGO_FONT_FACE_CLASS(klass : Pointer) : PPangoFontFaceClass;
352begin
353  PANGO_FONT_FACE_CLASS:=PPangoFontFaceClass(G_TYPE_CHECK_CLASS_CAST(klass,
354                                                         PANGO_TYPE_FONT_FACE));
355end;
356
357function PANGO_IS_FONT_FACE_CLASS(klass : Pointer) : boolean;
358begin
359  PANGO_IS_FONT_FACE_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,PANGO_TYPE_FONT_FACE);
360end;
361
362function PANGO_FONT_FACE_GET_CLASS(obj : Pointer) : PPangoFontFaceClass;
363begin
364  PANGO_FONT_FACE_GET_CLASS:=PPangoFontFaceClass(G_TYPE_INSTANCE_GET_CLASS(obj,
365                                                         PANGO_TYPE_FONT_FACE));
366end;
367
368function PANGO_TYPE_FONT : GType;
369begin
370  PANGO_TYPE_FONT:=pango_font_get_type;
371end;
372
373function PANGO_FONT(anObject : Pointer) : PPangoFont;
374begin
375  PANGO_FONT:=PPangoFont(G_TYPE_CHECK_INSTANCE_CAST(anObject,PANGO_TYPE_FONT));
376end;
377
378function PANGO_IS_FONT(anObject : Pointer) : boolean;
379begin
380  PANGO_IS_FONT:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,PANGO_TYPE_FONT);
381end;
382
383function PANGO_FONT_CLASS(klass : Pointer) : PPangoFontClass;
384begin
385  PANGO_FONT_CLASS:=PPangoFontClass(G_TYPE_CHECK_CLASS_CAST(klass,
386                                                            PANGO_TYPE_FONT));
387end;
388
389function PANGO_IS_FONT_CLASS(klass : Pointer) : boolean;
390begin
391  PANGO_IS_FONT_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,PANGO_TYPE_FONT);
392end;
393
394function PANGO_FONT_GET_CLASS(obj : PPangoFont) : PPangoFontClass;
395begin
396  PANGO_FONT_GET_CLASS:=PPangoFontClass(G_TYPE_INSTANCE_GET_CLASS(obj,
397                                                              PANGO_TYPE_FONT));
398end;
399
400{$ENDIF read_implementation}
401