diff options
| author | YAMAMOTO Mitsuharu | 2005-10-18 10:32:37 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2005-10-18 10:32:37 +0000 |
| commit | 6abfb0225a4ac331c86ffb2af428c1d4db80f558 (patch) | |
| tree | ab80147252b2ed18674688ef3c318f61e6f55ee3 /src | |
| parent | 4ab223a0674b16aeb79fa66db50846d0289a44cd (diff) | |
| download | emacs-6abfb0225a4ac331c86ffb2af428c1d4db80f558.tar.gz emacs-6abfb0225a4ac331c86ffb2af428c1d4db80f558.zip | |
(mac_encode_char): Call ccl_driver with the last arg Qnil.
Use JIS_TO_SJIS instead of ENCODE_SJIS.
(decode_mac_font_name): Use decode_coding_c_string instead of decode_coding.
(x_load_font): Initialize fontp->fontset to -1. Set fontp->encoding_type.
Diffstat (limited to 'src')
| -rw-r--r-- | src/macterm.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/macterm.c b/src/macterm.c index 470851a3ffe..02dcbf5e04f 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -1945,7 +1945,7 @@ mac_encode_char (c, char2b, font_info, charset, two_byte_p) | |||
| 1945 | ccl->reg[2] = XCHAR2B_BYTE2 (char2b); | 1945 | ccl->reg[2] = XCHAR2B_BYTE2 (char2b); |
| 1946 | } | 1946 | } |
| 1947 | 1947 | ||
| 1948 | ccl_driver (ccl, NULL, NULL, 0, 0, NULL); | 1948 | ccl_driver (ccl, NULL, NULL, 0, 0, Qnil); |
| 1949 | 1949 | ||
| 1950 | /* We assume that MSBs are appropriately set/reset by CCL | 1950 | /* We assume that MSBs are appropriately set/reset by CCL |
| 1951 | program. */ | 1951 | program. */ |
| @@ -1967,16 +1967,13 @@ mac_encode_char (c, char2b, font_info, charset, two_byte_p) | |||
| 1967 | if (enc == 1 || enc == 3) | 1967 | if (enc == 1 || enc == 3) |
| 1968 | char2b->byte2 |= 0x80; | 1968 | char2b->byte2 |= 0x80; |
| 1969 | 1969 | ||
| 1970 | /* | ||
| 1971 | if (enc == 4) | 1970 | if (enc == 4) |
| 1972 | { | 1971 | { |
| 1973 | int sjis1, sjis2; | 1972 | int code = (char2b->byte1 << 8) | char2b->byte2; |
| 1974 | 1973 | ||
| 1975 | ENCODE_SJIS (char2b->byte1, char2b->byte2, sjis1, sjis2); | 1974 | JIS_TO_SJIS (code); |
| 1976 | char2b->byte1 = sjis1; | 1975 | STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF)); |
| 1977 | char2b->byte2 = sjis2; | 1976 | } |
| 1978 | } | ||
| 1979 | */ | ||
| 1980 | } | 1977 | } |
| 1981 | 1978 | ||
| 1982 | if (two_byte_p) | 1979 | if (two_byte_p) |
| @@ -5604,11 +5601,17 @@ x_new_font (f, fontname) | |||
| 5604 | 5601 | ||
| 5605 | return build_string (fontp->full_name); | 5602 | return build_string (fontp->full_name); |
| 5606 | } | 5603 | } |
| 5604 | |||
| 5605 | /* Give frame F the fontset named FONTSETNAME as its default fontset, | ||
| 5606 | and return the full name of that fontset. FONTSETNAME may be a | ||
| 5607 | wildcard pattern; in that case, we choose some fontset that fits | ||
| 5608 | the pattern. FONTSETNAME may be a font name for ASCII characters; | ||
| 5609 | in that case, we create a fontset from that font name. | ||
| 5607 | 5610 | ||
| 5608 | /* Give frame F the fontset named FONTSETNAME as its default font, and | 5611 | The return value shows which fontset we chose. |
| 5609 | return the full name of that fontset. FONTSETNAME may be a wildcard | 5612 | If FONTSETNAME specifies the default fontset, return Qt. |
| 5610 | pattern; in that case, we choose some fontset that fits the pattern. | 5613 | If an ASCII font in the specified fontset can't be loaded, return |
| 5611 | The return value shows which fontset we chose. */ | 5614 | Qnil. */ |
| 5612 | 5615 | ||
| 5613 | Lisp_Object | 5616 | Lisp_Object |
| 5614 | x_new_fontset (f, fontsetname) | 5617 | x_new_fontset (f, fontsetname) |
| @@ -6823,19 +6826,16 @@ decode_mac_font_name (name, size, coding_system) | |||
| 6823 | 6826 | ||
| 6824 | if (*p) | 6827 | if (*p) |
| 6825 | { | 6828 | { |
| 6826 | #if 0 | ||
| 6827 | /* MAC_TODO: Fix encoding system... */ | ||
| 6828 | setup_coding_system (coding_system, &coding); | 6829 | setup_coding_system (coding_system, &coding); |
| 6829 | coding.src_multibyte = 0; | 6830 | coding.src_multibyte = 0; |
| 6830 | coding.dst_multibyte = 1; | 6831 | coding.dst_multibyte = 1; |
| 6831 | coding.mode |= CODING_MODE_LAST_BLOCK; | 6832 | coding.mode |= CODING_MODE_LAST_BLOCK; |
| 6832 | coding.composing = COMPOSITION_DISABLED; | 6833 | coding.dst_bytes = size; |
| 6833 | buf = (char *) alloca (size); | 6834 | coding.destination = (unsigned char *) alloca (coding.dst_bytes); |
| 6834 | 6835 | ||
| 6835 | decode_coding (&coding, name, buf, strlen (name), size - 1); | 6836 | decode_coding_c_string (&coding, name, strlen (name), Qnil); |
| 6836 | bcopy (buf, name, coding.produced); | 6837 | bcopy (coding.destination, name, min (coding.produced, size)); |
| 6837 | name[coding.produced] = '\0'; | 6838 | name[min (coding.produced, size)] = '\0'; |
| 6838 | #endif | ||
| 6839 | } | 6839 | } |
| 6840 | } | 6840 | } |
| 6841 | 6841 | ||
| @@ -8000,6 +8000,7 @@ x_load_font (f, fontname, size) | |||
| 8000 | bzero (fontp, sizeof (*fontp)); | 8000 | bzero (fontp, sizeof (*fontp)); |
| 8001 | fontp->font = font; | 8001 | fontp->font = font; |
| 8002 | fontp->font_idx = i; | 8002 | fontp->font_idx = i; |
| 8003 | fontp->charset = -1; /* fs_load_font sets it. */ | ||
| 8003 | fontp->name = (char *) xmalloc (strlen (fontname) + 1); | 8004 | fontp->name = (char *) xmalloc (strlen (fontname) + 1); |
| 8004 | bcopy (fontname, fontp->name, strlen (fontname) + 1); | 8005 | bcopy (fontname, fontp->name, strlen (fontname) + 1); |
| 8005 | 8006 | ||
| @@ -8045,22 +8046,20 @@ x_load_font (f, fontname, size) | |||
| 8045 | fontp->height = max_height; | 8046 | fontp->height = max_height; |
| 8046 | } | 8047 | } |
| 8047 | 8048 | ||
| 8048 | #if 0 /* MAC_TODO: fill these out with more reasonably values */ | ||
| 8049 | |||
| 8050 | /* MAC_TODO: The script encoding is irrelevant in unicode? */ | 8049 | /* MAC_TODO: The script encoding is irrelevant in unicode? */ |
| 8051 | /* The slot `encoding' specifies how to map a character | 8050 | /* The slot `encoding' specifies how to map a character |
| 8052 | code-points (0x20..0x7F or 0x2020..0x7F7F) of each charset to | 8051 | code-points (0x20..0x7F or 0x2020..0x7F7F) of each charset to |
| 8053 | the font code-points (0:0x20..0x7F, 1:0xA0..0xFF), or | 8052 | the font code-points (0:0x20..0x7F, 1:0xA0..0xFF), or |
| 8054 | (0:0x2020..0x7F7F, 1:0xA0A0..0xFFFF, 3:0x20A0..0x7FFF, | 8053 | (0:0x2020..0x7F7F, 1:0xA0A0..0xFFFF, 3:0x20A0..0x7FFF, |
| 8055 | 2:0xA020..0xFF7F). For the moment, we don't know which charset | 8054 | 2:0xA020..0xFF7F). For the moment, we don't know which charset |
| 8056 | uses this font. So, we set information in fontp->encoding[1] | 8055 | uses this font. So, we set information in fontp->encoding_type |
| 8057 | which is never used by any charset. If mapping can't be | 8056 | which is never used by any charset. If mapping can't be |
| 8058 | decided, set FONT_ENCODING_NOT_DECIDED. */ | 8057 | decided, set FONT_ENCODING_NOT_DECIDED. */ |
| 8059 | if (font->mac_scriptcode == smJapanese) | 8058 | if (font->mac_scriptcode == smJapanese) |
| 8060 | fontp->encoding[1] = 4; | 8059 | fontp->encoding_type = 4; |
| 8061 | else | 8060 | else |
| 8062 | { | 8061 | { |
| 8063 | fontp->encoding[1] | 8062 | fontp->encoding_type |
| 8064 | = (font->max_byte1 == 0 | 8063 | = (font->max_byte1 == 0 |
| 8065 | /* 1-byte font */ | 8064 | /* 1-byte font */ |
| 8066 | ? (font->min_char_or_byte2 < 0x80 | 8065 | ? (font->min_char_or_byte2 < 0x80 |
| @@ -8084,6 +8083,7 @@ x_load_font (f, fontname, size) | |||
| 8084 | : 1))); /* 0xA0A0..0xFFFF */ | 8083 | : 1))); /* 0xA0A0..0xFFFF */ |
| 8085 | } | 8084 | } |
| 8086 | 8085 | ||
| 8086 | #if 0 /* MAC_TODO: fill these out with more reasonably values */ | ||
| 8087 | fontp->baseline_offset | 8087 | fontp->baseline_offset |
| 8088 | = (XGetFontProperty (font, dpyinfo->Xatom_MULE_BASELINE_OFFSET, &value) | 8088 | = (XGetFontProperty (font, dpyinfo->Xatom_MULE_BASELINE_OFFSET, &value) |
| 8089 | ? (long) value : 0); | 8089 | ? (long) value : 0); |