The R Project SVN R

Rev

Rev 82936 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 82936 Rev 82986
Line 129... Line 129...
129
	      if (jis_glyphindex >= BEGINNING_OF_KANJI)
129
	      if (jis_glyphindex >= BEGINNING_OF_KANJI)
130
		/* in Kanji range, so check if we have it */
130
		/* in Kanji range, so check if we have it */
131
		{
131
		{
132
#ifndef NO_KANJI
132
#ifndef NO_KANJI
133
		  const struct kanjipair *kanji = _builtin_kanji_glyphs;
133
		  const struct kanjipair *kanji = _builtin_kanji_glyphs;
134
		  bool0 matched = false;
134
		  bool0 matched = false_;
135
 
135
 
136
		  while (kanji->jis != 0)
136
		  while (kanji->jis != 0)
137
		    {
137
		    {
138
		      if (jis_glyphindex == kanji->jis)
138
		      if (jis_glyphindex == kanji->jis)
139
			{
139
			{
140
			  matched = true;
140
			  matched = true_;
141
			  break;
141
			  break;
142
			}
142
			}
143
		      kanji++;
143
		      kanji++;
144
		    }
144
		    }
145
		  if (matched)
145
		  if (matched)
Line 159... Line 159...
159
		}
159
		}
160
	      else
160
	      else
161
		/* not in Kanji range, so look for it in char table */
161
		/* not in Kanji range, so look for it in char table */
162
		{
162
		{
163
		  const struct jis_entry *char_mapping = _builtin_jis_chars;
163
		  const struct jis_entry *char_mapping = _builtin_jis_chars;
164
		  bool0 matched = false;
164
		  bool0 matched = false_;
165
 
165
 
166
		  while (char_mapping->jis != 0)
166
		  while (char_mapping->jis != 0)
167
		    {
167
		    {
168
		      if (jis_glyphindex == char_mapping->jis)
168
		      if (jis_glyphindex == char_mapping->jis)
169
			{
169
			{
170
			  matched = true;
170
			  matched = true_;
171
			  break;
171
			  break;
172
			}
172
			}
173
		      char_mapping++;
173
		      char_mapping++;
174
		    }
174
		    }
175
		  if (matched)
175
		  if (matched)
Line 209... Line 209...
209
      /* if current font is Hershey, first try to match each ligature
209
      /* if current font is Hershey, first try to match each ligature
210
	 pattern (no ligatures supported in non-Hershey fonts) */
210
	 pattern (no ligatures supported in non-Hershey fonts) */
211
      if (1) /* _plotter->drawstate->font_type == F_HERSHEY) */
211
      if (1) /* _plotter->drawstate->font_type == F_HERSHEY) */
212
	{
212
	{
213
	  int i;
213
	  int i;
214
	  bool0 matched = false;
214
	  bool0 matched = false_;
215
 
215
 
216
	  for (i = 0; i < NUM_LIGATURES; i++)
216
	  for (i = 0; i < NUM_LIGATURES; i++)
217
	    if ((_ligature_tbl[i].font == raw_fontnum)
217
	    if ((_ligature_tbl[i].font == raw_fontnum)
218
		&& (strncmp ((char *)src, _ligature_tbl[i].from,
218
		&& (strncmp ((char *)src, _ligature_tbl[i].from,
219
			     strlen (_ligature_tbl[i].from)) == 0))
219
			     strlen (_ligature_tbl[i].from)) == 0))
220
	      {
220
	      {
221
		matched = true;
221
		matched = true_;
222
		break;
222
		break;
223
	      }
223
	      }
224
 
224
 
225
	  if (matched)
225
	  if (matched)
226
	    {
226
	    {
Line 236... Line 236...
236
	  /* if current font is an ISO-Latin-1 Hershey font ... */
236
	  /* if current font is an ISO-Latin-1 Hershey font ... */
237
	    if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
237
	    if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
238
	      && _hershey_font_info[raw_fontnum].iso8859_1)
238
	      && _hershey_font_info[raw_fontnum].iso8859_1)
239
	    {
239
	    {
240
	      int i;
240
	      int i;
241
	      bool0 matched = false;
241
	      bool0 matched = false_;
242
 
242
 
243
	      /* check if this is a `raised' ISO-Latin-1 character */
243
	      /* check if this is a `raised' ISO-Latin-1 character */
244
	      for (i = 0; i < NUM_RAISED_CHARS; i++)
244
	      for (i = 0; i < NUM_RAISED_CHARS; i++)
245
		if (c == _raised_char_tbl[i].from)
245
		if (c == _raised_char_tbl[i].from)
246
		  {
246
		  {
247
		    matched = true;
247
		    matched = true_;
248
		    break;
248
		    break;
249
		  }
249
		  }
250
	      if (matched)	/* it's a raised character */
250
	      if (matched)	/* it's a raised character */
251
		{
251
		{
252
		  /* map to string of unsigned shorts, length 3 or 6:
252
		  /* map to string of unsigned shorts, length 3 or 6:
Line 280... Line 280...
280
	      /* since current font is an ISO-Latin-1 Hershey font, also
280
	      /* since current font is an ISO-Latin-1 Hershey font, also
281
		 check if this char should be deligatured */
281
		 check if this char should be deligatured */
282
	      for (i = 0; i < NUM_DELIGATURED_CHARS; i++)
282
	      for (i = 0; i < NUM_DELIGATURED_CHARS; i++)
283
		if (c == _deligature_char_tbl[i].from)
283
		if (c == _deligature_char_tbl[i].from)
284
		  {
284
		  {
285
		    matched = true;
285
		    matched = true_;
286
		    break;
286
		    break;
287
		  }
287
		  }
288
	      if (matched)
288
	      if (matched)
289
		{
289
		{
290
		  if (_deligature_char_tbl[i].except_font != raw_fontnum)
290
		  if (_deligature_char_tbl[i].except_font != raw_fontnum)
Line 414... Line 414...
414
		  if (jis_glyphindex >= BEGINNING_OF_KANJI)
414
		  if (jis_glyphindex >= BEGINNING_OF_KANJI)
415
		    /* in Kanji range, so check if we have it */
415
		    /* in Kanji range, so check if we have it */
416
		    {
416
		    {
417
#ifndef NO_KANJI
417
#ifndef NO_KANJI
418
		      const struct kanjipair *kanji = _builtin_kanji_glyphs;
418
		      const struct kanjipair *kanji = _builtin_kanji_glyphs;
419
		      bool0 matched = false;
419
		      bool0 matched = false_;
420
 
420
 
421
		      while (kanji->jis != 0)
421
		      while (kanji->jis != 0)
422
			{
422
			{
423
			  if (jis_glyphindex == kanji->jis)
423
			  if (jis_glyphindex == kanji->jis)
424
			    {
424
			    {
425
			      matched = true;
425
			      matched = true_;
426
			      break;
426
			      break;
427
			    }
427
			    }
428
			  kanji++;
428
			  kanji++;
429
			}
429
			}
430
		      if (matched)
430
		      if (matched)
Line 444... Line 444...
444
		    }
444
		    }
445
		  else
445
		  else
446
		    /* not in Kanji range, so look for it in char table */
446
		    /* not in Kanji range, so look for it in char table */
447
		    {
447
		    {
448
		      const struct jis_entry *char_mapping = _builtin_jis_chars;
448
		      const struct jis_entry *char_mapping = _builtin_jis_chars;
449
		      bool0 matched = false;
449
		      bool0 matched = false_;
450
 
450
 
451
		      while (char_mapping->jis != 0)
451
		      while (char_mapping->jis != 0)
452
			{
452
			{
453
			  if (jis_glyphindex == char_mapping->jis)
453
			  if (jis_glyphindex == char_mapping->jis)
454
			    {
454
			    {
455
			      matched = true;
455
			      matched = true_;
456
			      break;
456
			      break;
457
			    }
457
			    }
458
			  char_mapping++;
458
			  char_mapping++;
459
			}
459
			}
460
		      if (matched)
460
		      if (matched)
Line 484... Line 484...
484
		    }
484
		    }
485
		}
485
		}
486
	    }
486
	    }
487
 
487
 
488
	  {
488
	  {
489
	    bool0 matched = false;
489
	    bool0 matched = false_;
490
 
490
 
491
	    /* is this an escape seq. for a control code? */
491
	    /* is this an escape seq. for a control code? */
492
	    for (i = 0; i < NUM_CONTROLS; i++)
492
	    for (i = 0; i < NUM_CONTROLS; i++)
493
	      if (strcmp ((char *)esc, _control_tbl[i]) == 0)
493
	      if (strcmp ((char *)esc, _control_tbl[i]) == 0)
494
		{
494
		{
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++] = (unsigned short)(CONTROL_CODE | i);
500
		dest[j++] = (unsigned short)(CONTROL_CODE | i);
Line 507... Line 507...
507
	     nonexistence should be deligatured? */
507
	     nonexistence should be deligatured? */
508
	  if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
508
	  if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
509
	      && _hershey_font_info[raw_fontnum].iso8859_1)
509
	      && _hershey_font_info[raw_fontnum].iso8859_1)
510
	    {
510
	    {
511
	      int i;
511
	      int i;
512
	      bool0 matched = false;
512
	      bool0 matched = false_;
513
 
513
 
514
	      for (i = 0; i < NUM_DELIGATURED_ESCAPES; i++)
514
	      for (i = 0; i < NUM_DELIGATURED_ESCAPES; i++)
515
		if (strcmp ((char *)esc, _deligature_escape_tbl[i].from) == 0)
515
		if (strcmp ((char *)esc, _deligature_escape_tbl[i].from) == 0)
516
		  {
516
		  {
517
		    matched = true;
517
		    matched = true_;
518
		    break;
518
		    break;
519
		  }
519
		  }
520
	      if (matched)
520
	      if (matched)
521
		{
521
		{
522
		  if (_deligature_escape_tbl[i].except_font != raw_fontnum)
522
		  if (_deligature_escape_tbl[i].except_font != raw_fontnum)
Line 553... Line 553...
553
		  && raw_fontnum == 1))
553
		  && raw_fontnum == 1))
554
*/
554
*/
555
	  if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
555
	  if (1 /* _plotter->drawstate->font_type == F_HERSHEY */
556
	      && _hershey_font_info[raw_fontnum].iso8859_1)
556
	      && _hershey_font_info[raw_fontnum].iso8859_1)
557
	    {
557
	    {
558
	      bool0 matched = false;
558
	      bool0 matched = false_;
559
 
559
 
560
	      for (i = 0; i < NUM_ISO_ESCAPES; i++)
560
	      for (i = 0; i < NUM_ISO_ESCAPES; i++)
561
		if (strcmp ((char *)esc, _iso_escape_tbl[i].string) == 0)
561
		if (strcmp ((char *)esc, _iso_escape_tbl[i].string) == 0)
562
		  {
562
		  {
563
		    matched = true;
563
		    matched = true_;
564
		    break;
564
		    break;
565
		  }
565
		  }
566
	      if (matched)	/* it's an 8-bit ISO8859-1 character */
566
	      if (matched)	/* it's an 8-bit ISO8859-1 character */
567
		{
567
		{
568
		  /* certain such characters are drawn in the Hershey fonts
568
		  /* certain such characters are drawn in the Hershey fonts
569
		     as superscripts */
569
		     as superscripts */
570
		    if (1) /* _plotter->drawstate->font_type == F_HERSHEY) */
570
		    if (1) /* _plotter->drawstate->font_type == F_HERSHEY) */
571
		    {
571
		    {
572
		      int k;
572
		      int k;
573
		      bool0 matched2 = false;
573
		      bool0 matched2 = false_;
574
 
574
 
575
		      /* check if this is a `raised' ISO-Latin-1 character */
575
		      /* check if this is a `raised' ISO-Latin-1 character */
576
		      for (k = 0; k < NUM_RAISED_CHARS; k++)
576
		      for (k = 0; k < NUM_RAISED_CHARS; k++)
577
			if (_iso_escape_tbl[i].byte == _raised_char_tbl[k].from)
577
			if (_iso_escape_tbl[i].byte == _raised_char_tbl[k].from)
578
			  {
578
			  {
579
			    matched2 = true;
579
			    matched2 = true_;
580
			    break;
580
			    break;
581
			  }
581
			  }
582
		      if (matched2)	/* it's a raised character */
582
		      if (matched2)	/* it's a raised character */
583
			{
583
			{
584
			  /* map to string of unsigned shorts, length 3 or 6:
584
			  /* map to string of unsigned shorts, length 3 or 6:
Line 621... Line 621...
621
	  /* is this an escape seq. for a `special' (non-ISO, non-Symbol)
621
	  /* is this an escape seq. for a `special' (non-ISO, non-Symbol)
622
	     Hershey glyph?  Such glyphs include astronomical signs, and
622
	     Hershey glyph?  Such glyphs include astronomical signs, and
623
	     `final s'. */
623
	     `final s'. */
624
	  if (1) /* _plotter->drawstate->font_type == F_HERSHEY) */
624
	  if (1) /* _plotter->drawstate->font_type == F_HERSHEY) */
625
	    {
625
	    {
626
	      bool0 matched = false;
626
	      bool0 matched = false_;
627
 
627
 
628
	      for (i = 0; i < NUM_SPECIAL_ESCAPES; i++)
628
	      for (i = 0; i < NUM_SPECIAL_ESCAPES; i++)
629
		if (strcmp ((char *)esc, _special_escape_tbl[i].string) == 0)
629
		if (strcmp ((char *)esc, _special_escape_tbl[i].string) == 0)
630
		  {
630
		  {
631
		    matched = true;
631
		    matched = true_;
632
		    break;
632
		    break;
633
		  }
633
		  }
634
	      if (matched)	/* it's a special character */
634
	      if (matched)	/* it's a special character */
635
		{
635
		{
636
		  /* "\s-" is special; yields character in current font */
636
		  /* "\s-" is special; yields character in current font */
Line 644... Line 644...
644
		  continue;	/* back to top of while loop */
644
		  continue;	/* back to top of while loop */
645
		}
645
		}
646
	    }
646
	    }
647
 
647
 
648
	  {
648
	  {
649
	    bool0 matched = false;
649
	    bool0 matched = false_;
650
 
650
 
651
	    /* Irrespective of font type, is this an escape seq. for a char
651
	    /* Irrespective of font type, is this an escape seq. for a char
652
	       in the font's corresponding symbol font? */
652
	       in the font's corresponding symbol font? */
653
	    for (i = 0; i < NUM_SYMBOL_ESCAPES; i++)
653
	    for (i = 0; i < NUM_SYMBOL_ESCAPES; i++)
654
	      if (strcmp (_symbol_escape_tbl[i].string, "NO_ABBREV") != 0
654
	      if (strcmp (_symbol_escape_tbl[i].string, "NO_ABBREV") != 0
655
		  && strcmp ((char *)esc, _symbol_escape_tbl[i].string) == 0)
655
		  && strcmp ((char *)esc, _symbol_escape_tbl[i].string) == 0)
656
		{
656
		{
657
		  matched = true;
657
		  matched = true_;
658
		  break;
658
		  break;
659
		}
659
		}
660
	    if (matched)	/* it's a character in the symbol font */
660
	    if (matched)	/* it's a character in the symbol font */
661
	      {
661
	      {
662
		/* select symbol font by OR'ing in the symbol fontword */
662
		/* select symbol font by OR'ing in the symbol fontword */