pango-glyph.inc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // included by pango.pp
  2. {$IFDEF read_forward_definitions}
  3. PPangoGlyphString = ^TPangoGlyphString;
  4. {$ENDIF read_forward_definitions}
  5. //------------------------------------------------------------------------------
  6. {$IFDEF read_interface_types}
  7. { 1000ths of a device unit }
  8. PPangoGlyphUnit = ^TPangoGlyphUnit;
  9. TPangoGlyphUnit = gint32;
  10. { Positioning information about a glyph }
  11. PPangoGlyphGeometry = ^TPangoGlyphGeometry;
  12. TPangoGlyphGeometry = record
  13. width : TPangoGlyphUnit;
  14. x_offset : TPangoGlyphUnit;
  15. y_offset : TPangoGlyphUnit;
  16. end;
  17. { Visual attributes of a glyph }
  18. PPangoGlyphVisAttr = ^TPangoGlyphVisAttr;
  19. TPangoGlyphVisAttr = record
  20. flag0 : word;
  21. end;
  22. { A single glyph }
  23. PPangoGlyphInfo = ^TPangoGlyphInfo;
  24. TPangoGlyphInfo = record
  25. glyph : TPangoGlyph;
  26. geometry : TPangoGlyphGeometry;
  27. attr : TPangoGlyphVisAttr;
  28. end;
  29. { A string of glyphs with positional information and visual attributes -
  30. ready for drawing
  31. }
  32. { This is a memory inefficient way of representing the information
  33. here - each value gives the byte index within the text
  34. corresponding to the glyph string of the start of the cluster to
  35. which the glyph belongs.
  36. }
  37. {< private > }
  38. TPangoGlyphString = record
  39. num_glyphs : gint;
  40. glyphs : PPangoGlyphInfo;
  41. log_clusters : Pgint;
  42. space : gint;
  43. end;
  44. {$ENDIF read_interface_types}
  45. //------------------------------------------------------------------------------
  46. {$IFDEF read_interface_functions}
  47. const
  48. bm_TPangoGlyphVisAttr_is_cluster_start = $1;
  49. bp_TPangoGlyphVisAttr_is_cluster_start = 0;
  50. function is_cluster_start(var a : TPangoGlyphVisAttr) : guint;
  51. procedure set_is_cluster_start(var a : TPangoGlyphVisAttr; __is_cluster_start : guint);
  52. function PANGO_TYPE_GLYPH_STRING : GType;
  53. function pango_glyph_string_new:PPangoGlyphString; cdecl; external pangolib;
  54. procedure pango_glyph_string_set_size(_string:PPangoGlyphString; new_len:gint); cdecl; external pangolib;
  55. function pango_glyph_string_get_type:GType; cdecl; external pangolib;
  56. function pango_glyph_string_copy(_string:PPangoGlyphString):PPangoGlyphString; cdecl; external pangolib;
  57. procedure pango_glyph_string_free(_string:PPangoGlyphString); cdecl; external pangolib;
  58. procedure pango_glyph_string_extents(glyphs:PPangoGlyphString; font:PPangoFont; ink_rect:PPangoRectangle; logical_rect:PPangoRectangle); cdecl; external pangolib;
  59. procedure pango_glyph_string_extents_range(glyphs:PPangoGlyphString; start:longint; theEnd:longint; font:PPangoFont; ink_rect:PPangoRectangle;
  60. logical_rect:PPangoRectangle); cdecl; external pangolib;
  61. procedure pango_glyph_string_get_logical_widths(glyphs:PPangoGlyphString; text:Pchar; length:longint; embedding_level:longint; logical_widths:Plongint); cdecl; external pangolib;
  62. procedure pango_glyph_string_index_to_x(glyphs:PPangoGlyphString; text:Pchar; length:longint; analysis:PPangoAnalysis; index:longint;
  63. trailing:gboolean; x_pos:Plongint); cdecl; external pangolib;
  64. procedure pango_glyph_string_x_to_index(glyphs:PPangoGlyphString; text:Pchar; length:longint; analysis:PPangoAnalysis; x_pos:longint;
  65. index:Plongint; trailing:Plongint); cdecl; external pangolib;
  66. { Turn a string of characters into a string of glyphs
  67. }
  68. procedure pango_shape(text:Pgchar; length:gint; analysis:PPangoAnalysis; glyphs:PPangoGlyphString); cdecl; external pangolib;
  69. function pango_reorder_items(logical_items:PGList):PGList; cdecl; external pangolib;
  70. {$endif read_interface_functions}
  71. //------------------------------------------------------------------------------
  72. {$IFDEF read_implementation}
  73. function is_cluster_start(var a : TPangoGlyphVisAttr) : guint;
  74. begin
  75. is_cluster_start:=(a.flag0 and bm_TPangoGlyphVisAttr_is_cluster_start)
  76. shr bp_TPangoGlyphVisAttr_is_cluster_start;
  77. end;
  78. procedure set_is_cluster_start(var a : TPangoGlyphVisAttr;
  79. __is_cluster_start : guint);
  80. begin
  81. a.flag0:=a.flag0
  82. or ((__is_cluster_start shl bp_TPangoGlyphVisAttr_is_cluster_start)
  83. and bm_TPangoGlyphVisAttr_is_cluster_start);
  84. end;
  85. function PANGO_TYPE_GLYPH_STRING : GType;
  86. begin
  87. PANGO_TYPE_GLYPH_STRING:=pango_glyph_string_get_type;
  88. end;
  89. {$ENDIF}