summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDov Grobgeld <dov@src.gnome.org>2003-03-12 20:54:32 +0000
committerDov Grobgeld <dov@src.gnome.org>2003-03-12 20:54:32 +0000
commit0a6d0261f6872f59ddbb97bfcbe89dc375448fa7 (patch)
treeba189dc86c85fc7a43d6b67512e085569c422d9e
parentc41f4d092ad5f2bd837b29e739491107cda41a82 (diff)
downloadpango-0a6d0261f6872f59ddbb97bfcbe89dc375448fa7.tar.gz
Quick and dirty fix for crash in the Hebrew shaper. (Bug #103634)
-rw-r--r--modules/hebrew/hebrew-shaper.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/hebrew/hebrew-shaper.c b/modules/hebrew/hebrew-shaper.c
index ef402143..717a43d6 100644
--- a/modules/hebrew/hebrew-shaper.c
+++ b/modules/hebrew/hebrew-shaper.c
@@ -21,12 +21,19 @@
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
+ *
+ * Note March 9, 2003: I fixed a crash with regards to precomposed
+ * characters, by wraping all of them to be considered as ALEF as
+ * far as consideration about composability is concerned. The rendering
+ * with regards to precomposed characters AND nikud comes out really
+ * bad though, and should be fixed, once I have more time.
*/
#include <glib.h>
#include "pango-engine.h"
-#define ucs2iso8859_8(wc) (unsigned int)((unsigned int)(wc) - 0x0590 + 0x10)
+/* Wrap all characters above 0xF00 to ALEF. */
+#define ucs2iso8859_8(wc) (wc>0xF000 ? 0x11 : (unsigned int)((unsigned int)(wc) - 0x0590 + 0x10))
#define iso8859_8_2uni(c) ((gunichar)(c) - 0x10 + 0x0590)
#define MAX_CLUSTER_CHRS 256
@@ -199,7 +206,9 @@ static const gint Unicode_shape_table[128] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};
-#define is_char_class(wc, mask) (char_class_table[ucs2iso8859_8 ((wc))] & (mask))
+/* Treat all characters above 0xF000 as characters */
+#define is_char_class(wc, mask) (wc > 0xF000 \
+ || char_class_table[ucs2iso8859_8 ((wc))] & (mask))
#define is_composible(cur_wc, nxt_wc) (compose_table[char_type_table[ucs2iso8859_8 (cur_wc)]]\
[char_type_table[ucs2iso8859_8 (nxt_wc)]])