Details
struct PangoContext
The PangoContext structure stores global information
used to control the itemization process. It contains
the following fields:
struct PangoItem
struct PangoItem
{
gint offset;
gint length;
gint num_chars;
GSList *extra_attrs;
PangoAnalysis analysis;
}; |
The PangoItem structure stores information about
a segment of text. It contains the following fields:
struct PangoAnalysis
struct PangoAnalysis
{
PangoEngineShape *shape_engine;
PangoEngineLang *lang_engine;
PangoFont *font;
guint8 level;
}; |
The PangoAnalysis structure stores information about
the properties of a segment of text. It has the following
fields:
struct PangoLangRange
struct PangoLangRange
{
gint start;
gint length;
gchar *lang;
}; |
The PangoLangRange structure stores language tagging
information for a range of character positions of text.
It contains the following fields:
enum PangoDirection
typedef enum {
PANGO_DIRECTION_LTR,
PANGO_DIRECTION_RTL,
PANGO_DIRECTION_TTB_LTR,
PANGO_DIRECTION_TTB_RTL
} PangoDirection; |
The PangoDirection type represents the direction of writing
for text.
PANGO_TYPE_DIRECTION
#define PANGO_TYPE_DIRECTION pango_direction_get_type () |
pango_itemize ()
Breaks a piece of text into segments with consistent
directional level and shaping engine. Each byte of text will
be contained in exactly one of the items in the returned list;
the generated list of items will be in logical order (the start
offsets of the items are ascending).
cached_iter should be an iterator over attrs currently positioned at a
range before or containing start_index; cached_iter will be advanced to
the range covering the position just after start_index + length.
(i.e. if itemizing in a loop, just keep passing in the same cached_iter).
pango_item_free ()
Free a PangoItem and all associated memory.
pango_item_copy ()
Copy an existing PangoItem structure.
pango_item_new ()
Creates a new PangoItem structure initialized to default values.
pango_item_split ()
Modifies orig to cover only the text after split_index, and
returns a new item that covers the text before split_index that
used to be in orig. You can think of split_index as the length of
the returned item. split_index may not be 0, and it may not be
greater than or equal to the length of orig (that is, there must
be at least one byte assigned to each item, you can't create a
zero-length item). split_offset is the length of the first item in
chars, and must be provided because the text used to generate the
item isn't available, so pango_item_split() can't count the char
length of the split items itself.
pango_reorder_items ()
GList* pango_reorder_items (GList *logical_items); |
From a list of items in logical order and the associated
directional levels, produce a list in visual order.
The original list is unmodified.
pango_context_new ()
Creates a new PangoContext initialized to default value.
pango_context_add_font_map ()
Add a font map to the list of font maps that are searched for fonts
when fonts are looked-up in this context.
pango_context_get_font_description ()
Retrieve the default font description for the context.
pango_context_set_font_description ()
Set the default font description for the context
pango_context_get_base_dir ()
Retrieves the base direction for the context.
pango_context_set_base_dir ()
Sets the base direction for the context.
pango_context_get_lang ()
Retrieves the global language tag for the context.
pango_context_set_lang ()
void pango_context_set_lang (PangoContext *context,
const char *lang); |
Sets the global language tag for the context.
pango_context_load_font ()
Loads the font in one of the fontmaps in the context
that is the closest match for desc.
pango_context_list_families ()
void pango_context_list_families (PangoContext *context,
gchar ***families,
int *n_families); |
List all families for a context.
pango_context_list_fonts ()
Lists all fonts in all fontmaps for this context, or all
fonts in a particular family.
pango_break ()
Determines possible line, word, and character breaks
for a string of Unicode text.
pango_get_log_attrs ()
void pango_get_log_attrs (const char *text,
int length,
int level,
const char *language,
PangoLogAttr *log_attrs); |
Computes a PangoLogAttr for each character in text
pango_find_paragraph_boundary ()
void pango_find_paragraph_boundary (const gchar *text,
gint length,
gint *paragraph_delimiter_index,
gint *next_paragraph_start); |
Locates a paragraph boundary in text. A boundary is caused by
delimiter characters, such as a newline, carriage return, carriage
return-newline pair, or Unicode paragraph separator character. The
index of the run of delimiters is returned in
paragraph_delimiter_index. The index of the start of the paragraph
(index after all delimiters) is stored in paragraph_start.
If no delimiters are found, both paragraph_delimiter_index and
next_paragraph_start are filled with the length of text (an index one
off the end).
pango_default_break ()
This is the default break algorithm, used if no language
engine overrides it. Normally you should use pango_break()
instead; this function is mostly useful for chaining up
from a language engine override. Unlike pango_break(),
analysis can be NULL, but only do that if you know what
you're doing. (If you need an analysis to pass to pango_break(),
you need to pango_itemize() or use pango_get_log_attrs().)
struct PangoLogAttr
struct PangoLogAttr
{
guint is_line_break : 1; /* Can break line in front of character */
guint is_mandatory_break : 1; /* Must break line in front of character */
guint is_char_break : 1; /* Can break here when doing char wrap */
guint is_white : 1; /* Whitespace character */
/* cursor can appear in front of character (i.e. this is a grapheme
* boundary, or the first character in the text)
*/
guint is_cursor_position : 1;
/* Note that in degenerate cases, you could have both start/end set on
* some text, most likely for sentences (e.g. no space after a period, so
* the next sentence starts right away)
*/
guint is_word_start : 1; /* first character in a word */
guint is_word_end : 1; /* is first non-word char after a word */
/* There are two ways to divide sentences. The first assigns all
* intersentence whitespace/control/format chars to some sentence,
* so all chars are in some sentence; is_sentence_boundary denotes
* the boundaries there. The second way doesn't assign
* between-sentence spaces, etc. to any sentence, so
* is_sentence_start/is_sentence_end mark the boundaries of those
* sentences.
*/
guint is_sentence_boundary : 1;
guint is_sentence_start : 1; /* first character in a sentence */
guint is_sentence_end : 1; /* first non-sentence char after a sentence */
}; |
The PangoLogAttr structure stores information
about the attributes of a single character.
pango_shape ()
Given a segment of text and the corresponding
PangoAnalysis structure returned from pango_itemize(),
convert the characters into glyphs. You may also pass
in only a substring of the item from pango_itemize().