| Pango Reference Manual |
|---|
char ** pango_split_file_list (constchar *str);char * pango_trim_string (constchar *str);gint pango_read_line (FILE *stream,GString *str);gboolean pango_skip_space (constchar **pos);gboolean pango_scan_word (constchar **pos,GString *out);gboolean pango_scan_string (constchar **pos,GString *out);gboolean pango_scan_int (constchar **pos,int *out);char * pango_config_key_get (constchar *key);void pango_lookup_aliases (constchar *fontname,char ***families,int *n_families);gboolean pango_parse_style (constchar *str, PangoStyle *style,gboolean warn);gboolean pango_parse_variant (constchar *str, PangoVariant *variant,gboolean warn);gboolean pango_parse_weight (constchar *str, PangoWeight *weight,gboolean warn);gboolean pango_parse_stretch (constchar *str, PangoStretch *stretch,gboolean warn); constchar * pango_get_sysconf_subdirectory (void); constchar * pango_get_lib_subdirectory (void);guint8 * pango_log2vis_get_embedding_levels (constgchar *text,int length, PangoDirection *pbase_dir); constchar * pango_language_get_sample_string (PangoLanguage *language);gboolean pango_is_zero_width (gunichar ch);void pango_quantize_line_geometry (int *thickness,int *position);
The functions and utilities in this section are mostly used from Pango backends and modules, but may be useful for other purposes too.
char ** pango_split_file_list (constchar *str);
Splits a G_SEARCHPATH_SEPARATOR-separated list of files, stripping white space and subsituting ~/ with $HOME/.
str : |
a G_SEARCHPATH_SEPARATOR separated list of filenames |
| Returns : | a list of strings to be freed with g_strfreev() |
char * pango_trim_string (constchar *str);
Trims leading and trailing whitespace from a string.
str : |
a string |
| Returns : | A newly-allocated string that must be freed with g_free() |
gint pango_read_line (FILE *stream,GString *str);
Reads an entire line from a file into a buffer. Lines may be delimited with '\n', '\r', '\n\r', or '\r\n'. The delimiter is not written into the buffer. Text after a '#' character is treated as a comment and skipped. '\' can be used to escape a # character. '\' proceeding a line delimiter combines adjacent lines. A '\' proceeding any other character is ignored and written into the output buffer unmodified.
stream : |
a stdio stream |
str : |
|
| Returns : | 0 if the stream was already at an EOF |
gboolean pango_skip_space (constchar **pos);
Skips 0 or more characters of white space.
pos : |
in/out string position |
| Returns : | FALSE |
gboolean pango_scan_word (constchar **pos,GString *out);
Scans a word into a
pos : |
in/out string position |
out : |
a |
| Returns : | FALSE |
gboolean pango_scan_string (constchar **pos,GString *out);
Scans a string into a
pos : |
in/out string position |
out : |
a |
| Returns : | FALSE |
gboolean pango_scan_int (constchar **pos,int *out);
Scans an integer. Leading white space is skipped.
pos : |
in/out string position |
out : |
an int into which to write the result |
| Returns : | FALSE |
char * pango_config_key_get (constchar *key);
Looks up a key in the Pango config database (pseudo-win.ini style, read from $sysconfdir/pango/pangorc, ~/.pangorc, and getenv (PANGO_RC_FILE).)
key : |
Key to look up, in the form "SECTION/KEY". |
| Returns : | the value, if found, otherwise NULLg_free() |
void pango_lookup_aliases (constchar *fontname,char ***families,int *n_families);
Look up all user defined aliases for the alias fontname.
The resulting font family names will be stored in families,
and the number of families in n_families.
fontname : |
an ascii string |
families : |
will be set to an array of font family names. this array is owned by pango and should not be freed. |
n_families : |
will be set to the length of the families array.
|
gboolean pango_parse_style (constchar *str, PangoStyle *style,gboolean warn);
Parses a font style. The allowed values are "normal", "italic" and "oblique", case variations being ignored.
str : |
a string to parse. |
style : |
a PangoStyle to store the result in. |
warn : |
if TRUEg_warning() |
| Returns : | TRUEstr was successfully parsed.
|
gboolean pango_parse_variant (constchar *str, PangoVariant *variant,gboolean warn);
Parses a font variant. The allowed values are "normal" and "smallcaps" or "small_caps", case variations being ignored.
str : |
a string to parse. |
variant : |
a PangoVariant to store the result in. |
warn : |
if TRUEg_warning() |
| Returns : | TRUEstr was successfully parsed.
|
gboolean pango_parse_weight (constchar *str, PangoWeight *weight,gboolean warn);
Parses a font weight. The allowed values are "heavy", "ultrabold", "bold", "normal", "light", "ultraleight" and integers. Case variations are ignored.
str : |
a string to parse. |
weight : |
a PangoWeight to store the result in. |
warn : |
if TRUEg_warning() |
| Returns : | TRUEstr was successfully parsed.
|
gboolean pango_parse_stretch (constchar *str, PangoStretch *stretch,gboolean warn);
Parses a font stretch. The allowed values are "ultra_condensed", "extra_condensed", "condensed", "semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" and "ultra_expanded". Case variations are ignored and the '_' characters may be omitted.
str : |
a string to parse. |
stretch : |
a PangoStretch to store the result in. |
warn : |
if TRUEg_warning() |
| Returns : | TRUEstr was successfully parsed.
|
constchar * pango_get_sysconf_subdirectory (void);
On Unix, returns the name of the "pango" subdirectory of SYSCONFDIR (which is set at compile time). On Win32, returns a subdirectory of the Pango installation directory (which is deduced at run time from the DLL's location, or stored in the Registry).
| Returns : | the Pango sysconf directory. The returned string should not be freed. |
constchar * pango_get_lib_subdirectory (void);
On Unix, returns the name of the "pango" subdirectory of LIBDIR (which is set at compile time). On Win32, returns the Pango installation directory (which is deduced at run time from the DLL's location, or stored in the Registry). The returned string should not be freed.
| Returns : | the Pango lib directory. The returned string should not be freed. |
guint8 * pango_log2vis_get_embedding_levels (constgchar *text,int length, PangoDirection *pbase_dir);
This will return the bidirectional embedding levels of the input paragraph as defined by the Unicode Bidirectional Algorithm available at:
http://www.unicode.org/reports/tr9/
If the input base direction is a weak direction, the direction of the characters in the text will determine the final resolved direction.
text : |
the text to itemize. |
length : |
the number of bytes (not characters) to process, or -1
if text is nul-terminated and the legnth should be calculated.
|
pbase_dir : |
input base direction, and output resolved direction. |
| Returns : | a newly allocated array of embedding levels, one item per character (not byte), that should be freed using g_free. |
Since 1.4
constchar * pango_language_get_sample_string (PangoLanguage *language);
Get a string that is representative of the characters needed to render a particular language. This function is a bad hack for internal use by renderers and Pango.
language : |
a PangoLanguage |
| Returns : | the sample string. This value is owned by Pango and must not be freed. |
gboolean pango_is_zero_width (gunichar ch);
Checks ch to see if it is a zero-width character that should not be
normally rendered on the screen.
ch : |
a Unicode character |
| Returns : | TRUEch is a zero-width character, FALSE |
Since 1.10
void pango_quantize_line_geometry (int *thickness,int *position);
Quantizes the thickness and position of a line, typically an
underline or strikethrough, to whole device pixels, that is integer
multiples of PANGO_SCALE. The purpose of this function is to avoid
such lines looking blurry.
thickness : |
pointer to the thickness of a line, in Pango scaled units |
position : |
corresponding position |
Since 1.12