pango r2608 - in trunk: . docs docs/tmpl pango



Author: behdad
Date: Tue Apr 22 00:18:41 2008
New Revision: 2608
URL: http://svn.gnome.org/viewvc/pango?rev=2608&view=rev

Log:
2008-04-21  Behdad Esfahbod  <behdad gnome org>

        * docs/pango-docs.sgml:
        * docs/pango-sections.txt:
        * docs/tmpl/bidi.sgml:
        * docs/tmpl/main.sgml:
        * docs/tmpl/vertical.sgml:
        * pango/pango-bidi-type.c (pango_log2vis_get_embedding_levels),
        (pango_unichar_direction), (pango_get_mirror_char):
        * pango/pango-bidi-type.h:
        * pango/pango-types.h:
        * pango/pango-utils.c:
        Group bidi stuff together.  Add a section in the docs for them.



Added:
   trunk/docs/tmpl/bidi.sgml
Modified:
   trunk/ChangeLog
   trunk/docs/pango-docs.sgml
   trunk/docs/pango-sections.txt
   trunk/docs/tmpl/main.sgml
   trunk/docs/tmpl/vertical.sgml
   trunk/pango/pango-bidi-type.c
   trunk/pango/pango-bidi-type.h
   trunk/pango/pango-types.h
   trunk/pango/pango-utils.c

Modified: trunk/docs/pango-docs.sgml
==============================================================================
--- trunk/docs/pango-docs.sgml	(original)
+++ trunk/docs/pango-docs.sgml	Tue Apr 22 00:18:41 2008
@@ -29,6 +29,7 @@
 <!ENTITY pango-querymodules SYSTEM "pango-querymodules.xml">
 <!ENTITY pango-Version SYSTEM "xml/pango-version.xml">
 <!ENTITY pango-Vertical-Text SYSTEM "xml/vertical.xml">
+<!ENTITY pango-Bidi-Text SYSTEM "xml/bidi.xml">
 <!ENTITY version SYSTEM "version.xml">
 <!ENTITY pango-tree-index SYSTEM "xml/tree_index.sgml">
 ]>
@@ -48,6 +49,7 @@
     &markup-format;
     &pango-Layout-Objects;
     &pango-Scripts;
+    &pango-Bidi-Text;
     &pango-Vertical-Text;
   </chapter>
 

Modified: trunk/docs/pango-sections.txt
==============================================================================
--- trunk/docs/pango-sections.txt	(original)
+++ trunk/docs/pango-sections.txt	Tue Apr 22 00:18:41 2008
@@ -6,7 +6,6 @@
 PangoItem
 PangoAnalysis
 PANGO_ANALYSIS_FLAG_CENTERED_BASELINE
-PangoDirection
 PANGO_TYPE_DIRECTION
 <SUBSECTION>
 pango_itemize
@@ -37,14 +36,7 @@
 pango_context_load_fontset
 pango_context_get_metrics
 pango_context_list_families
-<SUBSECTION>
-pango_get_mirror_char
-pango_unichar_direction
-pango_find_base_dir
-PangoBidiType
-pango_bidi_type_for_unichar
 <SUBSECTION Standard>
-PANGO_TYPE_BIDI_TYPE
 PANGO_TYPE_CONTEXT
 PangoContextClass
 PANGO_CONTEXT
@@ -63,8 +55,6 @@
 pango_shape
 
 <SUBSECTION Private>
-pango_bidi_type_get_type
-pango_direction_get_type
 pango_context_get_type
 pango_item_get_type
 </SECTION>
@@ -1080,14 +1070,31 @@
 <TITLE>Vertical Text</TITLE>
 <FILE>vertical</FILE>
 PangoGravity
-PANGO_TYPE_GRAVITY
 PangoGravityHint
-PANGO_TYPE_GRAVITY_HINT
 PANGO_GRAVITY_IS_VERTICAL
 pango_gravity_get_for_matrix
 pango_gravity_get_for_script
 pango_gravity_to_rotation
+<SUBSECTION Standard>
+PANGO_TYPE_GRAVITY
+PANGO_TYPE_GRAVITY_HINT
 <SUBSECTION Private>
 pango_gravity_get_type
 pango_gravity_hint_get_type
 </SECTION>
+
+<SECTION>
+<TITLE>Bidirectional Text</TITLE>
+<FILE>bidi</FILE>
+PangoDirection
+pango_unichar_direction
+pango_find_base_dir
+pango_get_mirror_char
+PangoBidiType
+pango_bidi_type_for_unichar
+<SUBSECTION Standard>
+PANGO_TYPE_BIDI_TYPE
+<SUBSECTION Private>
+pango_bidi_type_get_type
+pango_direction_get_type
+</SECTION>

Added: trunk/docs/tmpl/bidi.sgml
==============================================================================
--- (empty file)
+++ trunk/docs/tmpl/bidi.sgml	Tue Apr 22 00:18:41 2008
@@ -0,0 +1,105 @@
+<!-- ##### SECTION Title ##### -->
+Bidirectional Text
+
+<!-- ##### SECTION Short_Description ##### -->
+Types and functions to help with handling bidirectional text
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+Pango supports bidirectional text (like Arabic and Hebrew) automatically.
+Some applications however, need some help to correctly handle bidirectional
+text.
+</para>
+<para>
+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.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+pango_context_get_base_dir(),
+pango_context_set_base_dir(),
+pango_itemize_with_base_dir()
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### ENUM PangoDirection ##### -->
+<para>
+</para>
+
+ PANGO_DIRECTION_LTR: 
+ PANGO_DIRECTION_RTL: 
+ PANGO_DIRECTION_TTB_LTR: 
+ PANGO_DIRECTION_TTB_RTL: 
+ PANGO_DIRECTION_WEAK_LTR: 
+ PANGO_DIRECTION_WEAK_RTL: 
+ PANGO_DIRECTION_NEUTRAL: 
+
+<!-- ##### FUNCTION pango_unichar_direction ##### -->
+<para>
+
+</para>
+
+ ch: 
+ Returns: 
+
+
+<!-- ##### FUNCTION pango_find_base_dir ##### -->
+<para>
+
+</para>
+
+ text: 
+ length: 
+ Returns: 
+
+
+<!-- ##### FUNCTION pango_get_mirror_char ##### -->
+<para>
+
+</para>
+
+ ch: 
+ mirrored_ch: 
+ Returns: 
+
+
+<!-- ##### ENUM PangoBidiType ##### -->
+<para>
+
+</para>
+
+ PANGO_BIDI_TYPE_L: 
+ PANGO_BIDI_TYPE_LRE: 
+ PANGO_BIDI_TYPE_LRO: 
+ PANGO_BIDI_TYPE_R: 
+ PANGO_BIDI_TYPE_AL: 
+ PANGO_BIDI_TYPE_RLE: 
+ PANGO_BIDI_TYPE_RLO: 
+ PANGO_BIDI_TYPE_PDF: 
+ PANGO_BIDI_TYPE_EN: 
+ PANGO_BIDI_TYPE_ES: 
+ PANGO_BIDI_TYPE_ET: 
+ PANGO_BIDI_TYPE_AN: 
+ PANGO_BIDI_TYPE_CS: 
+ PANGO_BIDI_TYPE_NSM: 
+ PANGO_BIDI_TYPE_BN: 
+ PANGO_BIDI_TYPE_B: 
+ PANGO_BIDI_TYPE_S: 
+ PANGO_BIDI_TYPE_WS: 
+ PANGO_BIDI_TYPE_ON: 
+
+<!-- ##### FUNCTION pango_bidi_type_for_unichar ##### -->
+<para>
+
+</para>
+
+ ch: 
+ Returns: 
+
+

Modified: trunk/docs/tmpl/main.sgml
==============================================================================
--- trunk/docs/tmpl/main.sgml	(original)
+++ trunk/docs/tmpl/main.sgml	Tue Apr 22 00:18:41 2008
@@ -66,18 +66,6 @@
 
 
 
-<!-- ##### ENUM PangoDirection ##### -->
-<para>
-</para>
-
- PANGO_DIRECTION_LTR: 
- PANGO_DIRECTION_RTL: 
- PANGO_DIRECTION_TTB_LTR: 
- PANGO_DIRECTION_TTB_RTL: 
- PANGO_DIRECTION_WEAK_LTR: 
- PANGO_DIRECTION_WEAK_RTL: 
- PANGO_DIRECTION_NEUTRAL: 
-
 <!-- ##### MACRO PANGO_TYPE_DIRECTION ##### -->
 <para>
 The #GObject type for #PangoDirection.
@@ -344,69 +332,6 @@
 @n_families: 
 
 
-<!-- ##### FUNCTION pango_get_mirror_char ##### -->
-<para>
-
-</para>
-
- ch: 
- mirrored_ch: 
- Returns: 
-
-
-<!-- ##### FUNCTION pango_unichar_direction ##### -->
-<para>
-
-</para>
-
- ch: 
- Returns: 
-
-
-<!-- ##### FUNCTION pango_find_base_dir ##### -->
-<para>
-
-</para>
-
- text: 
- length: 
- Returns: 
-
-
-<!-- ##### ENUM PangoBidiType ##### -->
-<para>
-
-</para>
-
- PANGO_BIDI_TYPE_L: 
- PANGO_BIDI_TYPE_LRE: 
- PANGO_BIDI_TYPE_LRO: 
- PANGO_BIDI_TYPE_R: 
- PANGO_BIDI_TYPE_AL: 
- PANGO_BIDI_TYPE_RLE: 
- PANGO_BIDI_TYPE_RLO: 
- PANGO_BIDI_TYPE_PDF: 
- PANGO_BIDI_TYPE_EN: 
- PANGO_BIDI_TYPE_ES: 
- PANGO_BIDI_TYPE_ET: 
- PANGO_BIDI_TYPE_AN: 
- PANGO_BIDI_TYPE_CS: 
- PANGO_BIDI_TYPE_NSM: 
- PANGO_BIDI_TYPE_BN: 
- PANGO_BIDI_TYPE_B: 
- PANGO_BIDI_TYPE_S: 
- PANGO_BIDI_TYPE_WS: 
- PANGO_BIDI_TYPE_ON: 
-
-<!-- ##### FUNCTION pango_bidi_type_for_unichar ##### -->
-<para>
-
-</para>
-
- ch: 
- Returns: 
-
-
 <!-- ##### FUNCTION pango_break ##### -->
 <para>
 

Modified: trunk/docs/tmpl/vertical.sgml
==============================================================================
--- trunk/docs/tmpl/vertical.sgml	(original)
+++ trunk/docs/tmpl/vertical.sgml	Tue Apr 22 00:18:41 2008
@@ -84,13 +84,6 @@
 @PANGO_GRAVITY_WEST: 
 @PANGO_GRAVITY_AUTO: 
 
-<!-- ##### MACRO PANGO_TYPE_GRAVITY ##### -->
-<para>
-The #GObject type for #PangoGravity.
-</para>
-
-
-
 <!-- ##### ENUM PangoGravityHint ##### -->
 <para>
 
@@ -100,13 +93,6 @@
 @PANGO_GRAVITY_HINT_STRONG: 
 @PANGO_GRAVITY_HINT_LINE: 
 
-<!-- ##### MACRO PANGO_TYPE_GRAVITY_HINT ##### -->
-<para>
-The #GObject type for #PangoGravity.
-</para>
-
-
-
 <!-- ##### MACRO PANGO_GRAVITY_IS_VERTICAL ##### -->
 <para>
 

Modified: trunk/pango/pango-bidi-type.c
==============================================================================
--- trunk/pango/pango-bidi-type.c	(original)
+++ trunk/pango/pango-bidi-type.c	Tue Apr 22 00:18:41 2008
@@ -73,3 +73,128 @@
       return PANGO_BIDI_TYPE_ON;
     }
 }
+
+/* Some bidi-related functions */
+
+/**
+ * pango_log2vis_get_embedding_levels:
+ * @text:      the text to itemize.
+ * @length:    the number of bytes (not characters) to process, or -1
+ *             if @text is nul-terminated and the length should be calculated.
+ * @pbase_dir: input base direction, and output resolved direction.
+ *
+ * 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.
+ *
+ * Return value: a newly allocated array of embedding levels, one item per
+ *               character (not byte), that should be freed using g_free.
+ *
+ * Since: 1.4
+ */
+guint8 *
+pango_log2vis_get_embedding_levels (const gchar    *text,
+				    int             length,
+				    PangoDirection *pbase_dir)
+{
+  FriBidiCharType fribidi_base_dir;
+  guint8 *embedding_levels_list;
+
+  switch (*pbase_dir)
+    {
+    case PANGO_DIRECTION_LTR:
+    case PANGO_DIRECTION_TTB_RTL:
+      fribidi_base_dir = FRIBIDI_TYPE_L;
+      break;
+    case PANGO_DIRECTION_RTL:
+    case PANGO_DIRECTION_TTB_LTR:
+      fribidi_base_dir = FRIBIDI_TYPE_R;
+      break;
+    case PANGO_DIRECTION_WEAK_RTL:
+      fribidi_base_dir = FRIBIDI_TYPE_WR;
+      break;
+    case PANGO_DIRECTION_WEAK_LTR:
+    case PANGO_DIRECTION_NEUTRAL:
+    default:
+      fribidi_base_dir = FRIBIDI_TYPE_WL;
+      break;
+    }
+
+#ifdef FRIBIDI_HAVE_UTF8
+  {
+    if (length < 0)
+      length = strlen (text);
+    embedding_levels_list = fribidi_log2vis_get_embedding_levels_new_utf8 (text, length, &fribidi_base_dir);
+  }
+#else
+  {
+    gunichar *text_ucs4;
+    int n_chars;
+    text_ucs4 = g_utf8_to_ucs4_fast (text, length, &n_chars);
+    embedding_levels_list = g_new (guint8, n_chars);
+    fribidi_log2vis_get_embedding_levels ((FriBidiChar*)text_ucs4, n_chars,
+					  &fribidi_base_dir,
+					  (FriBidiLevel*)embedding_levels_list);
+    g_free (text_ucs4);
+  }
+#endif
+
+  *pbase_dir = (fribidi_base_dir == FRIBIDI_TYPE_L) ?  PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL;
+
+  return embedding_levels_list;
+}
+
+/**
+ * pango_unichar_direction:
+ * @ch: a Unicode character
+ *
+ * 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_gunichar() can be used instead.
+ *
+ * Return value: the direction of the character.
+ */
+PangoDirection
+pango_unichar_direction (gunichar ch)
+{
+  FriBidiCharType fribidi_ch_type = fribidi_get_type (ch);
+
+  if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
+    return PANGO_DIRECTION_NEUTRAL;
+  else if (FRIBIDI_IS_RTL (fribidi_ch_type))
+    return PANGO_DIRECTION_RTL;
+  else
+    return PANGO_DIRECTION_LTR;
+}
+
+/**
+ * pango_get_mirror_char:
+ * @ch: a Unicode character
+ * @mirrored_ch: location to store the mirrored character
+ *
+ * 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.
+ *
+ * Return value: %TRUE if @ch has a mirrored character and @mirrored_ch is
+ * filled in, %FALSE otherwise
+ **/
+gboolean
+pango_get_mirror_char (gunichar        ch,
+		       gunichar       *mirrored_ch)
+{
+  return g_unichar_get_mirror_char (ch, mirrored_ch);
+}
+

Modified: trunk/pango/pango-bidi-type.h
==============================================================================
--- trunk/pango/pango-bidi-type.h	(original)
+++ trunk/pango/pango-bidi-type.h	Tue Apr 22 00:18:41 2008
@@ -83,6 +83,53 @@
 
 PangoBidiType pango_bidi_type_for_unichar (gunichar ch) G_GNUC_CONST;
 
+/**
+ * PangoDirection:
+ * @PANGO_DIRECTION_LTR: A strong left-to-right direction
+ * @PANGO_DIRECTION_RTL: A strong right-to-left direction
+ * @PANGO_DIRECTION_TTB_LTR: Deprecated value; treated the
+ *   same as %PANGO_DIRECTION_RTL.
+ * @PANGO_DIRECTION_TTB_RTL: Deprecated value; treated the
+ *   same as %PANGO_DIRECTION_LTR
+ * @PANGO_DIRECTION_WEAK_LTR: A weak left-to-right direction
+ * @PANGO_DIRECTION_WEAK_RTL: A weak right-to-left direction
+ * @PANGO_DIRECTION_NEUTRAL: No direction specified
+ *
+ * The #PangoDirection type represents a direction in the
+ * Unicode bidirectional algorithm; not every value in this
+ * enumeration makes sense for every usage of #PangoDirection;
+ * for example, the return value of pango_unichar_direction()
+ * and pango_find_base_dir() cannot be %PANGO_DIRECTION_WEAK_LTR
+ * or %PANGO_DIRECTION_WEAK_RTL, since every character is either
+ * neutral or has a strong direction; on the other hand
+ * %PANGO_DIRECTION_NEUTRAL doesn't make sense to pass
+ * to pango_itemize_with_base_dir().
+ *
+ * The %PANGO_DIRECTION_TTB_LTR, %PANGO_DIRECTION_TTB_RTL
+ * values come from an earlier interpretation of this
+ * enumeration as the writing direction of a block of
+ * text and are no longer used; See #PangoGravity for how
+ * vertical text is handled in Pango.
+ **/
+typedef enum {
+  PANGO_DIRECTION_LTR,
+  PANGO_DIRECTION_RTL,
+  PANGO_DIRECTION_TTB_LTR,
+  PANGO_DIRECTION_TTB_RTL,
+  PANGO_DIRECTION_WEAK_LTR,
+  PANGO_DIRECTION_WEAK_RTL,
+  PANGO_DIRECTION_NEUTRAL
+} PangoDirection;
+
+PangoDirection pango_unichar_direction      (gunichar     ch) G_GNUC_CONST;
+PangoDirection pango_find_base_dir          (const gchar *text,
+					     gint         length);
+
+#ifndef PANGO_DISABLE_DEPRECATED
+gboolean       pango_get_mirror_char        (gunichar     ch,
+					     gunichar    *mirrored_ch);
+#endif
+
 G_END_DECLS
 
 #endif /* __PANGO_BIDI_TYPE_H__ */

Modified: trunk/pango/pango-types.h
==============================================================================
--- trunk/pango/pango-types.h	(original)
+++ trunk/pango/pango-types.h	Tue Apr 22 00:18:41 2008
@@ -87,53 +87,6 @@
 void pango_extents_to_pixels (PangoRectangle *inclusive,
 			      PangoRectangle *nearest);
 
-/**
- * PangoDirection:
- * @PANGO_DIRECTION_LTR: A strong left-to-right direction
- * @PANGO_DIRECTION_RTL: A strong right-to-left direction
- * @PANGO_DIRECTION_TTB_LTR: Deprecated value; treated the
- *   same as %PANGO_DIRECTION_RTL.
- * @PANGO_DIRECTION_TTB_RTL: Deprecated value; treated the
- *   same as %PANGO_DIRECTION_LTR
- * @PANGO_DIRECTION_WEAK_LTR: A weak left-to-right direction
- * @PANGO_DIRECTION_WEAK_RTL: A weak right-to-left direction
- * @PANGO_DIRECTION_NEUTRAL: No direction specified
- *
- * The #PangoDirection type represents a direction in the
- * Unicode bidirectional algorithm; not every value in this
- * enumeration makes sense for every usage of #PangoDirection;
- * for example, the return value of pango_unichar_direction()
- * and pango_find_base_dir() cannot be %PANGO_DIRECTION_WEAK_LTR
- * or %PANGO_DIRECTION_WEAK_RTL, since every character is either
- * neutral or has a strong direction; on the other hand
- * %PANGO_DIRECTION_NEUTRAL doesn't make sense to pass
- * to pango_itemize_with_base_dir().
- *
- * The %PANGO_DIRECTION_TTB_LTR, %PANGO_DIRECTION_TTB_RTL
- * values come from an earlier interpretation of this
- * enumeration as the writing direction of a block of
- * text and are no longer used; See #PangoGravity for how
- * vertical text is handled in Pango.
- **/
-typedef enum {
-  PANGO_DIRECTION_LTR,
-  PANGO_DIRECTION_RTL,
-  PANGO_DIRECTION_TTB_LTR,
-  PANGO_DIRECTION_TTB_RTL,
-  PANGO_DIRECTION_WEAK_LTR,
-  PANGO_DIRECTION_WEAK_RTL,
-  PANGO_DIRECTION_NEUTRAL
-} PangoDirection;
-
-PangoDirection pango_unichar_direction      (gunichar     ch) G_GNUC_CONST;
-PangoDirection pango_find_base_dir          (const gchar *text,
-					     gint         length);
-
-#ifndef PANGO_DISABLE_DEPRECATED
-gboolean       pango_get_mirror_char        (gunichar     ch,
-					     gunichar    *mirrored_ch);
-#endif
-
 
 #include <pango/pango-gravity.h>
 #include <pango/pango-language.h>

Modified: trunk/pango/pango-utils.c
==============================================================================
--- trunk/pango/pango-utils.c	(original)
+++ trunk/pango/pango-utils.c	Tue Apr 22 00:18:41 2008
@@ -32,8 +32,6 @@
 
 #include <glib/gstdio.h>
 
-#include "mini-fribidi/fribidi.h"
-
 #ifndef HAVE_FLOCKFILE
 #  define flockfile(f) (void)1
 #  define funlockfile(f) (void)1
@@ -1087,128 +1085,6 @@
   return FALSE;
 }
 
-/**
- * pango_log2vis_get_embedding_levels:
- * @text:      the text to itemize.
- * @length:    the number of bytes (not characters) to process, or -1
- *             if @text is nul-terminated and the length should be calculated.
- * @pbase_dir: input base direction, and output resolved direction.
- *
- * 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.
- *
- * Return value: a newly allocated array of embedding levels, one item per
- *               character (not byte), that should be freed using g_free.
- *
- * Since: 1.4
- */
-guint8 *
-pango_log2vis_get_embedding_levels (const gchar    *text,
-				    int             length,
-				    PangoDirection *pbase_dir)
-{
-  FriBidiCharType fribidi_base_dir;
-  guint8 *embedding_levels_list;
-
-  switch (*pbase_dir)
-    {
-    case PANGO_DIRECTION_LTR:
-    case PANGO_DIRECTION_TTB_RTL:
-      fribidi_base_dir = FRIBIDI_TYPE_L;
-      break;
-    case PANGO_DIRECTION_RTL:
-    case PANGO_DIRECTION_TTB_LTR:
-      fribidi_base_dir = FRIBIDI_TYPE_R;
-      break;
-    case PANGO_DIRECTION_WEAK_RTL:
-      fribidi_base_dir = FRIBIDI_TYPE_WR;
-      break;
-    case PANGO_DIRECTION_WEAK_LTR:
-    case PANGO_DIRECTION_NEUTRAL:
-    default:
-      fribidi_base_dir = FRIBIDI_TYPE_WL;
-      break;
-    }
-
-#ifdef FRIBIDI_HAVE_UTF8
-  {
-    if (length < 0)
-      length = strlen (text);
-    embedding_levels_list = fribidi_log2vis_get_embedding_levels_new_utf8 (text, length, &fribidi_base_dir);
-  }
-#else
-  {
-    gunichar *text_ucs4;
-    int n_chars;
-    text_ucs4 = g_utf8_to_ucs4_fast (text, length, &n_chars);
-    embedding_levels_list = g_new (guint8, n_chars);
-    fribidi_log2vis_get_embedding_levels ((FriBidiChar*)text_ucs4, n_chars,
-					  &fribidi_base_dir,
-					  (FriBidiLevel*)embedding_levels_list);
-    g_free (text_ucs4);
-  }
-#endif
-
-  *pbase_dir = (fribidi_base_dir == FRIBIDI_TYPE_L) ?  PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL;
-
-  return embedding_levels_list;
-}
-
-/**
- * pango_unichar_direction:
- * @ch: a Unicode character
- *
- * 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_gunichar() can be used instead.
- *
- * Return value: the direction of the character.
- */
-PangoDirection
-pango_unichar_direction (gunichar ch)
-{
-  FriBidiCharType fribidi_ch_type = fribidi_get_type (ch);
-
-  if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
-    return PANGO_DIRECTION_NEUTRAL;
-  else if (FRIBIDI_IS_RTL (fribidi_ch_type))
-    return PANGO_DIRECTION_RTL;
-  else
-    return PANGO_DIRECTION_LTR;
-}
-
-/**
- * pango_get_mirror_char:
- * @ch: a Unicode character
- * @mirrored_ch: location to store the mirrored character
- *
- * 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.
- *
- * Return value: %TRUE if @ch has a mirrored character and @mirrored_ch is
- * filled in, %FALSE otherwise
- **/
-gboolean
-pango_get_mirror_char (gunichar        ch,
-		       gunichar       *mirrored_ch)
-{
-  return g_unichar_get_mirror_char (ch, mirrored_ch);
-}
-
 
 static guint
 alias_hash (struct PangoAlias *alias)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]