pango-utils.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /* Pango
  2. * pango-utils.c: Utilities for internal functions and modules
  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_UTILS_H__
  22. #define __PANGO_UTILS_H__
  23. #include <stdio.h>
  24. #include <glib.h>
  25. #include <pango/pango-font.h>
  26. G_BEGIN_DECLS
  27. G_DEPRECATED
  28. char ** pango_split_file_list (const char *str);
  29. G_DEPRECATED
  30. char *pango_trim_string (const char *str);
  31. G_DEPRECATED
  32. gint pango_read_line (FILE *stream,
  33. GString *str);
  34. G_DEPRECATED
  35. gboolean pango_skip_space (const char **pos);
  36. G_DEPRECATED
  37. gboolean pango_scan_word (const char **pos,
  38. GString *out);
  39. G_DEPRECATED
  40. gboolean pango_scan_string (const char **pos,
  41. GString *out);
  42. G_DEPRECATED
  43. gboolean pango_scan_int (const char **pos,
  44. int *out);
  45. #ifdef PANGO_ENABLE_BACKEND
  46. G_DEPRECATED
  47. char * pango_config_key_get_system (const char *key);
  48. G_DEPRECATED
  49. char * pango_config_key_get (const char *key);
  50. G_DEPRECATED
  51. void pango_lookup_aliases (const char *fontname,
  52. char ***families,
  53. int *n_families);
  54. #endif /* PANGO_ENABLE_BACKEND */
  55. G_DEPRECATED
  56. gboolean pango_parse_enum (GType type,
  57. const char *str,
  58. int *value,
  59. gboolean warn,
  60. char **possible_values);
  61. /* Functions for parsing textual representations
  62. * of PangoFontDescription fields. They return TRUE if the input string
  63. * contains a valid value, which then has been assigned to the corresponding
  64. * field in the PangoFontDescription. If the warn parameter is TRUE,
  65. * a warning is printed (with g_warning) if the string does not
  66. * contain a valid value.
  67. */
  68. gboolean pango_parse_style (const char *str,
  69. PangoStyle *style,
  70. gboolean warn);
  71. gboolean pango_parse_variant (const char *str,
  72. PangoVariant *variant,
  73. gboolean warn);
  74. gboolean pango_parse_weight (const char *str,
  75. PangoWeight *weight,
  76. gboolean warn);
  77. gboolean pango_parse_stretch (const char *str,
  78. PangoStretch *stretch,
  79. gboolean warn);
  80. #ifdef PANGO_ENABLE_BACKEND
  81. /* On Unix, return the name of the "pango" subdirectory of SYSCONFDIR
  82. * (which is set at compile time). On Win32, return the Pango
  83. * installation directory (which is set at installation time, and
  84. * stored in the registry). The returned string should not be
  85. * g_free'd.
  86. */
  87. G_DEPRECATED
  88. const char * pango_get_sysconf_subdirectory (void) G_GNUC_PURE;
  89. /* Ditto for LIBDIR/pango. On Win32, use the same Pango
  90. * installation directory. This returned string should not be
  91. * g_free'd either.
  92. */
  93. G_DEPRECATED
  94. const char * pango_get_lib_subdirectory (void) G_GNUC_PURE;
  95. #endif /* PANGO_ENABLE_BACKEND */
  96. /* Hint line position and thickness.
  97. */
  98. void pango_quantize_line_geometry (int *thickness,
  99. int *position);
  100. /* A routine from fribidi that we either wrap or provide ourselves.
  101. */
  102. guint8 * pango_log2vis_get_embedding_levels (const gchar *text,
  103. int length,
  104. PangoDirection *pbase_dir);
  105. /* Unicode characters that are zero-width and should not be rendered
  106. * normally.
  107. */
  108. gboolean pango_is_zero_width (gunichar ch) G_GNUC_CONST;
  109. /* Pango version checking */
  110. /* Encode a Pango version as an integer */
  111. /**
  112. * PANGO_VERSION_ENCODE:
  113. * @major: the major component of the version number
  114. * @minor: the minor component of the version number
  115. * @micro: the micro component of the version number
  116. *
  117. * This macro encodes the given Pango version into an integer. The numbers
  118. * returned by %PANGO_VERSION and pango_version() are encoded using this macro.
  119. * Two encoded version numbers can be compared as integers.
  120. */
  121. #define PANGO_VERSION_ENCODE(major, minor, micro) ( \
  122. ((major) * 10000) \
  123. + ((minor) * 100) \
  124. + ((micro) * 1))
  125. /* Encoded version of Pango at compile-time */
  126. /**
  127. * PANGO_VERSION:
  128. *
  129. * The version of Pango available at compile-time, encoded using PANGO_VERSION_ENCODE().
  130. */
  131. /**
  132. * PANGO_VERSION_STRING:
  133. *
  134. * A string literal containing the version of Pango available at compile-time.
  135. */
  136. /**
  137. * PANGO_VERSION_MAJOR:
  138. *
  139. * The major component of the version of Pango available at compile-time.
  140. */
  141. /**
  142. * PANGO_VERSION_MINOR:
  143. *
  144. * The minor component of the version of Pango available at compile-time.
  145. */
  146. /**
  147. * PANGO_VERSION_MICRO:
  148. *
  149. * The micro component of the version of Pango available at compile-time.
  150. */
  151. #define PANGO_VERSION PANGO_VERSION_ENCODE( \
  152. PANGO_VERSION_MAJOR, \
  153. PANGO_VERSION_MINOR, \
  154. PANGO_VERSION_MICRO)
  155. /* Check that compile-time Pango is as new as required */
  156. /**
  157. * PANGO_VERSION_CHECK:
  158. * @major: the major component of the version number
  159. * @minor: the minor component of the version number
  160. * @micro: the micro component of the version number
  161. *
  162. * Checks that the version of Pango available at compile-time is not older than
  163. * the provided version number.
  164. */
  165. #define PANGO_VERSION_CHECK(major,minor,micro) \
  166. (PANGO_VERSION >= PANGO_VERSION_ENCODE(major,minor,micro))
  167. /* Return encoded version of Pango at run-time */
  168. int pango_version (void) G_GNUC_CONST;
  169. /* Return run-time Pango version as an string */
  170. const char * pango_version_string (void) G_GNUC_CONST;
  171. /* Check that run-time Pango is as new as required */
  172. const char * pango_version_check (int required_major,
  173. int required_minor,
  174. int required_micro) G_GNUC_CONST;
  175. G_END_DECLS
  176. #endif /* __PANGO_UTILS_H__ */