comparison mac/src/macterm.c @ 39107:e4461ba10180

2001-09-04 Andrew Choi <akochoi@cse.cuhk.edu.hk> * src/macterm.c (mac_to_x_fontname): Return name with jisx0201.1976-0 encoding if a script code of -smJapanese is specified. (x_font_name_to_mac_font_name): Also recognize the jisx0201.1976-0 encoding. (init_font_name_table): Use a script code of -smJapanese instead of smRoman for the second entry of a Japanese font. (XLoadQueryFont): Recognize a font as having the smRoman script code if its encoding is jisx0201.1976-0.
author Andrew Choi <akochoi@shaw.ca>
date Tue, 04 Sep 2001 06:49:24 +0000
parents 6addcec799eb
children 0f5c2cf91c81
comparison
equal deleted inserted replaced
39106:dc9d8a2e8650 39107:e4461ba10180
10285 strcpy(cs, "gb2312.1980-0"); 10285 strcpy(cs, "gb2312.1980-0");
10286 break; 10286 break;
10287 case smJapanese: 10287 case smJapanese:
10288 strcpy(cs, "jisx0208.1983-sjis"); 10288 strcpy(cs, "jisx0208.1983-sjis");
10289 break; 10289 break;
10290 case -smJapanese:
10291 /* Each Apple Japanese font is entered into the font table
10292 twice: once as a jisx0208.1983-sjis font and once as a
10293 jisx0201.1976-0 font. The latter can be used to display
10294 the ascii charset and katakana-jisx0201 charset. A
10295 negative script code signals that the name of this latter
10296 font is being built. */
10297 strcpy(cs, "jisx0201.1976-0");
10298 break;
10290 case smKorean: 10299 case smKorean:
10291 strcpy(cs, "ksc5601.1989-0"); 10300 strcpy(cs, "ksc5601.1989-0");
10292 break; 10301 break;
10293 default: 10302 default:
10294 strcpy(cs, "mac-roman"); 10303 strcpy(cs, "mac-roman");
10328 foundry, family, weight, slant, cs) != 5) 10337 foundry, family, weight, slant, cs) != 5)
10329 return; 10338 return;
10330 10339
10331 if (strcmp (cs, "big5-0") == 0 || strcmp (cs, "gb2312.1980-0") == 0 10340 if (strcmp (cs, "big5-0") == 0 || strcmp (cs, "gb2312.1980-0") == 0
10332 || strcmp (cs, "jisx0208.1983-sjis") == 0 10341 || strcmp (cs, "jisx0208.1983-sjis") == 0
10342 || strcmp (cs, "jisx0201.1976-0") == 0
10333 || strcmp (cs, "ksc5601.1989-0") == 0 || strcmp (cs, "mac-roman") == 0) 10343 || strcmp (cs, "ksc5601.1989-0") == 0 || strcmp (cs, "mac-roman") == 0)
10334 strcpy(mf, family); 10344 strcpy(mf, family);
10335 else 10345 else
10336 sprintf(mf, "%s-%s-%s", foundry, family, cs); 10346 sprintf(mf, "%s-%s-%s", foundry, family, cs);
10337 } 10347 }
10407 font_name_table[font_name_count++] 10417 font_name_table[font_name_count++]
10408 = mac_to_x_fontname (name, 10418 = mac_to_x_fontname (name,
10409 assc_entry->fontSize, 10419 assc_entry->fontSize,
10410 assc_entry->fontStyle, 10420 assc_entry->fontStyle,
10411 scriptcode); 10421 scriptcode);
10412 /* Both jisx0208.1983-sjis and jisx0201.1976-sjis 10422 /* Both jisx0208.1983-sjis and jisx0201.1976-0 parts
10413 parts are contained in Apple Japanese (SJIS) 10423 are contained in Apple Japanese (SJIS) font. */
10414 font. */
10415 if (smJapanese == scriptcode) 10424 if (smJapanese == scriptcode)
10416 { 10425 {
10417 font_name_table[font_name_count++] 10426 font_name_table[font_name_count++]
10418 = mac_to_x_fontname (name, 10427 = mac_to_x_fontname (name,
10419 assc_entry->fontSize, 10428 assc_entry->fontSize,
10420 assc_entry->fontStyle, 10429 assc_entry->fontStyle,
10421 smRoman); 10430 -smJapanese);
10422 } 10431 }
10423 } 10432 }
10424 } 10433 }
10425 10434
10426 HUnlock (font_handle); 10435 HUnlock (font_handle);
10674 font->mac_fontsize = size; 10683 font->mac_fontsize = size;
10675 font->mac_fontface = fontface; 10684 font->mac_fontface = fontface;
10676 font->mac_scriptcode = FontToScript (fontnum); 10685 font->mac_scriptcode = FontToScript (fontnum);
10677 10686
10678 /* Apple Japanese (SJIS) font is listed as both 10687 /* Apple Japanese (SJIS) font is listed as both
10679 "*-jisx0208.1983-sjis" (Japanese script) and "*-mac-roman" (Roman 10688 "*-jisx0208.1983-sjis" (Japanese script) and "*-jisx0201.1976-0"
10680 script) in init_font_name_table(). The latter should be treated 10689 (Roman script) in init_font_name_table(). The latter should be
10681 as a one-byte font. */ 10690 treated as a one-byte font. */
10682 { 10691 {
10683 char cs[32]; 10692 char cs[32];
10684 10693
10685 if (sscanf (name, 10694 if (sscanf (name,
10686 "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s", 10695 "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s",
10687 cs) == 1 10696 cs) == 1
10688 && 0 == strcmp (cs, "mac-roman")) 10697 && 0 == strcmp (cs, "jisx0201.1976-0"))
10689 font->mac_scriptcode = smRoman; 10698 font->mac_scriptcode = smRoman;
10690 } 10699 }
10691 10700
10692 is_two_byte_font = font->mac_scriptcode == smJapanese || 10701 is_two_byte_font = font->mac_scriptcode == smJapanese ||
10693 font->mac_scriptcode == smTradChinese || 10702 font->mac_scriptcode == smTradChinese ||