Indic Engine Support

Indic Engine Support —

Synopsis




#define     PANGO_ZERO_WIDTH_NON_JOINER
#define     PANGO_ZERO_WIDTH_JOINER
struct      PangoIndicScript;
void        pango_indic_shift_vowels        (PangoIndicScript *script,
                                             gunichar *chars,
                                             gunichar *end);
void        pango_indic_compact             (PangoIndicScript *script,
                                             int *num,
                                             gunichar *chars,
                                             int *cluster);
void        pango_indic_convert_vowels      (PangoIndicScript *script,
                                             gboolean in_middle,
                                             int *num,
                                             gunichar *chars,
                                             gboolean has_standalone_vowels);
void        pango_indic_split_out_characters
                                            (PangoIndicScript *script,
                                             const gchar *text,
                                             int n_chars,
                                             gunichar **wc,
                                             int *n_glyph,
                                             PangoGlyphString *glyphs);

Description

Details

PANGO_ZERO_WIDTH_NON_JOINER

#define PANGO_ZERO_WIDTH_NON_JOINER 0x200c

The Unicode character 'ZERO WIDTH NON-JOINER', 0x200c.


PANGO_ZERO_WIDTH_JOINER

#define PANGO_ZERO_WIDTH_JOINER     0x200d

The Unicode character 'ZERO WIDTH JOINER', 0x200d.


struct PangoIndicScript

struct PangoIndicScript {
  /* Compulsory */
  gchar *name;
  /* Compulsory */
  gboolean (*is_prefixing_vowel)  (gunichar  what);
  /* Compulsory */
  gboolean (*is_vowel_sign)       (gunichar  what);
  /* Optional */
  gunichar (*vowel_sign_to_matra) (gunichar  what);
  /* Optional */
  gboolean (*is_vowel_half)       (gunichar  what);
  
  /* Optional */
  gboolean (*vowel_split)         (gunichar  what, 
                                   gunichar *prefix, 
                                   gunichar *suffix);
};

The PangoIndicScript struct contains a few script-dependent functions which are used by the pango_indic_* functions. Renderers must provide a suitable PangoIndicScript struct.

gchar *namethe name of the script.
gboolean (*is_prefixing_vowel) (gunichar what)determines whether a vowel is left-joining.
gboolean (*is_vowel_sign) (gunichar what)determines whether the given character is a vowel sign.
gunichar (*vowel_sign_to_matra) (gunichar what)converts a vowel sign to a matra (abbreviated form).
gboolean (*is_vowel_half) (gunichar what)determines whether the given character is part of a two-part vowel. This is an optional function.
gboolean (*vowel_split) (gunichar what, gunichar *prefix, gunichar *suffix)returns whether the given vowel can be split and the pieces in which it can be split. This is an optional function.

pango_indic_shift_vowels ()

void        pango_indic_shift_vowels        (PangoIndicScript *script,
                                             gunichar *chars,
                                             gunichar *end);

This causes the any vowels in chars which are left-joining vowels to move to the start of chars.

It determines whether the vowels are left-joining by calling is_prefixing_vowel from script.

script : A PangoIndicScript
chars : Array of gunichar
end : Pointer to just after the end of chars

pango_indic_compact ()

void        pango_indic_compact             (PangoIndicScript *script,
                                             int *num,
                                             gunichar *chars,
                                             int *cluster);

This eliminates any blank space in the chars array, updated clusters and num also. (Blank space is defines as U+0000)

script : A PangoIndicScript
num : The number of glyphs
chars : An array of glyphs/characters
cluster : The cluster array.

pango_indic_convert_vowels ()

void        pango_indic_convert_vowels      (PangoIndicScript *script,
                                             gboolean in_middle,
                                             int *num,
                                             gunichar *chars,
                                             gboolean has_standalone_vowels);

This converts the second two vowel signs in a row in a string, to either a vowel letter or spacing forms of the combining vowel.

script : A PangoIndicScript
in_middle : Whether vowels should be converted
num : The number of elements in chars.
chars : An array of glyphs/characters
has_standalone_vowels : Whether the font has standalone vowels.

pango_indic_split_out_characters ()

void        pango_indic_split_out_characters
                                            (PangoIndicScript *script,
                                             const gchar *text,
                                             int n_chars,
                                             gunichar **wc,
                                             int *n_glyph,
                                             PangoGlyphString *glyphs);

This splits out the string text into characters. It will split out two-part vowels using script->vowel_split if this function is available.

*n_chars is allocated with g_new, you must free it.

script : A PangoIndicScript
text : A UTF-8 string
n_chars : The number of UTF-8 sequences in text
wc : Pointer to array of gunichar (output param)
n_glyph : Pointer to number of elements in wc. (output param)
glyphs : A PangoGlyphString.