summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-04-25 14:23:10 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-04-25 14:23:10 +0000
commit42859635b7980db81446142b7ff39f2bb658becc (patch)
tree83b7efda253d51b077dddf826819f6149cc5c618 /modules
parent00900468a96f47c80f8c0b15844b5d05fc845f15 (diff)
downloadpango-42859635b7980db81446142b7ff39f2bb658becc.tar.gz
Released 0.10
Mon Apr 24 22:51:06 2000 Owen Taylor <otaylor@redhat.com> * configure.in: Released 0.10 * modules/arabic/*: Update from Karl Koehler, including support for LangBox fonts
Diffstat (limited to 'modules')
-rw-r--r--modules/arabic/Makefile.am2
-rw-r--r--modules/arabic/arabic-x.c88
-rw-r--r--modules/arabic/arabic.c88
-rw-r--r--modules/arabic/arconv.c26
-rw-r--r--modules/arabic/langboxfont.c255
-rw-r--r--modules/arabic/langboxfont.h28
6 files changed, 409 insertions, 78 deletions
diff --git a/modules/arabic/Makefile.am b/modules/arabic/Makefile.am
index c614ae83..dbc7d4ed 100644
--- a/modules/arabic/Makefile.am
+++ b/modules/arabic/Makefile.am
@@ -10,6 +10,8 @@ pango_arabic_la_SOURCES = \
arconv.c \
mulefont.c \
mulefont.h \
+ langboxfont.c \
+ langboxfont.h \
arconv.h
pango_arabic_la_LDFLAGS = -rpath $(libdir) -export-dynamic -avoid-version -module
diff --git a/modules/arabic/arabic-x.c b/modules/arabic/arabic-x.c
index a90561c4..098799ce 100644
--- a/modules/arabic/arabic-x.c
+++ b/modules/arabic/arabic-x.c
@@ -15,6 +15,7 @@
#include "arconv.h"
#include "mulefont.h"
+#include "langboxfont.h"
/* #define DEBUG */
#ifdef DEBUG
@@ -112,7 +113,7 @@ find_unic_font (PangoFont *font,char* charsets[],PangoXSubfont* rfonts)
int i;
int result = 0;
- n_subfonts = pango_x_list_subfonts (font, charsets, 2,
+ n_subfonts = pango_x_list_subfonts (font, charsets, 3,
&subfonts, &subfont_charsets);
for (i=0; i < n_subfonts; i++)
@@ -123,26 +124,32 @@ find_unic_font (PangoFont *font,char* charsets[],PangoXSubfont* rfonts)
result = 1; /* we know we have a mulearabic-font ... */
break;
}
+ else if ( (strcmp (charsets[subfont_charsets[i]], "iso8859-6.8x") == 0)
+ && arabic_lboxinit(font,rfonts) )
+ {
+ result = 2;
+ break;
+ }
else
{ /* test if the font has Alif-Madda; if so assume it is ok */
if ( pango_x_has_glyph /* Alif-Madda */
(font,PANGO_X_MAKE_GLYPH(subfonts[i],0xFE81)))
{
rfonts[0] = subfonts[i];
- result = 2;
- break;
+ result = 12;
+ break;
}
if ( pango_x_has_glyph /* Shadda+Kasra */
(font,PANGO_X_MAKE_GLYPH(subfonts[i],0xFC62)))
{
- result = 3; /* extra vowels in font, hopefully */
- break;
+ result = 13; /* extra vowels in font, hopefully */
+ break;
}
if ( pango_x_has_glyph /* Lam-Min alone */
(font,PANGO_X_MAKE_GLYPH(subfonts[i],0xFC42)))
{
- result = 4; /* extra ligatures in font, hopefully */
- break;
+ result = 14; /* extra ligatures in font, hopefully */
+ break;
}
}
}
@@ -154,8 +161,9 @@ find_unic_font (PangoFont *font,char* charsets[],PangoXSubfont* rfonts)
}
static char *default_charset[] = {
- "iso10646-1",
- "mulearabic-2"
+ "iso10646-1",
+ "iso8859-6.8x",
+ "mulearabic-2"
};
@@ -238,7 +246,8 @@ arabic_engine_shape (PangoFont *font,
p = text;
for (i=0; i<n_chars; i++)
{
- set_glyph (glyphs, font, PANGO_X_GLYPH_SUBFONT (unknown_glyph), i,
+ set_glyph (glyphs, font,
+ PANGO_X_GLYPH_SUBFONT (unknown_glyph), i,
p - text, PANGO_X_GLYPH_INDEX (unknown_glyph));
p = unicode_next_utf8 (p);
}
@@ -246,26 +255,6 @@ arabic_engine_shape (PangoFont *font,
}
subfont = arfonts[0];
- if (analysis->level % 2 == 0)
- {
- /* We were called on a LTR directional run (e.g. some numbers);
- fallback as simple as possible */
-
- pango_glyph_string_set_size (glyphs, n_chars);
-
- p = text;
- for (i=0; i < n_chars; i++)
- {
- GUChar4 tmp_char;
-
- _pango_utf8_iterate (p, &next, &tmp_char);
- set_glyph (glyphs, font, subfont, i, p - text, tmp_char);
- p = next;
- }
-
- return;
- }
-
wc = (GUChar4 *)g_malloc(sizeof(GUChar4)*n_chars);
p = text;
@@ -276,9 +265,19 @@ arabic_engine_shape (PangoFont *font,
}
- arabic_reshape(&n_glyph,wc,lvl);
+ if (analysis->level % 2 == 0)
+ {
+ /* We were called on a LTR directional run (e.g. some numbers);
+ fallback as simple as possible */
+ pango_glyph_string_set_size (glyphs, n_chars);
+
+ }
+ else
+ {
+ arabic_reshape(&n_glyph,wc,lvl);
+ pango_glyph_string_set_size (glyphs, n_glyph);
+ };
- pango_glyph_string_set_size (glyphs, n_glyph);
p = text;
pold = p;
@@ -302,7 +301,30 @@ arabic_engine_shape (PangoFont *font,
#endif
arabic_mule_recode(&subfont,&(wc[i]),arfonts);
}
-
+ else if ( lvl == 2 )
+ {
+#ifdef DEBUG
+ fprintf(stderr,"[ar] lbox-recoding char %x",
+ wc[i]);
+#endif
+ if (( i > 0 )&&(wc[i-1] == 0))
+ {
+ arabic_lbox_recode(&subfont,&(wc[i]),
+ &(wc[i-1]), arfonts);
+#ifdef DEBUG
+ if (wc[i-1] != 0)
+ {
+ fprintf(stderr,"[ar] lbox-recoded"
+ " special char %x",
+ wc[i-1]);
+ }
+#endif
+ }
+ else
+ arabic_lbox_recode(&subfont,&(wc[i]),NULL,
+ arfonts);
+ }
+
set_glyph(glyphs, font, subfont, n_glyph - 1,
cluster_start, wc[i]);
diff --git a/modules/arabic/arabic.c b/modules/arabic/arabic.c
index a90561c4..098799ce 100644
--- a/modules/arabic/arabic.c
+++ b/modules/arabic/arabic.c
@@ -15,6 +15,7 @@
#include "arconv.h"
#include "mulefont.h"
+#include "langboxfont.h"
/* #define DEBUG */
#ifdef DEBUG
@@ -112,7 +113,7 @@ find_unic_font (PangoFont *font,char* charsets[],PangoXSubfont* rfonts)
int i;
int result = 0;
- n_subfonts = pango_x_list_subfonts (font, charsets, 2,
+ n_subfonts = pango_x_list_subfonts (font, charsets, 3,
&subfonts, &subfont_charsets);
for (i=0; i < n_subfonts; i++)
@@ -123,26 +124,32 @@ find_unic_font (PangoFont *font,char* charsets[],PangoXSubfont* rfonts)
result = 1; /* we know we have a mulearabic-font ... */
break;
}
+ else if ( (strcmp (charsets[subfont_charsets[i]], "iso8859-6.8x") == 0)
+ && arabic_lboxinit(font,rfonts) )
+ {
+ result = 2;
+ break;
+ }
else
{ /* test if the font has Alif-Madda; if so assume it is ok */
if ( pango_x_has_glyph /* Alif-Madda */
(font,PANGO_X_MAKE_GLYPH(subfonts[i],0xFE81)))
{
rfonts[0] = subfonts[i];
- result = 2;
- break;
+ result = 12;
+ break;
}
if ( pango_x_has_glyph /* Shadda+Kasra */
(font,PANGO_X_MAKE_GLYPH(subfonts[i],0xFC62)))
{
- result = 3; /* extra vowels in font, hopefully */
- break;
+ result = 13; /* extra vowels in font, hopefully */
+ break;
}
if ( pango_x_has_glyph /* Lam-Min alone */
(font,PANGO_X_MAKE_GLYPH(subfonts[i],0xFC42)))
{
- result = 4; /* extra ligatures in font, hopefully */
- break;
+ result = 14; /* extra ligatures in font, hopefully */
+ break;
}
}
}
@@ -154,8 +161,9 @@ find_unic_font (PangoFont *font,char* charsets[],PangoXSubfont* rfonts)
}
static char *default_charset[] = {
- "iso10646-1",
- "mulearabic-2"
+ "iso10646-1",
+ "iso8859-6.8x",
+ "mulearabic-2"
};
@@ -238,7 +246,8 @@ arabic_engine_shape (PangoFont *font,
p = text;
for (i=0; i<n_chars; i++)
{
- set_glyph (glyphs, font, PANGO_X_GLYPH_SUBFONT (unknown_glyph), i,
+ set_glyph (glyphs, font,
+ PANGO_X_GLYPH_SUBFONT (unknown_glyph), i,
p - text, PANGO_X_GLYPH_INDEX (unknown_glyph));
p = unicode_next_utf8 (p);
}
@@ -246,26 +255,6 @@ arabic_engine_shape (PangoFont *font,
}
subfont = arfonts[0];
- if (analysis->level % 2 == 0)
- {
- /* We were called on a LTR directional run (e.g. some numbers);
- fallback as simple as possible */
-
- pango_glyph_string_set_size (glyphs, n_chars);
-
- p = text;
- for (i=0; i < n_chars; i++)
- {
- GUChar4 tmp_char;
-
- _pango_utf8_iterate (p, &next, &tmp_char);
- set_glyph (glyphs, font, subfont, i, p - text, tmp_char);
- p = next;
- }
-
- return;
- }
-
wc = (GUChar4 *)g_malloc(sizeof(GUChar4)*n_chars);
p = text;
@@ -276,9 +265,19 @@ arabic_engine_shape (PangoFont *font,
}
- arabic_reshape(&n_glyph,wc,lvl);
+ if (analysis->level % 2 == 0)
+ {
+ /* We were called on a LTR directional run (e.g. some numbers);
+ fallback as simple as possible */
+ pango_glyph_string_set_size (glyphs, n_chars);
+
+ }
+ else
+ {
+ arabic_reshape(&n_glyph,wc,lvl);
+ pango_glyph_string_set_size (glyphs, n_glyph);
+ };
- pango_glyph_string_set_size (glyphs, n_glyph);
p = text;
pold = p;
@@ -302,7 +301,30 @@ arabic_engine_shape (PangoFont *font,
#endif
arabic_mule_recode(&subfont,&(wc[i]),arfonts);
}
-
+ else if ( lvl == 2 )
+ {
+#ifdef DEBUG
+ fprintf(stderr,"[ar] lbox-recoding char %x",
+ wc[i]);
+#endif
+ if (( i > 0 )&&(wc[i-1] == 0))
+ {
+ arabic_lbox_recode(&subfont,&(wc[i]),
+ &(wc[i-1]), arfonts);
+#ifdef DEBUG
+ if (wc[i-1] != 0)
+ {
+ fprintf(stderr,"[ar] lbox-recoded"
+ " special char %x",
+ wc[i-1]);
+ }
+#endif
+ }
+ else
+ arabic_lbox_recode(&subfont,&(wc[i]),NULL,
+ arfonts);
+ }
+
set_glyph(glyphs, font, subfont, n_glyph - 1,
cluster_start, wc[i]);
diff --git a/modules/arabic/arconv.c b/modules/arabic/arconv.c
index 979ceb9d..668378fc 100644
--- a/modules/arabic/arconv.c
+++ b/modules/arabic/arconv.c
@@ -7,7 +7,8 @@
* knowledge. Bad examples from the book are 'ALEF.LAM'-ligature,
* ( one also sais fi-ligature, not if-ligature ) and HAMZA handling.
* There is only _one_ letter HAMZA, and so four (!) forms of HAMZA in
- * the basic section seem .. strange.
+ * the basic section seem .. strange ( maybe I just have not understood
+ * the sense of them, though ).
*/
#include "arconv.h"
@@ -332,13 +333,13 @@ ligature(GUChar4* string,int si,int len,charstruct* oldchar)
switch (newchar)
{
case ALIF: oldchar->basechar = LAM_ALIF;
- oldchar->numshapes = 2; retval = 2; break;
+ oldchar->numshapes = 2; retval = 3; break;
case ALIFHAMZA: oldchar->basechar = LAM_ALIFHAMZA;
- oldchar->numshapes = 2; retval = 2; break;
+ oldchar->numshapes = 2; retval = 3; break;
case ALIFIHAMZA:oldchar->basechar = LAM_ALIFIHAMZA;
- oldchar->numshapes = 2; retval = 2; break;
+ oldchar->numshapes = 2; retval = 3; break;
case ALIFMADDA: oldchar->basechar = LAM_ALIFMADDA ;
- oldchar->numshapes = 2; retval = 2; break;
+ oldchar->numshapes = 2; retval = 3; break;
}
break;
case ALIF:
@@ -434,8 +435,9 @@ shape(int olen,int* len,GUChar4* string,int level)
curchar.numshapes = nc;
curchar.lignum++;
}
- else if ( join == 2 )
- {
+ else if ( ( join == 2 )
+ ||((join == 3)&&(level != 2)) )
+ { /* Lam-Alif in Langbox-font is no ligature */
(*len)--;
}
si--;
@@ -488,7 +490,7 @@ doublelig(int olen,int* len,GUChar4* string,int level)
if (string[si-1]==SHADDA) lapresult = 0xFC61;
break;
case 0xFEDF: /* LAM initial */
- if (level > 3){
+ if (level > 13){
switch(string[si-1]){
case 0xFE9E : lapresult = 0xFC3F; break; /* DJEEM final*/
case 0xFEA0 : lapresult = 0xFCC9; break;
@@ -502,7 +504,7 @@ doublelig(int olen,int* len,GUChar4* string,int level)
}
break;
case 0xFE97: /* TA inital */
- if (level > 3){
+ if (level > 13){
switch(string[si-1]){
case 0xFEA0 : lapresult = 0xFCA1; break; /* DJ init */
case 0xFEA4 : lapresult = 0xFCA2; break; /* .HA */
@@ -511,7 +513,7 @@ doublelig(int olen,int* len,GUChar4* string,int level)
}
break;
case 0xFE91: /* BA inital */
- if (level > 3){
+ if (level > 13){
switch(string[si-1]){
case 0xFEA0 : lapresult = 0xFC9C; break; /* DJ init */
case 0xFEA4 : lapresult = 0xFC9D; break; /* .HA */
@@ -520,7 +522,7 @@ doublelig(int olen,int* len,GUChar4* string,int level)
}
break;
case 0xFEE7: /* NUN inital */
- if (level > 3) {
+ if (level > 13) {
switch(string[si-1]){
case 0xFEA0 : lapresult = 0xFCD2; break; /* DJ init */
case 0xFEA4 : lapresult = 0xFCD3; break; /* .HA */
@@ -548,7 +550,7 @@ arabic_reshape(int* len,GUChar4* string,int level)
string[i] = unshape(string[i]);
}
shape(olen,len,string,level);
- if (level > 2)
+ if (level > 10)
doublelig(olen,len,string,level);
}
diff --git a/modules/arabic/langboxfont.c b/modules/arabic/langboxfont.c
new file mode 100644
index 00000000..cdfac60c
--- /dev/null
+++ b/modules/arabic/langboxfont.c
@@ -0,0 +1,255 @@
+/* pango-arabic module
+ *
+ * (C) 2000 K. Koehler <koehler@or.uni-bonn.de>
+ *
+ * This file provides a mapping unicode <- langboxfont
+ */
+
+
+#include <stdio.h>
+#include <glib.h>
+#include "pango.h"
+#include "pangox.h"
+#include "utils.h"
+#include <unicode.h>
+
+/* #define DEBUG */
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+
+int
+arabic_lboxinit(PangoFont *font,PangoXSubfont* lboxfonts)
+{
+ static char *lbox_charsets0[] = {
+ "iso8859-6.8x",
+ };
+
+ PangoXSubfont *subfonts;
+ int *subfont_charsets;
+ int n_subfonts;
+
+ n_subfonts = pango_x_list_subfonts (font,lbox_charsets0,
+ 1, &subfonts, &subfont_charsets);
+ if (n_subfonts > 0)
+ {
+ lboxfonts[0] = subfonts[0];
+ g_free (subfonts);
+ g_free (subfont_charsets);
+ }
+ else
+ {
+ g_free (subfonts);
+ g_free (subfont_charsets);
+ return 0;
+ }
+
+ return 1;
+}
+
+
+typedef struct {
+ GUChar4 unicodechar;
+ int charindex;
+} fontentry;
+
+
+static fontentry charmap [] =
+{
+ { 0xFE80,0xC1 }, /* HAMZA; handle seperately !!! */
+ { 0xFE81,0xC2 }, /* ALIF MADDA */
+ { 0xFE82,0xC2 },
+ { 0xFE83,0xC3 }, /* ALIF HAMZA */
+ { 0xFE84,0xC3 },
+ { 0xFE85,0xC4 }, /* WAW HAMZA */
+ { 0xFE86,0xC4 },
+ { 0xFE87,0xC5 }, /* ALIF IHAMZA */
+ { 0xFE88,0xC5 },
+ { 0xFE89,0x9F }, /* YA HAMZA */
+ { 0xFE8A,0xC6 },
+ { 0xFE8B,0xC0 }, /* HMAZA-'pod' */
+ { 0xFE8C,0xC0 },
+ { 0xFE8D,0xC7 }, /* ALIF */
+ { 0xFE8E,0xC7 },
+ { 0xFE8F,0xC8 }, /* BA */
+ { 0xFE90,0xC8 },
+ { 0xFE91,0xEB },
+ { 0xFE92,0xEB },
+ { 0xFE93,0xC9 }, /* TA MARBUTA */
+ { 0xFE94,0x8E },
+ { 0xFE95,0xCA }, /* TA */
+ { 0xFE96,0xCA },
+ { 0xFE97,0xEC },
+ { 0xFE98,0xEC },
+ { 0xFE99,0xCB }, /* THA */
+ { 0xFE9A,0xCB },
+ { 0xFE9B,0xED },
+ { 0xFE9C,0xED },
+ { 0xFE9D,0xCC }, /* DJIM */
+ { 0xFE9E,0xCC },
+ { 0xFE9F,0xEE },
+ { 0xFEA0,0xEE },
+ { 0xFEA1,0xCD }, /* .HA */
+ { 0xFEA2,0xCD },
+ { 0xFEA3,0xEF },
+ { 0xFEA4,0xEF },
+ { 0xFEA5,0xCE }, /* CHA */
+ { 0xFEA6,0xCE },
+ { 0xFEA7,0xF0 },
+ { 0xFEA8,0xF0 },
+ { 0xFEA9,0xCF }, /* DAL */
+ { 0xFEAA,0xCF },
+ { 0xFEAB,0xD0 }, /* THAL */
+ { 0xFEAC,0xD0 },
+ { 0xFEAD,0xD1 }, /* RA */
+ { 0xFEAE,0xD1 },
+ { 0xFEAF,0xD2 }, /* ZAY */
+ { 0xFEB0,0xD2 },
+ { 0xFEB1,0xD3 }, /* SIN */
+ { 0xFEB2,0x8F },
+ { 0xFEB3,0xF1 },
+ { 0xFEB4,0xF1 },
+ { 0xFEB5,0xD4 }, /* SHIN */
+ { 0xFEB2,0x90 },
+ { 0xFEB3,0xF2 },
+ { 0xFEB4,0xF2 },
+ { 0xFEB9,0xD5 }, /* SAAD */
+ { 0xFEBA,0x91 },
+ { 0xFEBB,0xF3 },
+ { 0xFEBC,0xF3 },
+ { 0xFEBD,0xD6 }, /* DAAD */
+ { 0xFEBE,0x92 },
+ { 0xFEBF,0xF4 },
+ { 0xFEC0,0xF4 },
+ { 0xFEC1,0xD7 }, /* .TA */
+ { 0xFEC2,0xD7 },
+ { 0xFEC3,0x93 },
+ { 0xFEC4,0x93 },
+ { 0xFEC5,0xD8 }, /* .ZA */
+ { 0xFEC6,0xD8 },
+ { 0xFEC7,0x94 },
+ { 0xFEC8,0x94 },
+ { 0xFEC9,0xD9 }, /* AIN */
+ { 0xFECA,0x96 },
+ { 0xFECB,0xF5 },
+ { 0xFECC,0x95 },
+ { 0xFECD,0xDA }, /* RAIN */
+ { 0xFECE,0x98 },
+ { 0xFECF,0xF6 },
+ { 0xFED0,0x97 },
+ { 0xFED1,0xE1 }, /* FA */
+ { 0xFED2,0xE1 },
+ { 0xFED3,0xF7 },
+ { 0xFED4,0x99 },
+ { 0xFED5,0xE2 }, /* QAF */
+ { 0xFED6,0xE2 },
+ { 0xFED7,0xF8 },
+ { 0xFEB8,0x9A },
+ { 0xFED9,0xE3 }, /* KAF */
+ { 0xFEDA,0xE3 },
+ { 0xFEDB,0xF9 },
+ { 0xFEDC,0x9B },
+ { 0xFEDD,0xE4 }, /* LAM */
+ { 0xFEDE,0xE4 },
+ { 0xFEDF,0xFA },
+ { 0xFEE0,0xA6 },
+ { 0xFEE1,0xE5 }, /* MIM */
+ { 0xFEE2,0xE5 },
+ { 0xFEE3,0xFB },
+ { 0xFEE4,0xFB },
+ { 0xFEE5,0xE6 }, /* NUN */
+ { 0xFEE6,0xE6 },
+ { 0xFEE7,0xFC },
+ { 0xFEE8,0xFC },
+ { 0xFEE9,0xE7 }, /* HA */
+ { 0xFEEA,0x9D },
+ { 0xFEEB,0xFD },
+ { 0xFEEC,0x9C },
+ { 0xFEED,0xE8 }, /* WAW */
+ { 0xFEEE,0xE8 },
+ { 0xFEEF,0x8D }, /* ALIF MAQSORA */
+ { 0xFEF0,0xE9 },
+ { 0xFEF1,0x9E }, /* YA */
+ { 0xFEF2,0xEA },
+ { 0xFEF3,0xFE },
+ { 0xFEF4,0xFE }
+};
+
+void
+arabic_lbox_recode(PangoXSubfont* subfont,int* glyph,int* glyph2,
+ PangoXSubfont* lboxfonts)
+{
+ int letter=*glyph;
+ if ((letter >= 0x660)&&(letter <= 0x669)) /* indic numeral */
+ {
+ *subfont = lboxfonts[0];
+ *glyph = letter - 0x660 + 0xB0;
+ }
+ else if ((letter >= 0xFE80)&&(letter <= 0xFEF4))
+ {
+#ifdef DEBUG
+ if (charmap[letter-0xFE80].unicodechar != letter)
+ {
+ fprintf(stderr,"[ar] lboxfont charmap table defect "
+ "%x comes out as %x ",
+ letter,charmap[letter-0xFE80].unicodechar);
+ }
+#endif
+ *subfont = lboxfonts[0];
+ *glyph = charmap[letter-0xFE80].charindex;
+ }
+ else if ((letter >= 0x64B)&&(letter <= 0x652))
+ { /* a vowel */
+ *subfont = lboxfonts[0];
+ *glyph = letter - 0x64B + 0xA8;
+ }
+ else if ((letter >= 0xFEF5)&&(letter <= 0xFEFC))
+ { /* Lam-Alif. Langbox solved the problem in their own way ... */
+ *subfont = lboxfonts[0];
+#ifdef DEBUG
+ fprintf(stderr,"[ar] lbox-recoding chars %x",
+ letter);
+#endif
+ if (!(letter % 2))
+ {
+ *glyph = 0xA6;
+ }
+ else
+ {
+ *glyph = 0xA5;
+ }
+ switch (letter)
+ {
+ case 0xFEF5 :
+ case 0xFEF6 : *glyph2 = 0xA2; break; /* Lam-Alif Madda */
+ case 0xFEF7 :
+ case 0xFEF8 : *glyph2 = 0xA3; break; /* Lam-Alif Hamza */
+ case 0xFEF9 :
+ case 0xFEFA : *glyph2 = 0xA4; break; /* Lam-Alif iHamza */
+ case 0xFEFB :
+ case 0xFEFC : *glyph2 = 0xA1; break; /* Lam-Alif */
+ }
+ }
+ else if (letter == 0x621)
+ {
+ *subfont = lboxfonts[0];
+ *glyph = charmap[0].charindex;
+ }
+ else if (letter < 0xB0 )
+ {
+ *subfont = lboxfonts[0];
+ *glyph = letter;
+ }
+ else
+ {
+ *subfont = lboxfonts[0];
+ *glyph = 0x20; /* we don't have this thing -- use a space */
+ /* This has to be something that does not print anything !! */
+ }
+}
+
+
+
+
+
diff --git a/modules/arabic/langboxfont.h b/modules/arabic/langboxfont.h
new file mode 100644
index 00000000..1c43a47c
--- /dev/null
+++ b/modules/arabic/langboxfont.h
@@ -0,0 +1,28 @@
+/* pango-arabic module
+ *
+ * (C) 2000 K. Koehler <koehler@or.uni-bonn.de>
+ *
+ * This file provides a mapping unicode <- langboxfont
+ */
+#ifndef __lboxfont_h_
+#define __lboxfont_h_
+#include "pango.h"
+#include "pangox.h"
+
+/*
+ * lboxfont must point to valid memory for this to work.
+ */
+int
+arabic_lboxinit(PangoFont *font,PangoXSubfont* lboxfonts);
+/* a return value of 0 means this has failed */
+
+
+/* glyph2 is the next glyph in line; if there is none, put in NULL
+ */
+void
+arabic_lbox_recode(PangoXSubfont* subfont,int* glyph,int* glyph2,
+ PangoXSubfont* lboxfonts);
+
+
+#endif
+