2 * pango-utils.c: Utilities for internal functions and modules
4 * Copyright (C) 2000 Red Hat Software
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.
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.
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.
22 #ifndef __PANGO_UTILS_H__
23 #define __PANGO_UTILS_H__
27 #include <pango/pango-font.h>
31 char ** pango_split_file_list (const char *str);
33 char *pango_trim_string (const char *str);
34 gint pango_read_line (FILE *stream,
36 gboolean pango_skip_space (const char **pos);
37 gboolean pango_scan_word (const char **pos,
39 gboolean pango_scan_string (const char **pos,
41 gboolean pango_scan_int (const char **pos,
44 #ifdef PANGO_ENABLE_BACKEND
45 char * pango_config_key_get (const char *key);
46 void pango_lookup_aliases (const char *fontname,
49 #endif /* PANGO_ENABLE_BACKEND */
51 gboolean pango_parse_enum (GType type,
55 char **possible_values);
57 /* Functions for parsing textual representations
58 * of PangoFontDescription fields. They return TRUE if the input string
59 * contains a valid value, which then has been assigned to the corresponding
60 * field in the PangoFontDescription. If the warn parameter is TRUE,
61 * a warning is printed (with g_warning) if the string does not
62 * contain a valid value.
64 gboolean pango_parse_style (const char *str,
67 gboolean pango_parse_variant (const char *str,
68 PangoVariant *variant,
70 gboolean pango_parse_weight (const char *str,
73 gboolean pango_parse_stretch (const char *str,
74 PangoStretch *stretch,
77 #ifdef PANGO_ENABLE_BACKEND
79 /* On Unix, return the name of the "pango" subdirectory of SYSCONFDIR
80 * (which is set at compile time). On Win32, return the Pango
81 * installation directory (which is set at installation time, and
82 * stored in the registry). The returned string should not be
85 G_CONST_RETURN char * pango_get_sysconf_subdirectory (void) G_GNUC_PURE;
87 /* Ditto for LIBDIR/pango. On Win32, use the same Pango
88 * installation directory. This returned string should not be
91 G_CONST_RETURN char * pango_get_lib_subdirectory (void) G_GNUC_PURE;
93 #endif /* PANGO_ENABLE_BACKEND */
95 /* Hint line position and thickness.
97 void pango_quantize_line_geometry (int *thickness,
100 /* A routine from fribidi that we either wrap or provide ourselves.
102 guint8 * pango_log2vis_get_embedding_levels (const gchar *text,
104 PangoDirection *pbase_dir);
106 /* Unicode characters that are zero-width and should not be rendered
109 gboolean pango_is_zero_width (gunichar ch) G_GNUC_CONST;
111 /* Pango version checking */
113 /* Encode a Pango version as an integer */
114 #define PANGO_VERSION_ENCODE(major, minor, micro) ( \
119 /* Encoded version of Pango at compile-time */
120 #define PANGO_VERSION PANGO_VERSION_ENCODE( \
121 PANGO_VERSION_MAJOR, \
122 PANGO_VERSION_MINOR, \
125 /* Check that compile-time Pango is as new as required */
126 #define PANGO_VERSION_CHECK(major,minor,micro) \
127 (PANGO_VERSION >= PANGO_VERSION_ENCODE(major,minor,micro))
130 /* Return encoded version of Pango at run-time */
131 int pango_version (void) G_GNUC_CONST;
133 /* Return run-time Pango version as an string */
134 G_CONST_RETURN char * pango_version_string (void) G_GNUC_CONST;
136 /* Check that run-time Pango is as new as required */
137 G_CONST_RETURN char * pango_version_check (int required_major,
139 int required_micro) G_GNUC_CONST;
143 #endif /* __PANGO_UTILS_H__ */