diff options
author | Andrew Choi <akochoi@shaw.ca> | 2001-08-24 07:46:40 +0000 |
---|---|---|
committer | Andrew Choi <akochoi@shaw.ca> | 2001-08-24 07:46:40 +0000 |
commit | 199f927008b33dc9dd9514a9e70f511df15aa6cd (patch) | |
tree | ea5b2ffe7e9ab952cddd9ecb3b8d90b7dbc1c1d8 /mac | |
parent | fa05f6ac1ba404a59ac91b59f6fd63623bf1dd34 (diff) | |
download | emacs-199f927008b33dc9dd9514a9e70f511df15aa6cd.tar.gz |
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')
-rw-r--r-- | mac/ChangeLog | 9 | ||||
-rw-r--r-- | mac/src/macterm.c | 31 |
2 files changed, 39 insertions, 1 deletions
diff --git a/mac/ChangeLog b/mac/ChangeLog index f331736a6a8..4030043afc9 100644 --- a/mac/ChangeLog +++ b/mac/ChangeLog @@ -1,3 +1,12 @@ +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. + 2001-08-21 Andrew Choi <akochoi@cse.cuhk.edu.hk> * INSTALL: Add to the note on using -opt speed in MPW the function 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 () font_name_table = (char **) xmalloc (font_name_table_size * sizeof (char *)); } - else if (font_name_count >= font_name_table_size) + else if (font_name_count >= font_name_table_size || + /* fonts in Japanese scripts require two + entries. */ + scriptcode == smJapanese && + font_name_count + 1 >= font_name_table_size) { font_name_table_size += 16; font_name_table = (char **) @@ -10405,6 +10409,17 @@ init_font_name_table () assc_entry->fontSize, assc_entry->fontStyle, scriptcode); + /* Both jisx0208.1983-sjis and jisx0201.1976-sjis + parts are contained in Apple Japanese (SJIS) + font. */ + if (smJapanese == scriptcode) + { + font_name_table[font_name_count++] + = mac_to_x_fontname (name, + assc_entry->fontSize, + assc_entry->fontStyle, + smRoman); + } } } @@ -10660,6 +10675,20 @@ XLoadQueryFont (Display *dpy, char *fontname) font->mac_fontface = fontface; font->mac_scriptcode = FontToScript (fontnum); + /* Apple Japanese (SJIS) font is listed as both + "*-jisx0208.1983-sjis" (Japanese script) and "*-mac-roman" (Roman + script) in init_font_name_table(). The latter should be treated + as a one-byte font. */ + { + char cs[32]; + + if (sscanf (name, + "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s", + cs) == 1 + && 0 == strcmp (cs, "mac-roman")) + font->mac_scriptcode = smRoman; + } + is_two_byte_font = font->mac_scriptcode == smJapanese || font->mac_scriptcode == smTradChinese || font->mac_scriptcode == smSimpChinese || |