aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/macterm.c48
2 files changed, 41 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e4ef9d60e26..fcbc03aa08c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12005-07-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * macterm.c (mac_draw_vertical_window_border): Use foreground of
4 VERTICAL_BORDER_FACE_ID for vertical border line.
5 (mac_encode_char): Call check_ccl_update in advance.
6 (mac_to_x_fontname, x_font_name_to_mac_font_name)
7 (init_font_name_table, mac_do_list_fonts, XLoadQueryFont): Don't
8 assume that font family length is less than 32.
9 (x_compute_min_glyph_bounds): Make static.
10 (x_load_font): Never set fonts_changed_p to zero.
11
12005-07-04 Lute Kamstra <lute@gnu.org> 122005-07-04 Lute Kamstra <lute@gnu.org>
2 13
3 Update FSF's address in GPL notices. 14 Update FSF's address in GPL notices.
diff --git a/src/macterm.c b/src/macterm.c
index 3b3924fe833..59aafc3cd76 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -1334,6 +1334,12 @@ mac_draw_vertical_window_border (w, x, y0, y1)
1334 int x, y0, y1; 1334 int x, y0, y1;
1335{ 1335{
1336 struct frame *f = XFRAME (WINDOW_FRAME (w)); 1336 struct frame *f = XFRAME (WINDOW_FRAME (w));
1337 struct face *face;
1338
1339 face = FACE_FROM_ID (f, VERTICAL_BORDER_FACE_ID);
1340 if (face)
1341 XSetForeground (FRAME_MAC_DISPLAY (f), f->output_data.mac->normal_gc,
1342 face->foreground);
1337 1343
1338 XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 1344 XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
1339 f->output_data.mac->normal_gc, x, y0, x, y1); 1345 f->output_data.mac->normal_gc, x, y0, x, y1);
@@ -1721,10 +1727,12 @@ mac_encode_char (c, char2b, font_info, two_byte_p)
1721 /* It's a program. */ 1727 /* It's a program. */
1722 struct ccl_program *ccl = font_info->font_encoder; 1728 struct ccl_program *ccl = font_info->font_encoder;
1723 1729
1730 check_ccl_update (ccl);
1724 if (CHARSET_DIMENSION (charset) == 1) 1731 if (CHARSET_DIMENSION (charset) == 1)
1725 { 1732 {
1726 ccl->reg[0] = charset; 1733 ccl->reg[0] = charset;
1727 ccl->reg[1] = char2b->byte2; 1734 ccl->reg[1] = char2b->byte2;
1735 ccl->reg[2] = -1;
1728 } 1736 }
1729 else 1737 else
1730 { 1738 {
@@ -6249,10 +6257,11 @@ mac_to_x_fontname (name, size, style, charset)
6249 Style style; 6257 Style style;
6250 char *charset; 6258 char *charset;
6251{ 6259{
6252 char foundry[32], family[32], cs[32]; 6260 Str31 foundry, cs;
6261 Str255 family;
6253 char xf[256], *result, *p; 6262 char xf[256], *result, *p;
6254 6263
6255 if (sscanf (name, "%31[^-]-%31[^-]-%31s", foundry, family, cs) == 3) 6264 if (sscanf (name, "%31[^-]-%255[^-]-%31s", foundry, family, cs) == 3)
6256 charset = cs; 6265 charset = cs;
6257 else 6266 else
6258 { 6267 {
@@ -6260,13 +6269,12 @@ mac_to_x_fontname (name, size, style, charset)
6260 strcpy(family, name); 6269 strcpy(family, name);
6261 } 6270 }
6262 6271
6263 sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-%d-%d-m-%d-%s", 6272 sprintf (xf, "%s-%c-normal--%d-%d-%d-%d-m-%d-%s",
6264 foundry, family, style & bold ? "bold" : "medium", 6273 style & bold ? "bold" : "medium", style & italic ? 'i' : 'r',
6265 style & italic ? 'i' : 'r', size, size * 10, 6274 size, size * 10, size ? 75 : 0, size ? 75 : 0, size * 10, charset);
6266 size ? 75 : 0, size ? 75 : 0, size * 10, charset);
6267 6275
6268 result = (char *) xmalloc (strlen (xf) + 1); 6276 result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1);
6269 strcpy (result, xf); 6277 sprintf (result, "-%s-%s-%s", foundry, family, xf);
6270 for (p = result; *p; p++) 6278 for (p = result; *p; p++)
6271 *p = tolower(*p); 6279 *p = tolower(*p);
6272 return result; 6280 return result;
@@ -6286,15 +6294,17 @@ x_font_name_to_mac_font_name (xf, mf, mf_decoded, style, cs)
6286 Style *style; 6294 Style *style;
6287 char *cs; 6295 char *cs;
6288{ 6296{
6289 char foundry[32], family[32], weight[20], slant[2], *p; 6297 Str31 foundry;
6298 Str255 family;
6299 char weight[20], slant[2], *p;
6290 Lisp_Object charset_info, coding_system = Qnil; 6300 Lisp_Object charset_info, coding_system = Qnil;
6291 struct coding_system coding; 6301 struct coding_system coding;
6292 6302
6293 strcpy (mf, ""); 6303 strcpy (mf, "");
6294 6304
6295 if (sscanf (xf, "-%31[^-]-%31[^-]-%19[^-]-%1[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s", 6305 if (sscanf (xf, "-%31[^-]-%255[^-]-%19[^-]-%1[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s",
6296 foundry, family, weight, slant, cs) != 5 && 6306 foundry, family, weight, slant, cs) != 5 &&
6297 sscanf (xf, "-%31[^-]-%31[^-]-%19[^-]-%1[^-]-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s", 6307 sscanf (xf, "-%31[^-]-%255[^-]-%19[^-]-%1[^-]-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s",
6298 foundry, family, weight, slant, cs) != 5) 6308 foundry, family, weight, slant, cs) != 5)
6299 return; 6309 return;
6300 6310
@@ -6327,7 +6337,7 @@ x_font_name_to_mac_font_name (xf, mf, mf_decoded, style, cs)
6327 coding.dst_multibyte = 1; 6337 coding.dst_multibyte = 1;
6328 coding.mode |= CODING_MODE_LAST_BLOCK; 6338 coding.mode |= CODING_MODE_LAST_BLOCK;
6329 encode_coding (&coding, mf_decoded, mf, 6339 encode_coding (&coding, mf_decoded, mf,
6330 strlen (mf_decoded), sizeof (Str32) - 1); 6340 strlen (mf_decoded), sizeof (Str255) - 1);
6331 mf[coding.produced] = '\0'; 6341 mf[coding.produced] = '\0';
6332 } 6342 }
6333} 6343}
@@ -6459,7 +6469,7 @@ init_font_name_table ()
6459 Handle font_handle, font_handle_2; 6469 Handle font_handle, font_handle_2;
6460 short id, scriptcode; 6470 short id, scriptcode;
6461 ResType type; 6471 ResType type;
6462 Str32 name; 6472 Str255 name;
6463 struct FontAssoc *fat; 6473 struct FontAssoc *fat;
6464 struct AsscEntry *assc_entry; 6474 struct AsscEntry *assc_entry;
6465 Lisp_Object text_encoding_info_alist, text_encoding_info; 6475 Lisp_Object text_encoding_info_alist, text_encoding_info;
@@ -6598,8 +6608,7 @@ mac_do_list_fonts (pattern, maxnames)
6598 int i, n_fonts = 0; 6608 int i, n_fonts = 0;
6599 Lisp_Object font_list = Qnil, pattern_regex, fontname; 6609 Lisp_Object font_list = Qnil, pattern_regex, fontname;
6600 char *regex = (char *) alloca (strlen (pattern) * 2 + 3); 6610 char *regex = (char *) alloca (strlen (pattern) * 2 + 3);
6601 char scaled[256]; 6611 char *scaled, *ptr;
6602 char *ptr;
6603 int scl_val[XLFD_SCL_LAST], *field, *val; 6612 int scl_val[XLFD_SCL_LAST], *field, *val;
6604 char *longest_start, *cur_start, *nonspecial; 6613 char *longest_start, *cur_start, *nonspecial;
6605 int longest_len, exact; 6614 int longest_len, exact;
@@ -6723,6 +6732,7 @@ mac_do_list_fonts (pattern, maxnames)
6723 { 6732 {
6724 int former_len = ptr - font_name_table[i]; 6733 int former_len = ptr - font_name_table[i];
6725 6734
6735 scaled = xmalloc (strlen (font_name_table[i]) + 20 + 1);
6726 memcpy (scaled, font_name_table[i], former_len); 6736 memcpy (scaled, font_name_table[i], former_len);
6727 sprintf (scaled + former_len, 6737 sprintf (scaled + former_len,
6728 "-%d-%d-75-75-m-%d-%s", 6738 "-%d-%d-75-75-m-%d-%s",
@@ -6732,6 +6742,7 @@ mac_do_list_fonts (pattern, maxnames)
6732 ptr + sizeof ("-0-0-0-0-m-0-") - 1); 6742 ptr + sizeof ("-0-0-0-0-m-0-") - 1);
6733 fontname = mac_c_string_match (pattern_regex, scaled, 6743 fontname = mac_c_string_match (pattern_regex, scaled,
6734 nonspecial, exact); 6744 nonspecial, exact);
6745 xfree (scaled);
6735 if (!NILP (fontname)) 6746 if (!NILP (fontname))
6736 { 6747 {
6737 font_list = Fcons (fontname, font_list); 6748 font_list = Fcons (fontname, font_list);
@@ -6852,7 +6863,7 @@ x_font_min_bounds (font, w, h)
6852 the values computed. Value is non-zero if smallest_font_height or 6863 the values computed. Value is non-zero if smallest_font_height or
6853 smallest_char_width become smaller than they were before. */ 6864 smallest_char_width become smaller than they were before. */
6854 6865
6855int 6866static int
6856x_compute_min_glyph_bounds (f) 6867x_compute_min_glyph_bounds (f)
6857 struct frame *f; 6868 struct frame *f;
6858{ 6869{
@@ -6937,7 +6948,8 @@ XLoadQueryFont (Display *dpy, char *fontname)
6937 GrafPtr port; 6948 GrafPtr port;
6938 SInt16 old_fontnum, old_fontsize; 6949 SInt16 old_fontnum, old_fontsize;
6939 Style old_fontface; 6950 Style old_fontface;
6940 Str32 mfontname, mfontname_decoded, charset; 6951 Str255 mfontname, mfontname_decoded;
6952 Str31 charset;
6941 SInt16 fontnum; 6953 SInt16 fontnum;
6942 Style fontface; 6954 Style fontface;
6943#if TARGET_API_MAC_CARBON 6955#if TARGET_API_MAC_CARBON
@@ -7329,7 +7341,7 @@ x_load_font (f, fontname, size)
7329 before, or if the font loaded has a smalle>r height than any 7341 before, or if the font loaded has a smalle>r height than any
7330 other font loaded before. If this happens, it will make a 7342 other font loaded before. If this happens, it will make a
7331 glyph matrix reallocation necessary. */ 7343 glyph matrix reallocation necessary. */
7332 fonts_changed_p = x_compute_min_glyph_bounds (f); 7344 fonts_changed_p |= x_compute_min_glyph_bounds (f);
7333 UNBLOCK_INPUT; 7345 UNBLOCK_INPUT;
7334 return fontp; 7346 return fontp;
7335 } 7347 }