Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Enumerations | Functions | Variables
dvng-x.c File Reference
#include <glib.h>
#include <string.h>
#include "pango-engine.h"
#include "pango-coverage.h"

Go to the source code of this file.

Classes

struct  DvngGlyphEntry
struct  _DvngFontInfo

Defines

#define G_N_ELEMENTS(arr)   (sizeof (arr) / sizeof ((arr)[0]))
#define MAX_CLUSTER_CHRS   256
#define MAX_GLYPHS   256
#define GLYPH_COMBINING   256
#define _NP   1L
#define _UP   (1L<<1)
#define _IV   (1L<<2)
#define _CN   (1L<<3)
#define _CK   (1L<<4)
#define _RC   (1L<<5)
#define _NM   (1L<<6)
#define _IM   (1L<<7)
#define _HL   (1L<<8)
#define _NK   (1L<<9)
#define _VD   (1L<<10)
#define _HD   (1L<<11)
#define _II_M   (1L<<12)
#define _EY_M   (1L<<13)
#define _AI_M   (1L<<14)
#define _OW1_M   (1L<<15)
#define _OW2_M   (1L<<16)
#define _MS   (1L<<17)
#define _AYE_M   (1L<<18)
#define _EE_M   (1L<<19)
#define _AWE_M   (1L<<20)
#define _O_M   (1L<<21)
#define _RM   (_II_M|_EY_M|_AI_M|_OW1_M|_OW2_M|_AYE_M|_EE_M|_AWE_M|_O_M)
#define __ND   0
#define __UP   1
#define __NP   2
#define __IV   3
#define __CN   4
#define __CK   5
#define __RC   6
#define __NM   7
#define __RM   8
#define __IM   9
#define __HL   10
#define __NK   11
#define __VD   12
#define __HD   13
#define St0   0
#define St1   1
#define St2   2
#define St3   3
#define St4   4
#define St5   5
#define St6   6
#define St7   7
#define St8   8
#define St9   9
#define St10   10
#define St11   11
#define St12   12
#define St13   13
#define St14   14
#define St15   15
#define St16   16
#define St17   17
#define St18   18
#define St19   19
#define St20   20
#define _ND   0
#define _NC   1
#define _UC   (1<<1)
#define _BC   (1<<2)
#define _SC   (1<<3)
#define _AV   (1<<4)
#define _BV   (1<<5)
#define _TN   (1<<6)
#define _AD   (1<<7)
#define _BD   (1<<8)
#define _AM   (1<<9)
#define MAP_SIZE   243
#define MAX_STATE   21
#define MAX_DEVA_TYPE   14
#define MAX_CORE_CONS   6
#define SCRIPT_ENGINE_NAME   "DvngScriptEngineX"
#define PANGO_RENDER_TYPE_X   "PangoliteRenderX"
#define ucs2dvng(ch)   (gunichar2)((gunichar2)(ch) - 0x0900)
#define PANGO_MOZ_MAKE_GLYPH(index)   ((guint32)0 | (index))
#define IsDvngCharCls(ch, mask)   (DvngChrClsTbl[ucs2dvng((ch))] & (mask))
#define IsComposible(ch1, ch2)   (DvngComposeTbl[DvngChrTypeTbl[ucs2dvng((ch1))]][DvngChrTypeTbl[ucs2dvng((ch2))]])
#define GetDvngRuleCt(ch)   (DvngRuleTbl[ucs2dvng((ch))])
#define IsKern(gid)   ((gid >= 0xF830 && gid <= 0xF83E) ? TRUE : FALSE)
#define IsMatraAtStem(gid)
#define SetClusterState(st, ch)   DvngStateTbl[(st)][DvngChrTypeTbl[ucs2dvng((ch))]]
#define MAP_SIZE   243
#define MODULE_ENTRY(func)   func

Typedefs

typedef guint16 PangoliteXSubfont
typedef struct _DvngFontInfo
typedef long DvngCls
typedef int StateType

Enumerations

enum  DvngFontType { DVNG_FONT_NONE, DVNG_FONT_SUN }

Functions

static DvngFontInfo * get_font_info (const char *fontCharset)
static void add_glyph (PangoliteGlyphString *glyphs, gint clusterStart, PangoliteGlyph glyph, gint combining)
static void GetBaseConsGlyphs (gunichar2 *cluster, gint numCoreCons, PangoliteGlyph *glyphList, gint *nGlyphs)
static gint get_adjusted_glyphs_list (DvngFontInfo *fontInfo, gunichar2 *cluster, gint nChars, PangoliteGlyph *gLst, StateType *DvngClusterState)
static gint get_glyphs_list (DvngFontInfo *fontInfo, gunichar2 *cluster, gint numChars, PangoliteGlyph *glyphLst, StateType *clustState)
static void add_cluster (DvngFontInfo *fontInfo, PangoliteGlyphString *glyphs, gint clusterBeg, gunichar2 *cluster, gint numChars, StateType *clustState)
static const gunichar2get_next_cluster (const gunichar2 *text, gint length, gunichar2 *cluster, gint *numChars, StateType *clustState)
static void dvng_engine_shape (const char *fontCharset, const gunichar2 *text, gint length, PangoliteAnalysis *analysis, PangoliteGlyphString *glyphs)
static PangoliteCoverage * dvng_engine_get_coverage (const char *fontCharset, const char *lang)
static PangoliteEngine * dvng_engine_x_new ()
void MODULE_ENTRY() script_engine_list (PangoliteEngineInfo **engines, gint *n_engines)
PangoliteEngine *MODULE_ENTRY() script_engine_load (const char *id)
void MODULE_ENTRY() script_engine_unload (PangoliteEngine *engine)

Variables

static PangoliteEngineRange dvng_ranges []
static PangoliteEngineInfo script_engines []
static const DvngCls DvngChrClsTbl [128]
static const gint DvngChrTypeTbl [128]
static const gint DvngComposeTbl [14][14]
StateType DvngStateTbl [MAX_STATE][MAX_DEVA_TYPE]
int DvngRuleTbl [128]
static const DvngGlyphEntry sunGlyphTbl [MAP_SIZE]

Class Documentation

struct DvngGlyphEntry

Definition at line 241 of file dvng-x.c.

Class Members
const gunichar ISCII
const unsigned short ISFOC
struct _DvngFontInfo

Definition at line 248 of file dvng-x.c.

Class Members
PangoliteXSubfont subfont
DvngFontType type

Define Documentation

#define __CK   5

Definition at line 148 of file dvng-x.c.

#define __CN   4

Definition at line 147 of file dvng-x.c.

#define __HD   13

Definition at line 156 of file dvng-x.c.

#define __HL   10

Definition at line 153 of file dvng-x.c.

#define __IM   9

Definition at line 152 of file dvng-x.c.

#define __IV   3

Definition at line 146 of file dvng-x.c.

#define __ND   0

Definition at line 139 of file dvng-x.c.

#define __NK   11

Definition at line 154 of file dvng-x.c.

#define __NM   7

Definition at line 150 of file dvng-x.c.

#define __NP   2

Definition at line 145 of file dvng-x.c.

#define __RC   6

Definition at line 149 of file dvng-x.c.

#define __RM   8

Definition at line 151 of file dvng-x.c.

#define __UP   1

Definition at line 144 of file dvng-x.c.

#define __VD   12

Definition at line 155 of file dvng-x.c.

#define _AD   (1<<7)

Definition at line 191 of file dvng-x.c.

#define _AI_M   (1L<<14)

Definition at line 128 of file dvng-x.c.

#define _AM   (1<<9)

Definition at line 193 of file dvng-x.c.

#define _AV   (1<<4)

Definition at line 188 of file dvng-x.c.

#define _AWE_M   (1L<<20)

Definition at line 134 of file dvng-x.c.

#define _AYE_M   (1L<<18)

Definition at line 132 of file dvng-x.c.

#define _BC   (1<<2)

Definition at line 186 of file dvng-x.c.

#define _BD   (1<<8)

Definition at line 192 of file dvng-x.c.

#define _BV   (1<<5)

Definition at line 189 of file dvng-x.c.

#define _CK   (1L<<4)

Definition at line 118 of file dvng-x.c.

#define _CN   (1L<<3)

Definition at line 117 of file dvng-x.c.

#define _EE_M   (1L<<19)

Definition at line 133 of file dvng-x.c.

#define _EY_M   (1L<<13)

Definition at line 127 of file dvng-x.c.

#define _HD   (1L<<11)

Definition at line 125 of file dvng-x.c.

#define _HL   (1L<<8)

Definition at line 122 of file dvng-x.c.

#define _II_M   (1L<<12)

Definition at line 126 of file dvng-x.c.

#define _IM   (1L<<7)

Definition at line 121 of file dvng-x.c.

#define _IV   (1L<<2)

Definition at line 116 of file dvng-x.c.

#define _MS   (1L<<17)

Definition at line 131 of file dvng-x.c.

#define _NC   1

Definition at line 184 of file dvng-x.c.

#define _ND   0

Definition at line 183 of file dvng-x.c.

#define _NK   (1L<<9)

Definition at line 123 of file dvng-x.c.

#define _NM   (1L<<6)

Definition at line 120 of file dvng-x.c.

#define _NP   1L

Definition at line 114 of file dvng-x.c.

#define _O_M   (1L<<21)

Definition at line 135 of file dvng-x.c.

#define _OW1_M   (1L<<15)

Definition at line 129 of file dvng-x.c.

#define _OW2_M   (1L<<16)

Definition at line 130 of file dvng-x.c.

#define _RC   (1L<<5)

Definition at line 119 of file dvng-x.c.

Definition at line 136 of file dvng-x.c.

#define _SC   (1<<3)

Definition at line 187 of file dvng-x.c.

#define _TN   (1<<6)

Definition at line 190 of file dvng-x.c.

#define _UC   (1<<1)

Definition at line 185 of file dvng-x.c.

#define _UP   (1L<<1)

Definition at line 115 of file dvng-x.c.

#define _VD   (1L<<10)

Definition at line 124 of file dvng-x.c.

#define G_N_ELEMENTS (   arr)    (sizeof (arr) / sizeof ((arr)[0]))

Definition at line 48 of file dvng-x.c.

Definition at line 421 of file dvng-x.c.

Definition at line 51 of file dvng-x.c.

#define IsComposible (   ch1,
  ch2 
)    (DvngComposeTbl[DvngChrTypeTbl[ucs2dvng((ch1))]][DvngChrTypeTbl[ucs2dvng((ch2))]])

Definition at line 419 of file dvng-x.c.

#define IsDvngCharCls (   ch,
  mask 
)    (DvngChrClsTbl[ucs2dvng((ch))] & (mask))

Definition at line 417 of file dvng-x.c.

#define IsKern (   gid)    ((gid >= 0xF830 && gid <= 0xF83E) ? TRUE : FALSE)

Definition at line 423 of file dvng-x.c.

#define IsMatraAtStem (   gid)
Value:
(((gid >= 0xF811 && gid <= 0xF813) || \
                             (gid >= 0xF81E && gid <= 0xF82F) || \
                             (gid >= 0x0962 && gid <= 0x0963) || \
                             (gid >= 0x0941 && gid <= 0x0948) || \
                             (gid == 0x093C) || (gid == 0x094D)) ? TRUE : FALSE)

Definition at line 425 of file dvng-x.c.

#define MAP_SIZE   243

Definition at line 433 of file dvng-x.c.

#define MAP_SIZE   243

Definition at line 433 of file dvng-x.c.

Definition at line 49 of file dvng-x.c.

Definition at line 198 of file dvng-x.c.

Definition at line 197 of file dvng-x.c.

#define MAX_GLYPHS   256

Definition at line 50 of file dvng-x.c.

#define MAX_STATE   21

Definition at line 196 of file dvng-x.c.

#define MODULE_ENTRY (   func)    func

Definition at line 1475 of file dvng-x.c.

#define PANGO_MOZ_MAKE_GLYPH (   index)    ((guint32)0 | (index))

Definition at line 206 of file dvng-x.c.

#define PANGO_RENDER_TYPE_X   "PangoliteRenderX"

Definition at line 201 of file dvng-x.c.

#define SCRIPT_ENGINE_NAME   "DvngScriptEngineX"

Definition at line 200 of file dvng-x.c.

Definition at line 431 of file dvng-x.c.

#define St0   0

Definition at line 161 of file dvng-x.c.

#define St1   1

Definition at line 162 of file dvng-x.c.

#define St10   10

Definition at line 171 of file dvng-x.c.

#define St11   11

Definition at line 172 of file dvng-x.c.

#define St12   12

Definition at line 173 of file dvng-x.c.

#define St13   13

Definition at line 174 of file dvng-x.c.

#define St14   14

Definition at line 175 of file dvng-x.c.

#define St15   15

Definition at line 176 of file dvng-x.c.

#define St16   16

Definition at line 177 of file dvng-x.c.

#define St17   17

Definition at line 178 of file dvng-x.c.

#define St18   18

Definition at line 179 of file dvng-x.c.

#define St19   19

Definition at line 180 of file dvng-x.c.

#define St2   2

Definition at line 163 of file dvng-x.c.

#define St20   20

Definition at line 181 of file dvng-x.c.

#define St3   3

Definition at line 164 of file dvng-x.c.

#define St4   4

Definition at line 165 of file dvng-x.c.

#define St5   5

Definition at line 166 of file dvng-x.c.

#define St6   6

Definition at line 167 of file dvng-x.c.

#define St7   7

Definition at line 168 of file dvng-x.c.

#define St8   8

Definition at line 169 of file dvng-x.c.

#define St9   9

Definition at line 170 of file dvng-x.c.

#define ucs2dvng (   ch)    (gunichar2)((gunichar2)(ch) - 0x0900)

Definition at line 203 of file dvng-x.c.


Typedef Documentation

typedef struct _DvngFontInfo

Definition at line 230 of file dvng-x.c.

typedef long DvngCls

Definition at line 254 of file dvng-x.c.

typedef guint16 PangoliteXSubfont

Definition at line 205 of file dvng-x.c.

typedef int StateType

Definition at line 255 of file dvng-x.c.


Enumeration Type Documentation

Enumerator:
DVNG_FONT_NONE 
DVNG_FONT_SUN 

Definition at line 234 of file dvng-x.c.


Function Documentation

static void add_cluster ( DvngFontInfo *  fontInfo,
PangoliteGlyphString *  glyphs,
gint  clusterBeg,
gunichar2 cluster,
gint  numChars,
StateType clustState 
) [static]

Definition at line 1351 of file dvng-x.c.

{
  PangoliteGlyph glyphsList[MAX_GLYPHS];
  gint           i, numGlyphs, ClusterStart=0;
  
  numGlyphs = get_glyphs_list(fontInfo, cluster, numChars, glyphsList, clustState);
  for (i = 0; i < numGlyphs; i++) {

    ClusterStart = (gint)GLYPH_COMBINING;
    if (i == 0)
      ClusterStart = numChars;
    add_glyph(glyphs, clusterBeg, glyphsList[i], ClusterStart);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_glyph ( PangoliteGlyphString *  glyphs,
gint  clusterStart,
PangoliteGlyph  glyph,
gint  combining 
) [static]

Definition at line 981 of file dvng-x.c.

{
  gint index = glyphs->num_glyphs;

  if ((clusterStart == 0) && (index != 0))
    clusterStart++;

  pangolite_glyph_string_set_size (glyphs, index + 1);  
  glyphs->glyphs[index].glyph = glyph;
  glyphs->glyphs[index].is_cluster_start = combining;
  glyphs->log_clusters[index] = clusterStart;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PangoliteCoverage* dvng_engine_get_coverage ( const char *  fontCharset,
const char *  lang 
) [static]

Definition at line 1426 of file dvng-x.c.

{
  PangoliteCoverage *result = pangolite_coverage_new ();  
  DvngFontInfo  *fontInfo = get_font_info (fontCharset);
  
  if (fontInfo->type != DVNG_FONT_NONE) {
    gunichar2 wc;
 
    for (wc = 0x901; wc <= 0x903; wc++)
      pangolite_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
    for (wc = 0x905; wc <= 0x939; wc++)
      pangolite_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
    for (wc = 0x93c; wc <= 0x94d; wc++)
      pangolite_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
    for (wc = 0x950; wc <= 0x954; wc++)
      pangolite_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
    for (wc = 0x958; wc <= 0x970; wc++)
      pangolite_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
    /*    pangolite_coverage_set (result, ZWJ, PANGO_COVERAGE_EXACT); */
  }
  
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void dvng_engine_shape ( const char *  fontCharset,
const gunichar2 text,
gint  length,
PangoliteAnalysis *  analysis,
PangoliteGlyphString *  glyphs 
) [static]

Definition at line 1402 of file dvng-x.c.

{
  DvngFontInfo    *fontInfo;
  const gunichar2 *p, *log_cluster;
  gunichar2       cluster[MAX_CLUSTER_CHRS];
  gint            num_chrs;
  StateType       aSt = St0;

  fontInfo = get_font_info(fontCharset);

  p = text;
  while (p < text + length) {
    log_cluster = p;
    aSt = St0;
    p = get_next_cluster(p, text + length - p, cluster, &num_chrs, &aSt);
    add_cluster(fontInfo, glyphs, log_cluster-text, cluster, num_chrs, &aSt);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PangoliteEngine* dvng_engine_x_new ( ) [static]

Definition at line 1452 of file dvng-x.c.

{
  PangoliteEngineShape *result;
  
  result = g_new (PangoliteEngineShape, 1);
  result->engine.id = SCRIPT_ENGINE_NAME;
  result->engine.type = PANGO_ENGINE_TYPE_SHAPE;
  result->engine.length = sizeof (result);
  result->script_shape = dvng_engine_shape;
  result->get_coverage = dvng_engine_get_coverage;
  return (PangoliteEngine *)result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint get_adjusted_glyphs_list ( DvngFontInfo *  fontInfo,
gunichar2 cluster,
gint  nChars,
PangoliteGlyph gLst,
StateType DvngClusterState 
) [static]

Definition at line 1062 of file dvng-x.c.

{
  int i, k, len;
  gint      nGlyphs = 0;
  gunichar2 dummy;
  
  switch (*DvngClusterState) {
  case St1:
    if (IsDvngCharCls(cluster[0], _IM)) {
      GetBaseConsGlyphs(cluster, nChars, gLst, &nGlyphs);
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF7C0);
    }
    else {
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF7C0);
      GetBaseConsGlyphs(cluster, nChars, gLst, &nGlyphs);
    }
    break;

    case St2:
    case St3:
    case St4:
    case St5:
    case St6:
      GetBaseConsGlyphs(cluster, nChars, gLst, &nGlyphs);
      break;
      
    case St7:
      if (IsDvngCharCls(cluster[nChars - 1], _UP)) {

        if (IsDvngCharCls(cluster[nChars - 2], _RM))
          GetBaseConsGlyphs(cluster, nChars - 2, gLst, &nGlyphs);
        else
          GetBaseConsGlyphs(cluster, nChars, gLst, &nGlyphs);

        if (IsDvngCharCls(cluster[nChars - 2], _RM)) {

          if (IsDvngCharCls(cluster[nChars - 2], _II_M))
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF81B);

          else if (IsDvngCharCls(cluster[nChars - 2], _AYE_M)) {
            dummy = gLst[nGlyphs - 1];
            gLst[nGlyphs - 1] = PANGO_MOZ_MAKE_GLYPH(0xF82D);
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(dummy);
          }

          else if (IsDvngCharCls(cluster[nChars - 2], _EE_M))
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF824);
          
          else if (IsDvngCharCls(cluster[nChars - 2], _EY_M))
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF827);

          else if (IsDvngCharCls(cluster[nChars - 2], _AI_M))
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF82A);

          else if (IsDvngCharCls(cluster[nChars - 2], _AWE_M)) {
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x093E);
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF82D);
          }

          else if (IsDvngCharCls(cluster[nChars - 2], _O_M)) {
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x093E);
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF824);
          }

          else if (IsDvngCharCls(cluster[nChars - 2], _OW1_M)) {
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x093E);
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF827);
          }

          else if (IsDvngCharCls(cluster[nChars - 2], _OW2_M)) {
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x093E);
            gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF82A);
          }
        }
      }
      else {
        GetBaseConsGlyphs(cluster, nChars, gLst, &nGlyphs);
      }
      break;

    case St8:
      GetBaseConsGlyphs(cluster, nChars - 1, gLst, &nGlyphs);
      if (IsKern(gLst[nGlyphs - 1])) {
        dummy = gLst[nGlyphs - 1];
        gLst[nGlyphs - 1] = PANGO_MOZ_MAKE_GLYPH(cluster[nChars - 1]);
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(dummy);
      }
      else
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(cluster[nChars - 1]);
      break;
      
    case St9:
      if (IsDvngCharCls(cluster[0], _MS))
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x093F);
      else
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF817);        

      GetBaseConsGlyphs(cluster, nChars - 1, gLst, &nGlyphs);
      break;

  case St10:
    if (IsDvngCharCls(cluster[0], _MS))
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF814);
    else
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF818);

    GetBaseConsGlyphs(cluster, nChars - 2, gLst, &nGlyphs);
    break;
    
  case St11:
    GetBaseConsGlyphs(cluster, nChars, gLst, &nGlyphs);
    break;
    
  case St12:
    gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x0930);
    gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF83A);
    break;
    
  case St13:
    gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x0930);
    gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x094D);
    gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF83A);
    break;
    
  case St14:    
    GetBaseConsGlyphs(cluster+2, nChars - 2, gLst, &nGlyphs);
    if (IsKern(gLst[nGlyphs - 1])) {
      dummy = gLst[nGlyphs - 1];
      gLst[nGlyphs - 1] = PANGO_MOZ_MAKE_GLYPH(0xF812);
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(dummy);
    }
    else
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF812);
    break;
    
  case St15:    
    GetBaseConsGlyphs(cluster+2, nChars - 3, gLst, &nGlyphs);
    if (IsKern(gLst[nGlyphs - 1])) {      
      dummy = gLst[nGlyphs - 2];
      gLst[nGlyphs - 2] = PANGO_MOZ_MAKE_GLYPH(0xF812);
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x094D);
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(dummy);
    }
    else {
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF812);
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x094D);
    }
    break;
    
  case St16:
    if (IsDvngCharCls(cluster[nChars - 1], _RM))
      GetBaseConsGlyphs(cluster+2, nChars - 3, gLst, &nGlyphs);
    else
      GetBaseConsGlyphs(cluster+2, nChars - 2, gLst, &nGlyphs);

    if (IsDvngCharCls(cluster[nChars - 1], ~(_RM))){

      if (IsKern(gLst[nGlyphs - 1])) {
        dummy = gLst[nGlyphs - 1];
        gLst[nGlyphs - 1] = PANGO_MOZ_MAKE_GLYPH(0xF812);
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(dummy);
      }
      else
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF812);
    }
    else {

      if (IsDvngCharCls(cluster[nChars - 1], _II_M))
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF81C);

      else if (IsDvngCharCls(cluster[nChars - 1], _EY_M))
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF828);

      else if (IsDvngCharCls(cluster[nChars -1], _AI_M))
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF82B);

      else if (IsDvngCharCls(cluster[nChars - 1], _OW1_M)) {
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x093E);
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF828);
      }

      else if (IsDvngCharCls(cluster[nChars - 1], _OW2_M)) {
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x093E);
        gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF82B);
      }
    }
    break;
    
  case St17:
    if (IsDvngCharCls(cluster[nChars - 1], _UP)) {

      if (IsDvngCharCls(cluster[nChars - 2], _RM))
        GetBaseConsGlyphs(cluster+2, nChars - 4, gLst, &nGlyphs);
      else
        GetBaseConsGlyphs(cluster+2, nChars - 3, gLst, &nGlyphs);

      if (IsDvngCharCls(cluster[nChars - 2], ~(_RM))) {

        if (IsKern(gLst[nGlyphs - 1])) {
          dummy = gLst[nGlyphs - 1];
          gLst[nGlyphs - 1] = PANGO_MOZ_MAKE_GLYPH(0xF813);
          gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(dummy);
        }
        else
          gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF813);
      }
      else {
        if (IsDvngCharCls(cluster[nChars - 2], _II_M))
          gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF81D);

        else if (IsDvngCharCls(cluster[nChars - 2], _EY_M))
          gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF829);

        else if (IsDvngCharCls(cluster[nChars - 2], _AI_M))
          gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF82C);

        else if (IsDvngCharCls(cluster[nChars - 2], _OW1_M)) {
          gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x093E);
          gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF829);
        }
        else if (IsDvngCharCls(cluster[nChars - 2], _OW2_M)) {
          gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0x093E);
          gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF82C);
        }
      } /* ? else GetBaseConsGlyphs(); */
    break;
    
  case St18:
    GetBaseConsGlyphs(cluster-2, nChars-3, gLst, &nGlyphs);
    if (IsKern(gLst[nGlyphs - 1])) {
      dummy = gLst[nGlyphs - 1];
      gLst[nGlyphs - 1] = PANGO_MOZ_MAKE_GLYPH(0xF813);
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(dummy);
    }
    else
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF813);
    break;
    
  case St19:
    if (IsDvngCharCls(cluster[0], _MS))
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF815);
    else
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF819);

    GetBaseConsGlyphs(cluster+2, nChars-3, gLst, &nGlyphs);
    break;
    
  case St20:
    if (IsDvngCharCls(cluster[0], _MS))
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF816);
    else
      gLst[nGlyphs++] = PANGO_MOZ_MAKE_GLYPH(0xF81A);

    GetBaseConsGlyphs(cluster+2, nChars - 4, gLst, &nGlyphs);
    break;
    }
  }

  return nGlyphs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static DvngFontInfo* get_font_info ( const char *  fontCharset) [static]

Definition at line 955 of file dvng-x.c.

{
  static const char *charsets[] = {
    "sun.unicode.india-0",
  };

  static const int charset_types[] = {
    DVNG_FONT_SUN
  };
  
  DvngFontInfo *font_info = g_new(DvngFontInfo, 1);
  guint        i; 

  font_info->type = DVNG_FONT_NONE;
  for (i = 0; i < G_N_ELEMENTS(charsets); i++) {
    if (strcmp(fontCharset, charsets[i]) == 0) {    
      font_info->type = (DvngFontType)charset_types[i];
      font_info->subfont = (PangoliteXSubfont)i;
      break;
    }
  }
  
  return font_info;
}

Here is the caller graph for this function:

static gint get_glyphs_list ( DvngFontInfo *  fontInfo,
gunichar2 cluster,
gint  numChars,
PangoliteGlyph glyphLst,
StateType clustState 
) [static]

Definition at line 1328 of file dvng-x.c.

{
  PangoliteGlyph glyph;
  gint       i;

  switch (fontInfo->type) {
  case DVNG_FONT_NONE:
    for (i = 0; i < numChars; i++)
      glyphLst[i] = 0; /*pangolite_x_get_unknown_glyph(fontInfo->font);*/
    return numChars;
    
  case DVNG_FONT_SUN:
    return get_adjusted_glyphs_list(fontInfo, cluster, numChars, glyphLst, clustState);
  }
  
  return 0; /* Quiet GCC */
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const gunichar2* get_next_cluster ( const gunichar2 text,
gint  length,
gunichar2 cluster,
gint *  numChars,
StateType clustState 
) [static]

Definition at line 1372 of file dvng-x.c.

{
  const gunichar2 *p;
  gint            n_chars = 0;
  StateType       aSt = *clustState;

  p = text;
  while (p < text + length) {
    gunichar2 cur = *p;
    
    if ((n_chars == 0) ||
        ((n_chars > 0) && IsComposible(cluster[n_chars - 1], cur))) {
      cluster[n_chars++] = cur;
      aSt = SetClusterState(aSt, cur);
      p++;
    }
    else
      break;
  }
  
  *numChars = n_chars;
  *clustState = aSt;
  return p;
}

Here is the caller graph for this function:

static void GetBaseConsGlyphs ( gunichar2 cluster,
gint  numCoreCons,
PangoliteGlyph glyphList,
gint *  nGlyphs 
) [static]

Definition at line 998 of file dvng-x.c.

{
  int i, j, delta, nMin, nMaxRuleCt, ruleIdx;
  gboolean  StillMatching;
  gunichar2 temp_out;
  gint      tmpCt = *nGlyphs;

  i = 0;
  while (i < numCoreCons) {
    
    nMaxRuleCt = GetDvngRuleCt(cluster[i]);    
    while (nMaxRuleCt) {
      nMin = MIN(nMaxRuleCt, numCoreCons);      
      ruleIdx = 0;

NotFound:
      j = delta = 0;
      StillMatching = FALSE;
      while (((delta < nMin) || sunGlyphTbl[ruleIdx].ISCII[j]) &&
             (ruleIdx < MAP_SIZE) ) {
        StillMatching = TRUE;
        if ((delta < nMin) && (j < MAX_CORE_CONS) &&
            (cluster[i + delta] != sunGlyphTbl[ruleIdx].ISCII[j])) {
          ruleIdx++;
          goto NotFound;
        }
        delta++;
        j++;
      }
      
      if (StillMatching) /* Found */
        break;
      else
        nMaxRuleCt--;
    }
    
    i += nMin;
    
    /* Can't find entry in the table */
    if ((StillMatching == FALSE) || (ruleIdx >= MAP_SIZE)) {
      for (j = 0; j < numCoreCons; j++)
        glyphList[tmpCt++] = PANGO_MOZ_MAKE_GLYPH(cluster[j]);
    }
    else if (((tmpCt > 0) && IsKern(glyphList[tmpCt - 1])) &&
             IsMatraAtStem(sunGlyphTbl[ruleIdx].ISFOC[0])) {
      temp_out = glyphList[tmpCt - 1];
      
      for (j=0; sunGlyphTbl[ruleIdx].ISFOC[j]; j++)
        glyphList[tmpCt - 1] = PANGO_MOZ_MAKE_GLYPH(sunGlyphTbl[ruleIdx].ISFOC[j]);
        
      glyphList[tmpCt++] = PANGO_MOZ_MAKE_GLYPH(temp_out);
    }
    else {
      for (j=0; sunGlyphTbl[ruleIdx].ISFOC[j]; j++)
        glyphList[tmpCt++] = PANGO_MOZ_MAKE_GLYPH(sunGlyphTbl[ruleIdx].ISFOC[j]);
    }
  }
  *nGlyphs = tmpCt;
}

Here is the caller graph for this function:

void MODULE_ENTRY() script_engine_list ( PangoliteEngineInfo **  engines,
gint *  n_engines 
)

Definition at line 1481 of file dvng-x.c.

{
  *engines = script_engines;
  *n_engines = G_N_ELEMENTS (script_engines);
}
PangoliteEngine* MODULE_ENTRY() script_engine_load ( const char *  id)

Definition at line 1490 of file dvng-x.c.

{
  if (!strcmp (id, SCRIPT_ENGINE_NAME))
    return dvng_engine_x_new ();
  else
    return NULL;
}
void MODULE_ENTRY() script_engine_unload ( PangoliteEngine *  engine)

Definition at line 1499 of file dvng-x.c.

{
}

Variable Documentation

PangoliteEngineRange dvng_ranges[] [static]
Initial value:
 {
  { 0x0901, 0x0903, "*" },
  { 0x0905, 0x0939, "*" },
  { 0x093c, 0x094d, "*" },
  { 0x0950, 0x0954, "*" },
  { 0x0958, 0x0970, "*" }, 
}

Definition at line 210 of file dvng-x.c.

const DvngCls DvngChrClsTbl[128] [static]
Initial value:
 {

     _ND,     _UP,     _UP,     _NP,    _ND,     _IV,   _IV, _IV,
            _IV,     _IV,     _IV,     _IV,    _IV,     _IV,   _IV, _IV,
     _IV,     _IV,     _IV,     _IV,    _IV, _CK|_MS,   _CK, _CK,
            _CN,     _CN,     _CN,     _CN,    _CK,     _CN,   _CN,_CN|_MS,
 _CN|_MS, _CK|_MS, _CK|_MS,     _CN,    _CN,     _CN,   _CN, _CN,
            _CN,     _CN,     _CN, _CK|_MS,    _CN,     _CN,   _CN, _CN,
     _RC,     _CN,     _CN,     _CN,    _CN,     _CN,   _CN, _CN,
            _CN, _CN|_MS,     _ND,     _ND,    _NK,     _VD,   _NM, _IM,
   _II_M,     _NM,     _NM,     _NM,    _NM,  _AYE_M, _EE_M, _EY_M,
          _AI_M,  _AWE_M,    _O_M,  _OW1_M, _OW2_M,     _HL,   _ND, _ND,
     _ND,     _VD,     _VD,     _VD,    _VD,     _ND,   _ND, _ND,
            _CN,     _CN,     _CN,     _CN,    _CN,     _CN,   _CN, _CN,
     _IV,     _IV,     _NM,     _NM,    _ND,     _ND,   _HD, _HD,
            _HD,     _HD,     _HD,     _HD,    _HD,     _HD,   _HD, _HD,
     _ND,     _ND,     _ND,     _ND,    _ND,     _ND,   _ND, _ND,
            _ND,     _ND,     _ND,     _ND,    _ND,     _ND,   _ND, _ND,
}

Definition at line 260 of file dvng-x.c.

const gint DvngChrTypeTbl[128] [static]
const gint DvngComposeTbl[14][14] [static]
Initial value:
 {
  
   { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,}, 
   { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,}, 
   { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,}, 
   { 0,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,}, 
   { 0,  1,  1,  0,  0,  0,  0,  1,  1,  1,  1,  0,  0,  0,}, 
   { 0,  1,  1,  0,  0,  0,  0,  1,  1,  1,  1,  1,  0,  0,}, 
   { 0,  1,  1,  0,  0,  0,  0,  1,  1,  1,  1,  0,  0,  0,}, 
   { 0,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,}, 
   { 0,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,}, 
   { 0,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,}, 
   { 0,  0,  0,  0,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,}, 
   { 0,  1,  1,  0,  0,  0,  0,  1,  1,  1,  1,  0,  0,  0,}, 
   { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,}, 
   { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,}, 
}

Definition at line 308 of file dvng-x.c.

Initial value:
 {


  0,  1,  1,  1,  0,  1,  1,  1,
         1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  4,  4,  4,
         4,  2,  4,  1,  4,  4,  3,  3,
  3,  3,  3,  2,  4,  4,  4,  4,
         4,  1,  4,  4,  4,  4,  4,  4,
  2,  2,  2,  2,  1,  4,  4,  3,
         5,  4,  0,  0,  2,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,
         1,  1,  1,  1,  1,  3,  0,  0,
  1,  1,  1,  1,  1,  0,  0,  0,
         1,  1,  1,  1,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,
         1,  1,  1,  1,  1,  1,  1,  1,
  1,  0,  0,  0,  0,  0,  0,  0,
         0,  0,  0,  0,  0,  0,  0,  0,
}

Definition at line 395 of file dvng-x.c.

Definition at line 326 of file dvng-x.c.

PangoliteEngineInfo script_engines[] [static]
Initial value:

Definition at line 218 of file dvng-x.c.

Definition at line 438 of file dvng-x.c.