diff options
| author | Paul Eggert | 2011-02-11 21:13:34 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-02-11 21:13:34 -0800 |
| commit | af59aa6e3c661fcd547df8bc4175750f9edb20ec (patch) | |
| tree | 6599c3ee9a310850bb8134e1c1d5a24958648b12 /src | |
| parent | e87977013bd12fb0011936e9643d5b69f5452cd2 (diff) | |
| download | emacs-af59aa6e3c661fcd547df8bc4175750f9edb20ec.tar.gz emacs-af59aa6e3c661fcd547df8bc4175750f9edb20ec.zip | |
Port to Solaris 10, which doesn't support FC_HINT_STYLE.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/xftfont.c | 8 | ||||
| -rw-r--r-- | src/xsettings.c | 23 |
3 files changed, 27 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ba3bbb71b7e..4ef9778ca48 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-02-12 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Port to Solaris 10, which doesn't support FC_HINT_STYLE. | ||
| 4 | * xftfont.c (FC_HINT_STYLE): #define to "hintstyle" if not | ||
| 5 | defined. | ||
| 6 | * xsettings.c (parse_settings, apply_xft_settings): Don't assume | ||
| 7 | FC_HINT_STYLE is supported. | ||
| 8 | |||
| 1 | 2011-02-11 Jan Djärv <jan.h.d@swipnet.se> | 9 | 2011-02-11 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 10 | ||
| 3 | * xterm.c (x_set_frame_alpha): Access data before it is free:d. | 11 | * xterm.c (x_set_frame_alpha): Access data before it is free:d. |
diff --git a/src/xftfont.c b/src/xftfont.c index 084ca735171..695527c4236 100644 --- a/src/xftfont.c +++ b/src/xftfont.c | |||
| @@ -187,17 +187,20 @@ xftfont_fix_match (FcPattern *pat, FcPattern *match) | |||
| 187 | double dpi; | 187 | double dpi; |
| 188 | 188 | ||
| 189 | FcPatternGetBool (pat, FC_ANTIALIAS, 0, &b); | 189 | FcPatternGetBool (pat, FC_ANTIALIAS, 0, &b); |
| 190 | if (! b) | 190 | if (! b) |
| 191 | { | 191 | { |
| 192 | FcPatternDel (match, FC_ANTIALIAS); | 192 | FcPatternDel (match, FC_ANTIALIAS); |
| 193 | FcPatternAddBool (match, FC_ANTIALIAS, FcFalse); | 193 | FcPatternAddBool (match, FC_ANTIALIAS, FcFalse); |
| 194 | } | 194 | } |
| 195 | FcPatternGetBool (pat, FC_HINTING, 0, &b); | 195 | FcPatternGetBool (pat, FC_HINTING, 0, &b); |
| 196 | if (! b) | 196 | if (! b) |
| 197 | { | 197 | { |
| 198 | FcPatternDel (match, FC_HINTING); | 198 | FcPatternDel (match, FC_HINTING); |
| 199 | FcPatternAddBool (match, FC_HINTING, FcFalse); | 199 | FcPatternAddBool (match, FC_HINTING, FcFalse); |
| 200 | } | 200 | } |
| 201 | #ifndef FC_HINT_STYLE | ||
| 202 | # define FC_HINT_STYLE "hintstyle" | ||
| 203 | #endif | ||
| 201 | if (FcResultMatch == FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &i)) | 204 | if (FcResultMatch == FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &i)) |
| 202 | { | 205 | { |
| 203 | FcPatternDel (match, FC_HINT_STYLE); | 206 | FcPatternDel (match, FC_HINT_STYLE); |
| @@ -781,4 +784,3 @@ syms_of_xftfont (void) | |||
| 781 | 784 | ||
| 782 | register_font_driver (&xftfont_driver, NULL); | 785 | register_font_driver (&xftfont_driver, NULL); |
| 783 | } | 786 | } |
| 784 | |||
diff --git a/src/xsettings.c b/src/xsettings.c index e3d2c6e9efb..097b2477e03 100644 --- a/src/xsettings.c +++ b/src/xsettings.c | |||
| @@ -75,7 +75,7 @@ enum { | |||
| 75 | SEEN_FONT = 0x40, | 75 | SEEN_FONT = 0x40, |
| 76 | SEEN_TB_STYLE = 0x80, | 76 | SEEN_TB_STYLE = 0x80, |
| 77 | }; | 77 | }; |
| 78 | struct xsettings | 78 | struct xsettings |
| 79 | { | 79 | { |
| 80 | #ifdef HAVE_XFT | 80 | #ifdef HAVE_XFT |
| 81 | FcBool aa, hinting; | 81 | FcBool aa, hinting; |
| @@ -104,7 +104,7 @@ something_changedCB (GConfClient *client, | |||
| 104 | gpointer user_data) | 104 | gpointer user_data) |
| 105 | { | 105 | { |
| 106 | GConfValue *v = gconf_entry_get_value (entry); | 106 | GConfValue *v = gconf_entry_get_value (entry); |
| 107 | 107 | ||
| 108 | if (!v) return; | 108 | if (!v) return; |
| 109 | if (v->type == GCONF_VALUE_STRING) | 109 | if (v->type == GCONF_VALUE_STRING) |
| 110 | { | 110 | { |
| @@ -196,7 +196,7 @@ get_prop_window (struct x_display_info *dpyinfo) | |||
| 196 | 4 CARD32 last-change-serial | 196 | 4 CARD32 last-change-serial |
| 197 | 197 | ||
| 198 | and then the value, For string: | 198 | and then the value, For string: |
| 199 | 199 | ||
| 200 | bytes type what | 200 | bytes type what |
| 201 | ------------------------------------ | 201 | ------------------------------------ |
| 202 | 4 CARD32 n = value-length | 202 | 4 CARD32 n = value-length |
| @@ -280,7 +280,7 @@ parse_settings (unsigned char *prop, | |||
| 280 | (strcmp (XSETTINGS_FONT_NAME, name) == 0) | 280 | (strcmp (XSETTINGS_FONT_NAME, name) == 0) |
| 281 | || (strcmp (XSETTINGS_TOOL_BAR_STYLE, name) == 0); | 281 | || (strcmp (XSETTINGS_TOOL_BAR_STYLE, name) == 0); |
| 282 | 282 | ||
| 283 | switch (type) | 283 | switch (type) |
| 284 | { | 284 | { |
| 285 | case 0: /* Integer */ | 285 | case 0: /* Integer */ |
| 286 | if (bytes_parsed+4 > bytes) return BadLength; | 286 | if (bytes_parsed+4 > bytes) return BadLength; |
| @@ -310,14 +310,14 @@ parse_settings (unsigned char *prop, | |||
| 310 | case 2: /* RGB value */ | 310 | case 2: /* RGB value */ |
| 311 | /* No need to parse this */ | 311 | /* No need to parse this */ |
| 312 | if (bytes_parsed+8 > bytes) return BadLength; | 312 | if (bytes_parsed+8 > bytes) return BadLength; |
| 313 | bytes_parsed += 8; /* 4 values (r, b, g, alpha), 2 bytes each. */ | 313 | bytes_parsed += 8; /* 4 values (r, b, g, alpha), 2 bytes each. */ |
| 314 | break; | 314 | break; |
| 315 | 315 | ||
| 316 | default: /* Parse Error */ | 316 | default: /* Parse Error */ |
| 317 | return BadValue; | 317 | return BadValue; |
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | if (want_this) | 320 | if (want_this) |
| 321 | { | 321 | { |
| 322 | ++settings_seen; | 322 | ++settings_seen; |
| 323 | if (strcmp (name, XSETTINGS_FONT_NAME) == 0) | 323 | if (strcmp (name, XSETTINGS_FONT_NAME) == 0) |
| @@ -341,6 +341,7 @@ parse_settings (unsigned char *prop, | |||
| 341 | settings->seen |= SEEN_HINTING; | 341 | settings->seen |= SEEN_HINTING; |
| 342 | settings->hinting = ival != 0; | 342 | settings->hinting = ival != 0; |
| 343 | } | 343 | } |
| 344 | # ifdef FC_HINT_STYLE | ||
| 344 | else if (strcmp (name, "Xft/HintStyle") == 0) | 345 | else if (strcmp (name, "Xft/HintStyle") == 0) |
| 345 | { | 346 | { |
| 346 | settings->seen |= SEEN_HINTSTYLE; | 347 | settings->seen |= SEEN_HINTSTYLE; |
| @@ -355,6 +356,7 @@ parse_settings (unsigned char *prop, | |||
| 355 | else | 356 | else |
| 356 | settings->seen &= ~SEEN_HINTSTYLE; | 357 | settings->seen &= ~SEEN_HINTSTYLE; |
| 357 | } | 358 | } |
| 359 | # endif | ||
| 358 | else if (strcmp (name, "Xft/RGBA") == 0) | 360 | else if (strcmp (name, "Xft/RGBA") == 0) |
| 359 | { | 361 | { |
| 360 | settings->seen |= SEEN_RGBA; | 362 | settings->seen |= SEEN_RGBA; |
| @@ -442,7 +444,9 @@ apply_xft_settings (struct x_display_info *dpyinfo, | |||
| 442 | pat); | 444 | pat); |
| 443 | FcPatternGetBool (pat, FC_ANTIALIAS, 0, &oldsettings.aa); | 445 | FcPatternGetBool (pat, FC_ANTIALIAS, 0, &oldsettings.aa); |
| 444 | FcPatternGetBool (pat, FC_HINTING, 0, &oldsettings.hinting); | 446 | FcPatternGetBool (pat, FC_HINTING, 0, &oldsettings.hinting); |
| 447 | # ifdef FC_HINT_STYLE | ||
| 445 | FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &oldsettings.hintstyle); | 448 | FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &oldsettings.hintstyle); |
| 449 | # endif | ||
| 446 | FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &oldsettings.lcdfilter); | 450 | FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &oldsettings.lcdfilter); |
| 447 | FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba); | 451 | FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba); |
| 448 | FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi); | 452 | FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi); |
| @@ -488,6 +492,7 @@ apply_xft_settings (struct x_display_info *dpyinfo, | |||
| 488 | if (strlen (buf) > 0) strcat (buf, ", "); | 492 | if (strlen (buf) > 0) strcat (buf, ", "); |
| 489 | sprintf (buf+strlen (buf), "LCDFilter: %d", oldsettings.lcdfilter); | 493 | sprintf (buf+strlen (buf), "LCDFilter: %d", oldsettings.lcdfilter); |
| 490 | 494 | ||
| 495 | # ifdef FC_HINT_STYLE | ||
| 491 | if ((settings->seen & SEEN_HINTSTYLE) != 0 | 496 | if ((settings->seen & SEEN_HINTSTYLE) != 0 |
| 492 | && oldsettings.hintstyle != settings->hintstyle) | 497 | && oldsettings.hintstyle != settings->hintstyle) |
| 493 | { | 498 | { |
| @@ -496,6 +501,7 @@ apply_xft_settings (struct x_display_info *dpyinfo, | |||
| 496 | ++changed; | 501 | ++changed; |
| 497 | oldsettings.hintstyle = settings->hintstyle; | 502 | oldsettings.hintstyle = settings->hintstyle; |
| 498 | } | 503 | } |
| 504 | # endif | ||
| 499 | if (strlen (buf) > 0) strcat (buf, ", "); | 505 | if (strlen (buf) > 0) strcat (buf, ", "); |
| 500 | sprintf (buf+strlen (buf), "Hintstyle: %d", oldsettings.hintstyle); | 506 | sprintf (buf+strlen (buf), "Hintstyle: %d", oldsettings.hintstyle); |
| 501 | 507 | ||
| @@ -508,7 +514,7 @@ apply_xft_settings (struct x_display_info *dpyinfo, | |||
| 508 | FcPatternAddDouble (pat, FC_DPI, settings->dpi); | 514 | FcPatternAddDouble (pat, FC_DPI, settings->dpi); |
| 509 | ++changed; | 515 | ++changed; |
| 510 | oldsettings.dpi = settings->dpi; | 516 | oldsettings.dpi = settings->dpi; |
| 511 | 517 | ||
| 512 | /* Change the DPI on this display and all frames on the display. */ | 518 | /* Change the DPI on this display and all frames on the display. */ |
| 513 | dpyinfo->resy = dpyinfo->resx = settings->dpi; | 519 | dpyinfo->resy = dpyinfo->resx = settings->dpi; |
| 514 | FOR_EACH_FRAME (tail, frame) | 520 | FOR_EACH_FRAME (tail, frame) |
| @@ -565,7 +571,7 @@ read_and_apply_settings (struct x_display_info *dpyinfo, int send_event_p) | |||
| 565 | 571 | ||
| 566 | if (settings.seen & SEEN_FONT) | 572 | if (settings.seen & SEEN_FONT) |
| 567 | { | 573 | { |
| 568 | if (!current_font || strcmp (current_font, settings.font) != 0) | 574 | if (!current_font || strcmp (current_font, settings.font) != 0) |
| 569 | { | 575 | { |
| 570 | free (current_font); | 576 | free (current_font); |
| 571 | current_font = settings.font; | 577 | current_font = settings.font; |
| @@ -774,4 +780,3 @@ If this variable is nil, Emacs ignores system font changes. */); | |||
| 774 | 780 | ||
| 775 | Fprovide (intern_c_string ("dynamic-setting"), Qnil); | 781 | Fprovide (intern_c_string ("dynamic-setting"), Qnil); |
| 776 | } | 782 | } |
| 777 | |||