Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

136 рядки
4.0 KiB

  1. /* Pango
  2. * pango-glyph.h: Glyph storage
  3. *
  4. * Copyright (C) 2000 Red Hat Software
  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 __PANGO_GLYPH_H__
  22. #define __PANGO_GLYPH_H__
  23. #include <pango/pango-types.h>
  24. #include <pango/pango-item.h>
  25. G_BEGIN_DECLS
  26. typedef struct _PangoGlyphGeometry PangoGlyphGeometry;
  27. typedef struct _PangoGlyphVisAttr PangoGlyphVisAttr;
  28. typedef struct _PangoGlyphInfo PangoGlyphInfo;
  29. typedef struct _PangoGlyphString PangoGlyphString;
  30. /* 1024ths of a device unit */
  31. typedef gint32 PangoGlyphUnit;
  32. /* Positioning information about a glyph
  33. */
  34. struct _PangoGlyphGeometry
  35. {
  36. PangoGlyphUnit width;
  37. PangoGlyphUnit x_offset;
  38. PangoGlyphUnit y_offset;
  39. };
  40. /* Visual attributes of a glyph
  41. */
  42. struct _PangoGlyphVisAttr
  43. {
  44. guint is_cluster_start : 1;
  45. };
  46. /* A single glyph
  47. */
  48. struct _PangoGlyphInfo
  49. {
  50. PangoGlyph glyph;
  51. PangoGlyphGeometry geometry;
  52. PangoGlyphVisAttr attr;
  53. };
  54. /* A string of glyphs with positional information and visual attributes -
  55. * ready for drawing
  56. */
  57. struct _PangoGlyphString {
  58. gint num_glyphs;
  59. PangoGlyphInfo *glyphs;
  60. /* This is a memory inefficient way of representing the information
  61. * here - each value gives the byte index within the text
  62. * corresponding to the glyph string of the start of the cluster to
  63. * which the glyph belongs.
  64. */
  65. gint *log_clusters;
  66. /*< private >*/
  67. gint space;
  68. };
  69. #define PANGO_TYPE_GLYPH_STRING (pango_glyph_string_get_type ())
  70. PangoGlyphString *pango_glyph_string_new (void);
  71. void pango_glyph_string_set_size (PangoGlyphString *string,
  72. gint new_len);
  73. GType pango_glyph_string_get_type (void) G_GNUC_CONST;
  74. PangoGlyphString *pango_glyph_string_copy (PangoGlyphString *string);
  75. void pango_glyph_string_free (PangoGlyphString *string);
  76. void pango_glyph_string_extents (PangoGlyphString *glyphs,
  77. PangoFont *font,
  78. PangoRectangle *ink_rect,
  79. PangoRectangle *logical_rect);
  80. int pango_glyph_string_get_width(PangoGlyphString *glyphs);
  81. void pango_glyph_string_extents_range (PangoGlyphString *glyphs,
  82. int start,
  83. int end,
  84. PangoFont *font,
  85. PangoRectangle *ink_rect,
  86. PangoRectangle *logical_rect);
  87. void pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs,
  88. const char *text,
  89. int length,
  90. int embedding_level,
  91. int *logical_widths);
  92. void pango_glyph_string_index_to_x (PangoGlyphString *glyphs,
  93. char *text,
  94. int length,
  95. PangoAnalysis *analysis,
  96. int index_,
  97. gboolean trailing,
  98. int *x_pos);
  99. void pango_glyph_string_x_to_index (PangoGlyphString *glyphs,
  100. char *text,
  101. int length,
  102. PangoAnalysis *analysis,
  103. int x_pos,
  104. int *index_,
  105. int *trailing);
  106. /* Turn a string of characters into a string of glyphs
  107. */
  108. void pango_shape (const gchar *text,
  109. gint length,
  110. const PangoAnalysis *analysis,
  111. PangoGlyphString *glyphs);
  112. GList *pango_reorder_items (GList *logical_items);
  113. G_END_DECLS
  114. #endif /* __PANGO_GLYPH_H__ */