diff options
| author | Kenichi Handa | 2008-07-14 07:48:03 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-07-14 07:48:03 +0000 |
| commit | 2f73901fa171a9c584731f7bebf8c7bdc7378e9b (patch) | |
| tree | 722185acfaf425027c0a7ccef7c9265451ac6fa1 /src | |
| parent | 11da284dbd2d879fa8075d3f0007b83356e8264e (diff) | |
| download | emacs-2f73901fa171a9c584731f7bebf8c7bdc7378e9b.tar.gz emacs-2f73901fa171a9c584731f7bebf8c7bdc7378e9b.zip | |
(xfont_open): Add workaround for X's bug.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/xfont.c | 29 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e75ce4c4576..80b6ff8922b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2008-07-14 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * xfont.c (xfont_open): Add workaround for X's bug. | ||
| 4 | |||
| 1 | 2008-07-14 Emanuele Giaquinta <emanuele.giaquinta@gmail.com> (tiny change) | 5 | 2008-07-14 Emanuele Giaquinta <emanuele.giaquinta@gmail.com> (tiny change) |
| 2 | 6 | ||
| 3 | * fontset.c: Include <stdio.h> unconditionally. | 7 | * fontset.c: Include <stdio.h> unconditionally. |
diff --git a/src/xfont.c b/src/xfont.c index 544088bce36..83a8c770f86 100644 --- a/src/xfont.c +++ b/src/xfont.c | |||
| @@ -540,6 +540,35 @@ xfont_open (f, entity, pixel_size) | |||
| 540 | x_clear_errors (display); | 540 | x_clear_errors (display); |
| 541 | xfont = NULL; | 541 | xfont = NULL; |
| 542 | } | 542 | } |
| 543 | else if (! xfont) | ||
| 544 | { | ||
| 545 | /* Some version of X lists: | ||
| 546 | -misc-fixed-medium-r-normal--20-*-75-75-c-100-iso8859-1 | ||
| 547 | -misc-fixed-medium-r-normal--20-*-100-100-c-100-iso8859-1 | ||
| 548 | but can open only: | ||
| 549 | -misc-fixed-medium-r-normal--20-*-100-100-c-100-iso8859-1 | ||
| 550 | and | ||
| 551 | -misc-fixed-medium-r-normal--20-*-*-*-c-100-iso8859-1 | ||
| 552 | So, we try again with wildcards in RESX and RESY. */ | ||
| 553 | Lisp_Object temp; | ||
| 554 | |||
| 555 | temp = Fcopy_font_spec (entity); | ||
| 556 | ASET (temp, FONT_DPI_INDEX, Qnil); | ||
| 557 | len = font_unparse_xlfd (temp, pixel_size, name, 256); | ||
| 558 | if (len <= 0) | ||
| 559 | { | ||
| 560 | font_add_log (" x:unparse failed", temp, Qnil); | ||
| 561 | return Qnil; | ||
| 562 | } | ||
| 563 | xfont = XLoadQueryFont (display, name); | ||
| 564 | if (x_had_errors_p (display)) | ||
| 565 | { | ||
| 566 | /* This error is perhaps due to insufficient memory on X server. | ||
| 567 | Let's just ignore it. */ | ||
| 568 | x_clear_errors (display); | ||
| 569 | xfont = NULL; | ||
| 570 | } | ||
| 571 | } | ||
| 543 | fullname = Qnil; | 572 | fullname = Qnil; |
| 544 | /* Try to get the full name of FONT. */ | 573 | /* Try to get the full name of FONT. */ |
| 545 | if (xfont && XGetFontProperty (xfont, XA_FONT, &value)) | 574 | if (xfont && XGetFontProperty (xfont, XA_FONT, &value)) |