Diff for /Amaya/amaya/MathMLbuilder.c between versions 1.142 and 1.143

version 1.142, 2002/01/09 12:03:46 version 1.143, 2002/01/14 17:06:22
Line 207  void MapMathMLAttributeValue (char *Attr Line 207  void MapMathMLAttributeValue (char *Attr
    Search that entity in the entity table and return the corresponding value.     Search that entity in the entity table and return the corresponding value.
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 void MapMathMLEntity (char *entityName, char *entityValue,  void MapMathMLEntity (char *entityName, char *entityValue,
                       char *alphabet)                        char *script)
 {  {
    int  i;     int  i;
   ThotBool       found;    ThotBool       found;
Line 222  void MapMathMLEntity (char *entityName, Line 222  void MapMathMLEntity (char *entityName,
       i--;        i--;
       entityValue[0] = (unsigned char) pMathEntityTable[i].charCode;        entityValue[0] = (unsigned char) pMathEntityTable[i].charCode;
       entityValue[1] = EOS;        entityValue[1] = EOS;
       *alphabet = 'G';        *script = 'G';
       /* *alphabet = pMathEntityTable[i].charAlphabet;*/        /* *script = pMathEntityTable[i].charScript;*/
     }      }
   else    else
     {      {
       entityValue[0] = EOS;        entityValue[0] = EOS;
       *alphabet = EOS;        *script = EOS;
     }      }
 }  }
   
Line 654  void SetSingleIntHorizStretchAttr (Eleme Line 654  void SetSingleIntHorizStretchAttr (Eleme
   AttributeType attrType;    AttributeType attrType;
   Language      lang;    Language      lang;
   CHAR_T        text[2];    CHAR_T        text[2];
   char          alphabet;    char          script;
   unsigned char c;    unsigned char c;
   int           len;    int           len;
   
Line 701  void SetSingleIntHorizStretchAttr (Eleme Line 701  void SetSingleIntHorizStretchAttr (Eleme
                  /* get that character */                   /* get that character */
                  len = 2;                   len = 2;
                  TtaGiveBufferContent (textEl, text, len, &lang);                   TtaGiveBufferContent (textEl, text, len, &lang);
                  alphabet = TtaGetAlphabet (lang);                   script = TtaGetScript (lang);
                  if (alphabet == 'L')                   if (script == 'L')
                     {                      {
                     if (text[0] == '-' || text[0] == '_' ||                      if (text[0] == '-' || text[0] == '_' ||
                         text[0] == 175)                          text[0] == 175)
                       /* a horizontal line in the middle of the box */                        /* a horizontal line in the middle of the box */
                       c = 'h';                         c = 'h'; 
                     }                      }
                  else if (alphabet == 'G')                   else if (script == 'G')
                     /* a single Symbol character */                      /* a single Symbol character */
                     {                      {
                     if (text[0] == 172)                      if (text[0] == 172)
Line 786  void SetIntVertStretchAttr (Element el, Line 786  void SetIntVertStretchAttr (Element el,
   AttributeType attrType;    AttributeType attrType;
   SSchema       MathMLSSchema;    SSchema       MathMLSSchema;
   Language      lang;    Language      lang;
   char          alphabet;    char          script;
 #define buflen 50  #define buflen 50
   CHAR_T        text[buflen];    CHAR_T        text[buflen];
   unsigned char c;    unsigned char c;
Line 873  void SetIntVertStretchAttr (Element el, Line 873  void SetIntVertStretchAttr (Element el,
                   len++;                    len++;
                   TtaGiveBufferContent (textEl, text, len, &lang);                    TtaGiveBufferContent (textEl, text, len, &lang);
                   len --;                    len --;
                   alphabet = TtaGetAlphabet (lang);                    script = TtaGetScript (lang);
                   if (alphabet == 'G')                    if (script == 'G')
                     /* Adobe Symbol character set */                      /* Adobe Symbol character set */
                     {                      {
                     integral = TRUE;                      integral = TRUE;
Line 942  void SetIntVertStretchAttr (Element el, Line 942  void SetIntVertStretchAttr (Element el,
                                         len++;                                          len++;
                                         TtaGiveBufferContent (textEl, text,                                          TtaGiveBufferContent (textEl, text,
                                                               len, &lang);                                                                 len, &lang); 
                                         alphabet = TtaGetAlphabet (lang);                                          script = TtaGetScript (lang);
                                         if (alphabet != 'G')                                          if (script != 'G')
                                           /* not the right alphabet for an                                            /* not the right script for an
                                              integral*/                                               integral*/
                                           textEl = NULL;                                            textEl = NULL;
                                         else                                          else
Line 1491  void SetIntAddSpaceAttr (Element el, Doc Line 1491  void SetIntAddSpaceAttr (Element el, Doc
 #define BUFLEN 10  #define BUFLEN 10
   unsigned char         text[BUFLEN];    unsigned char         text[BUFLEN];
   Language      lang;    Language      lang;
   char          alphabet;    char          script;
   
   /* get the content of the mo element */    /* get the content of the mo element */
   textEl = TtaGetFirstChild (el);    textEl = TtaGetFirstChild (el);
Line 1542  void SetIntAddSpaceAttr (Element el, Doc Line 1542  void SetIntAddSpaceAttr (Element el, Doc
           {            {
             len = BUFLEN;              len = BUFLEN;
             TtaGiveTextContent (textEl, text, &len, &lang);              TtaGiveTextContent (textEl, text, &len, &lang);
             alphabet = TtaGetAlphabet (lang);              script = TtaGetScript (lang);
             if (len == 1)              if (len == 1)
               {                {
                /* the mo element contains a single character */                 /* the mo element contains a single character */
                if (alphabet == 'L')                 if (script == 'L')
                   /* ISO-Latin 1 character */                    /* ISO-Latin 1 character */
                   {                    {
                   if (text[0] == '-')                    if (text[0] == '-')
Line 1601  void SetIntAddSpaceAttr (Element el, Doc Line 1601  void SetIntAddSpaceAttr (Element el, Doc
                            (int)text[0] == 160)    /* em space */                             (int)text[0] == 160)    /* em space */
                      val = MathML_ATTR_IntAddSpace_VAL_nospace;                       val = MathML_ATTR_IntAddSpace_VAL_nospace;
                   }                    }
                else if (alphabet == 'G')                 else if (script == 'G')
                  {                   {
                    /* Symbol character set */                     /* Symbol character set */
                    if ((int)text[0] == 163 || /* less or equal */                     if ((int)text[0] == 163 || /* less or equal */
Line 1678  void      CheckFence (Element el, Docume Line 1678  void      CheckFence (Element el, Docume
    PresentationValue   pval;     PresentationValue   pval;
    PresentationContext ctxt;     PresentationContext ctxt;
    CHAR_T              text[2];     CHAR_T              text[2];
    char                alphabet;     char                script;
    unsigned char       c;     unsigned char       c;
    int                 len, val;     int                 len, val;
   
Line 1698  void      CheckFence (Element el, Docume Line 1698  void      CheckFence (Element el, Docume
            {             {
            len = 2;             len = 2;
            TtaGiveBufferContent (content, text, len, &lang);             TtaGiveBufferContent (content, text, len, &lang);
            alphabet = TtaGetAlphabet (lang);             script = TtaGetScript (lang);
            if ((alphabet == 'G') &&             if ((script == 'G') &&
                (text[0] == 229 || text[0] == 213))  /* Sigma,  Pi */                 (text[0] == 229 || text[0] == 213))  /* Sigma,  Pi */
              /* it's a large operator */               /* it's a large operator */
              {               {
Line 1715  void      CheckFence (Element el, Docume Line 1715  void      CheckFence (Element el, Docume
            else if (ChildOfMRowOrInferred (el))             else if (ChildOfMRowOrInferred (el))
              /* the MO element is a child of a MROW element */               /* the MO element is a child of a MROW element */
               {                {
               if (((alphabet == 'L') &&                if (((script == 'L') &&
                    (text[0] == '(' || text[0] == ')' ||                     (text[0] == '(' || text[0] == ')' ||
                     text[0] == '[' || text[0] == ']' ||                      text[0] == '[' || text[0] == ']' ||
                     text[0] == '{' || text[0] == '}' ||                      text[0] == '{' || text[0] == '}' ||
                     text[0] == '|'))  ||                      text[0] == '|'))  ||
                   ((alphabet == 'G') &&                    ((script == 'G') &&
                    (text[0] == 225 || text[0] == 241)))                     (text[0] == 225 || text[0] == 241)))
                 /* it's a stretchable parenthesis or equivalent */                  /* it's a stretchable parenthesis or equivalent */
                 {                  {
Line 1749  void      CheckFence (Element el, Docume Line 1749  void      CheckFence (Element el, Docume
                   }                    }
                 /* create a new content for the MF element */                  /* create a new content for the MF element */
                 elType.ElTypeNum = MathML_EL_SYMBOL_UNIT;                  elType.ElTypeNum = MathML_EL_SYMBOL_UNIT;
                 if (alphabet == 'G' && text[0] == 241)                  if (script == 'G' && text[0] == 241)
                   c = '>';    /* RightAngleBracket */                    c = '>';    /* RightAngleBracket */
                 else if (alphabet == 'G' && text[0] == 225)                  else if (script == 'G' && text[0] == 225)
                   c = '<';    /* LeftAngleBracket */                    c = '<';    /* LeftAngleBracket */
                 else                  else
                   c = (char) text[0];                    c = (char) text[0];
Line 1825  void CreateFencedSeparators (Element fen Line 1825  void CreateFencedSeparators (Element fen
            sepValue[0] = text[sep];             sepValue[0] = text[sep];
            sepValue[1] = SPACE;             sepValue[1] = SPACE;
            sepValue[2] = EOS;             sepValue[2] = EOS;
            lang = TtaGetLanguageIdFromAlphabet('L');             lang = TtaGetLanguageIdFromScript('L');
            TtaSetTextContent (leaf, sepValue, lang, doc);             TtaSetTextContent (leaf, sepValue, lang, doc);
            /* is there a following non-space character in separators? */             /* is there a following non-space character in separators? */
            i = sep + 1;             i = sep + 1;

Removed from v.1.142  
changed lines
  Added in v.1.143


Webmaster