Mercurial > emacs
comparison mac/src/macterm.c @ 38931:dc047d3af2cd
2001-08-24 Andrew Choi <akochoi@cse.cuhk.edu.hk>
* src/macterm.c (init_font_name_table): Add an additional entry to
the font table with the script code smRoman for each Apple
Japanese font.
(XLoadQueryFont): Recognize a font as having the smRoman script
code even when FontToScript returns smJapanese if it is one of
those created above.
author | Andrew Choi <akochoi@shaw.ca> |
---|---|
date | Fri, 24 Aug 2001 07:46:40 +0000 |
parents | bd309345e7ea |
children | 6addcec799eb |
comparison
equal
deleted
inserted
replaced
38930:9cf07e15b208 | 38931:dc047d3af2cd |
---|---|
10391 { | 10391 { |
10392 font_name_table_size = 16; | 10392 font_name_table_size = 16; |
10393 font_name_table = (char **) | 10393 font_name_table = (char **) |
10394 xmalloc (font_name_table_size * sizeof (char *)); | 10394 xmalloc (font_name_table_size * sizeof (char *)); |
10395 } | 10395 } |
10396 else if (font_name_count >= font_name_table_size) | 10396 else if (font_name_count >= font_name_table_size || |
10397 /* fonts in Japanese scripts require two | |
10398 entries. */ | |
10399 scriptcode == smJapanese && | |
10400 font_name_count + 1 >= font_name_table_size) | |
10397 { | 10401 { |
10398 font_name_table_size += 16; | 10402 font_name_table_size += 16; |
10399 font_name_table = (char **) | 10403 font_name_table = (char **) |
10400 xrealloc (font_name_table, | 10404 xrealloc (font_name_table, |
10401 font_name_table_size * sizeof (char *)); | 10405 font_name_table_size * sizeof (char *)); |
10403 font_name_table[font_name_count++] | 10407 font_name_table[font_name_count++] |
10404 = mac_to_x_fontname (name, | 10408 = mac_to_x_fontname (name, |
10405 assc_entry->fontSize, | 10409 assc_entry->fontSize, |
10406 assc_entry->fontStyle, | 10410 assc_entry->fontStyle, |
10407 scriptcode); | 10411 scriptcode); |
10412 /* Both jisx0208.1983-sjis and jisx0201.1976-sjis | |
10413 parts are contained in Apple Japanese (SJIS) | |
10414 font. */ | |
10415 if (smJapanese == scriptcode) | |
10416 { | |
10417 font_name_table[font_name_count++] | |
10418 = mac_to_x_fontname (name, | |
10419 assc_entry->fontSize, | |
10420 assc_entry->fontStyle, | |
10421 smRoman); | |
10422 } | |
10408 } | 10423 } |
10409 } | 10424 } |
10410 | 10425 |
10411 HUnlock (font_handle); | 10426 HUnlock (font_handle); |
10412 font_handle_2 = GetNextFOND (font_handle); | 10427 font_handle_2 = GetNextFOND (font_handle); |
10658 font->mac_fontnum = fontnum; | 10673 font->mac_fontnum = fontnum; |
10659 font->mac_fontsize = size; | 10674 font->mac_fontsize = size; |
10660 font->mac_fontface = fontface; | 10675 font->mac_fontface = fontface; |
10661 font->mac_scriptcode = FontToScript (fontnum); | 10676 font->mac_scriptcode = FontToScript (fontnum); |
10662 | 10677 |
10678 /* Apple Japanese (SJIS) font is listed as both | |
10679 "*-jisx0208.1983-sjis" (Japanese script) and "*-mac-roman" (Roman | |
10680 script) in init_font_name_table(). The latter should be treated | |
10681 as a one-byte font. */ | |
10682 { | |
10683 char cs[32]; | |
10684 | |
10685 if (sscanf (name, | |
10686 "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s", | |
10687 cs) == 1 | |
10688 && 0 == strcmp (cs, "mac-roman")) | |
10689 font->mac_scriptcode = smRoman; | |
10690 } | |
10691 | |
10663 is_two_byte_font = font->mac_scriptcode == smJapanese || | 10692 is_two_byte_font = font->mac_scriptcode == smJapanese || |
10664 font->mac_scriptcode == smTradChinese || | 10693 font->mac_scriptcode == smTradChinese || |
10665 font->mac_scriptcode == smSimpChinese || | 10694 font->mac_scriptcode == smSimpChinese || |
10666 font->mac_scriptcode == smKorean; | 10695 font->mac_scriptcode == smKorean; |
10667 | 10696 |