You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

139 lines
4.5 KiB

  1. /* GDK - The GIMP Drawing Kit
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. /*
  20. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GTK+ Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #if !defined(GDK_DISABLE_DEPRECATED) || defined(GDK_COMPILATION) || defined(GTK_COMPILATION)
  26. #ifndef __GDK_FONT_H__
  27. #define __GDK_FONT_H__
  28. #include <gdk/gdktypes.h>
  29. #include <pango/pango.h>
  30. G_BEGIN_DECLS
  31. #define GDK_TYPE_FONT gdk_font_get_type ()
  32. /* Types of font.
  33. * GDK_FONT_FONT: the font is an XFontStruct.
  34. * GDK_FONT_FONTSET: the font is an XFontSet used for I18N.
  35. */
  36. typedef enum
  37. {
  38. GDK_FONT_FONT,
  39. GDK_FONT_FONTSET
  40. } GdkFontType;
  41. struct _GdkFont
  42. {
  43. GdkFontType type;
  44. gint ascent;
  45. gint descent;
  46. };
  47. GType gdk_font_get_type (void) G_GNUC_CONST;
  48. GdkFont* gdk_font_ref (GdkFont *font);
  49. void gdk_font_unref (GdkFont *font);
  50. gint gdk_font_id (const GdkFont *font);
  51. gboolean gdk_font_equal (const GdkFont *fonta,
  52. const GdkFont *fontb);
  53. GdkFont *gdk_font_load_for_display (GdkDisplay *display,
  54. const gchar *font_name);
  55. GdkFont *gdk_fontset_load_for_display (GdkDisplay *display,
  56. const gchar *fontset_name);
  57. GdkFont *gdk_font_from_description_for_display (GdkDisplay *display,
  58. PangoFontDescription *font_desc);
  59. #ifndef GDK_DISABLE_DEPRECATED
  60. #ifndef GDK_MULTIHEAD_SAFE
  61. GdkFont* gdk_font_load (const gchar *font_name);
  62. GdkFont* gdk_fontset_load (const gchar *fontset_name);
  63. GdkFont* gdk_font_from_description (PangoFontDescription *font_desc);
  64. #endif
  65. gint gdk_string_width (GdkFont *font,
  66. const gchar *string);
  67. gint gdk_text_width (GdkFont *font,
  68. const gchar *text,
  69. gint text_length);
  70. gint gdk_text_width_wc (GdkFont *font,
  71. const GdkWChar *text,
  72. gint text_length);
  73. gint gdk_char_width (GdkFont *font,
  74. gchar character);
  75. gint gdk_char_width_wc (GdkFont *font,
  76. GdkWChar character);
  77. gint gdk_string_measure (GdkFont *font,
  78. const gchar *string);
  79. gint gdk_text_measure (GdkFont *font,
  80. const gchar *text,
  81. gint text_length);
  82. gint gdk_char_measure (GdkFont *font,
  83. gchar character);
  84. gint gdk_string_height (GdkFont *font,
  85. const gchar *string);
  86. gint gdk_text_height (GdkFont *font,
  87. const gchar *text,
  88. gint text_length);
  89. gint gdk_char_height (GdkFont *font,
  90. gchar character);
  91. void gdk_text_extents (GdkFont *font,
  92. const gchar *text,
  93. gint text_length,
  94. gint *lbearing,
  95. gint *rbearing,
  96. gint *width,
  97. gint *ascent,
  98. gint *descent);
  99. void gdk_text_extents_wc (GdkFont *font,
  100. const GdkWChar *text,
  101. gint text_length,
  102. gint *lbearing,
  103. gint *rbearing,
  104. gint *width,
  105. gint *ascent,
  106. gint *descent);
  107. void gdk_string_extents (GdkFont *font,
  108. const gchar *string,
  109. gint *lbearing,
  110. gint *rbearing,
  111. gint *width,
  112. gint *ascent,
  113. gint *descent);
  114. GdkDisplay * gdk_font_get_display (GdkFont *font);
  115. #endif /* GDK_DISABLE_DEPRECATED */
  116. G_END_DECLS
  117. #endif /* __GDK_FONT_H__ */
  118. #endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION || GTK_COMPILATION */