The R Project SVN R

Rev

Rev 67147 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 67147 Rev 69158
Line 105... Line 105...
105
      raw_fontnum = _hershey_typeface_info[typeface].fonts[fontindex];
105
      raw_fontnum = _hershey_typeface_info[typeface].fonts[fontindex];
106
      raw_symbol_fontnum = _hershey_typeface_info[typeface].fonts[0];
106
      raw_symbol_fontnum = _hershey_typeface_info[typeface].fonts[0];
107
  /* Of the following two words, `fontword' is updated whenever an escape
107
  /* Of the following two words, `fontword' is updated whenever an escape
108
     sequence like \f0, \f1, \f2 etc. is seen, since raw_fontnum is itself
108
     sequence like \f0, \f1, \f2 etc. is seen, since raw_fontnum is itself
109
     updated.  But `symbol_fontword' is fixed */
109
     updated.  But `symbol_fontword' is fixed */
110
  fontword = ((unsigned short)raw_fontnum) << FONT_SHIFT;
110
      fontword = (unsigned short)(raw_fontnum << FONT_SHIFT);
111
  symbol_fontword = ((unsigned short)raw_symbol_fontnum) << FONT_SHIFT;
111
      symbol_fontword = (unsigned short)(raw_symbol_fontnum << FONT_SHIFT);
112
 
112
 
113
  while (*src != (unsigned char)'\0')
113
  while (*src != (unsigned char)'\0')
114
    {
114
    {
115
      /* If EUC, check first for high bit and process two-byte characters
115
      /* If EUC, check first for high bit and process two-byte characters
116
	 separately.  This approach is awkward (we duplicate a lot of code
116
	 separately.  This approach is awkward (we duplicate a lot of code
Line 142... Line 142...
142
			}
142
			}
143
		      kanji++;
143
		      kanji++;
144
		    }
144
		    }
145
		  if (matched)
145
		  if (matched)
146
		    {
146
		    {
147
		      dest[j++] = RAW_ORIENTAL_HERSHEY_GLYPH | (kanji->nelson);
147
		      dest[j++] = (unsigned short)( RAW_ORIENTAL_HERSHEY_GLYPH | (kanji->nelson));
148
		      src += 2;
148
		      src += 2;
149
		      continue;	/* back to top of while loop */
149
		      continue;	/* back to top of while loop */
150
		    }
150
		    }
151
		  else		/* a Kanji we don't have */
151
		  else		/* a Kanji we don't have */
152
		    {
152
		    {
Line 183... Line 183...
183
		      if (charnum & RAW_HERSHEY_GLYPH)
183
		      if (charnum & RAW_HERSHEY_GLYPH)
184
			/* a raw Hershey glyph, not in any font */
184
			/* a raw Hershey glyph, not in any font */
185
			dest[j++] = RAW_HERSHEY_GLYPH | charnum;
185
			dest[j++] = RAW_HERSHEY_GLYPH | charnum;
186
		      else
186
		      else
187
			/* a character in one of the fonts in g_fontdb.c */
187
			/* a character in one of the fonts in g_fontdb.c */
188
			dest[j++] = (((unsigned short)fontnum) << FONT_SHIFT) | charnum;
188
			  dest[j++] = (unsigned short)((fontnum << FONT_SHIFT) | charnum);
189
		      src += 2;
189
		      src += 2;
190
		      continue; /* back to top of while loop */
190
		      continue; /* back to top of while loop */
191
		    }
191
		    }
192
		  else	/* a character we don't have */
192
		  else	/* a character we don't have */
193
		    {
193
		    {
Line 344... Line 344...
344
 
344
 
345
	      glyphindex = (src[3] - '0') + 10 * (src[2] - '0')
345
	      glyphindex = (src[3] - '0') + 10 * (src[2] - '0')
346
		+ 100 * (src[1] - '0') + 1000 * (src[0] - '0');
346
		+ 100 * (src[1] - '0') + 1000 * (src[0] - '0');
347
	      if (glyphindex < NUM_OCCIDENTAL_HERSHEY_GLYPHS)
347
	      if (glyphindex < NUM_OCCIDENTAL_HERSHEY_GLYPHS)
348
		{
348
		{
349
		  dest[j++] = RAW_HERSHEY_GLYPH | glyphindex;
349
		  dest[j++] = (unsigned short)(RAW_HERSHEY_GLYPH | glyphindex);
350
		  src += 4;
350
		  src += 4;
351
		  continue;	/* back to top of while loop */
351
		  continue;	/* back to top of while loop */
352
		}
352
		}
353
	    }
353
	    }
354
 
354
 
Line 366... Line 366...
366
 
366
 
367
	      glyphindex = (src[3] - '0') + 10 * (src[2] - '0')
367
	      glyphindex = (src[3] - '0') + 10 * (src[2] - '0')
368
		+ 100 * (src[1] - '0') + 1000 * (src[0] - '0');
368
		+ 100 * (src[1] - '0') + 1000 * (src[0] - '0');
369
	      if (glyphindex < NUM_ORIENTAL_HERSHEY_GLYPHS)
369
	      if (glyphindex < NUM_ORIENTAL_HERSHEY_GLYPHS)
370
		{
370
		{
371
		  dest[j++] = RAW_ORIENTAL_HERSHEY_GLYPH | glyphindex;
371
		  dest[j++] = (unsigned short)(RAW_ORIENTAL_HERSHEY_GLYPH | glyphindex);
372
		  src += 4;
372
		  src += 4;
373
		  continue;	/* back to top of while loop */
373
		  continue;	/* back to top of while loop */
374
		}
374
		}
375
	    }
375
	    }
376
#endif /* not NO_KANJI */
376
#endif /* not NO_KANJI */
Line 427... Line 427...
427
			    }
427
			    }
428
			  kanji++;
428
			  kanji++;
429
			}
429
			}
430
		      if (matched)
430
		      if (matched)
431
			{
431
			{
432
			  dest[j++] = RAW_ORIENTAL_HERSHEY_GLYPH | (kanji->nelson);
432
			  dest[j++] = (unsigned short)(RAW_ORIENTAL_HERSHEY_GLYPH | (kanji->nelson));
433
			  src += 4;
433
			  src += 4;
434
			  continue;	/* back to top of while loop */
434
			  continue;	/* back to top of while loop */
435
			}
435
			}
436
		      else		/* a Kanji we don't have */
436
		      else		/* a Kanji we don't have */
437
			{
437
			{
Line 468... Line 468...
468
			  if (charnum & RAW_HERSHEY_GLYPH)
468
			  if (charnum & RAW_HERSHEY_GLYPH)
469
			    /* a raw Hershey glyph, not in any font */
469
			    /* a raw Hershey glyph, not in any font */
470
			    dest[j++] = RAW_HERSHEY_GLYPH | charnum;
470
			    dest[j++] = RAW_HERSHEY_GLYPH | charnum;
471
			  else
471
			  else
472
			    /* a character in one of the fonts in g_fontdb.c */
472
			    /* a character in one of the fonts in g_fontdb.c */
473
			    dest[j++] = (((unsigned short)fontnum) << FONT_SHIFT) | charnum;
473
			    dest[j++] = (unsigned short)((fontnum << FONT_SHIFT) | charnum);
474
			  src += 4;
474
			  src += 4;
475
			  continue; /* back to top of while loop */
475
			  continue; /* back to top of while loop */
476
			}
476
			}
477
		      else	/* a character we don't have */
477
		      else	/* a character we don't have */
478
			{
478
			{
Line 495... Line 495...
495
		  matched = true;
495
		  matched = true;
496
		  break;
496
		  break;
497
		}
497
		}
498
	    if (matched)		/* it's a control code */
498
	    if (matched)		/* it's a control code */
499
	      {
499
	      {
500
		dest[j++] = CONTROL_CODE | i;
500
		dest[j++] = (unsigned short)(CONTROL_CODE | i);
501
		continue;	/* back to top of while loop */
501
		continue;	/* back to top of while loop */
502
	      }
502
	      }
503
	  }
503
	  }
504
 
504
 
505
	  /* if current font is an ISO-Latin-1 Hershey font, is this an
505
	  /* if current font is an ISO-Latin-1 Hershey font, is this an