Bidirectional Text
Bidirectional Text — Types and functions for bidirectional text
|
|
Object Hierarchy
GEnum
├── PangoBidiType
╰── PangoDirection
Description
Pango supports bidirectional text (like Arabic and Hebrew) automatically.
Some applications however, need some help to correctly handle bidirectional text.
The PangoDirection type can be used with pango_context_set_base_dir() to
instruct Pango about direction of text, though in most cases Pango detects
that correctly and automatically. The rest of the facilities in this section
are used internally by Pango already, and are provided to help applications
that need more direct control over bidirectional setting of text.
Functions
pango_unichar_direction ()
PangoDirection
pango_unichar_direction (gunichar ch);
pango_unichar_direction is deprecated and should not be used in newly-written code.
Determines the inherent direction of a character; either
PANGO_DIRECTION_LTR, PANGO_DIRECTION_RTL, or
PANGO_DIRECTION_NEUTRAL.
This function is useful to categorize characters into left-to-right
letters, right-to-left letters, and everything else. If full
Unicode bidirectional type of a character is needed,
pango_bidi_type_for_unichar() can be used instead.
Returns
the direction of the character.
pango_find_base_dir ()
PangoDirection
pango_find_base_dir (const gchar *text,
gint length);
pango_find_base_dir is deprecated and should not be used in newly-written code.
Searches a string the first character that has a strong
direction, according to the Unicode bidirectional algorithm.
Returns
The direction corresponding to the first strong character.
If no such character is found, then PANGO_DIRECTION_NEUTRAL is returned.
Since: 1.4
pango_get_mirror_char ()
gboolean
pango_get_mirror_char (gunichar ch,
gunichar *mirrored_ch);
pango_get_mirror_char is deprecated and should not be used in newly-written code.
If ch
has the Unicode mirrored property and there is another Unicode
character that typically has a glyph that is the mirror image of ch
's
glyph, puts that character in the address pointed to by mirrored_ch
.
Use g_unichar_get_mirror_char() instead; the docs for that function
provide full details.
Returns
TRUE if ch
has a mirrored character and mirrored_ch
is
filled in, FALSE otherwise
pango_bidi_type_for_unichar ()
PangoBidiType
pango_bidi_type_for_unichar (gunichar ch);
pango_bidi_type_for_unichar is deprecated and should not be used in newly-written code.
Determines the normative bidirectional character type of a
character, as specified in the Unicode Character Database.
A simplified version of this function is available as
pango_unichar_direction().
Returns
the bidirectional character type, as used in the
Unicode bidirectional algorithm.
Since: 1.22
Types and Values
enum PangoBidiType
PangoBidiType has been deprecated since version 1.44 and should not be used in newly-written code.
Use fribidi for this information
The PangoBidiType type represents the bidirectional character
type of a Unicode character as specified by the
Unicode bidirectional algorithm.
Since: 1.22