diff options
| author | Andrew Choi | 2001-08-24 07:46:40 +0000 |
|---|---|---|
| committer | Andrew Choi | 2001-08-24 07:46:40 +0000 |
| commit | 199f927008b33dc9dd9514a9e70f511df15aa6cd (patch) | |
| tree | ea5b2ffe7e9ab952cddd9ecb3b8d90b7dbc1c1d8 /mac/src | |
| parent | fa05f6ac1ba404a59ac91b59f6fd63623bf1dd34 (diff) | |
| download | emacs-199f927008b33dc9dd9514a9e70f511df15aa6cd.tar.gz emacs-199f927008b33dc9dd9514a9e70f511df15aa6cd.zip | |
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.
Diffstat (limited to 'mac/src')
| -rw-r--r-- | mac/src/macterm.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/mac/src/macterm.c b/mac/src/macterm.c index 9bd22c7d062..1a0544920ac 100644 --- a/mac/src/macterm.c +++ b/mac/src/macterm.c | |||
| @@ -10393,7 +10393,11 @@ init_font_name_table () | |||
| 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 **) |
| @@ -10405,6 +10409,17 @@ init_font_name_table () | |||
| 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 | ||
| @@ -10660,6 +10675,20 @@ XLoadQueryFont (Display *dpy, char *fontname) | |||
| 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 || |