diff options
| author | Kenichi Handa | 2010-10-14 11:03:25 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2010-10-14 11:03:25 +0900 |
| commit | 7ca9cfdaabe5c7dcc151f5da19b1fc7fd2b703e6 (patch) | |
| tree | 28742a79321cbbb19511cc835c5ee3f124bf6932 | |
| parent | ad1746f5db1b4c52da8d7bdc52359d6b0a5a5e24 (diff) | |
| download | emacs-7ca9cfdaabe5c7dcc151f5da19b1fc7fd2b703e6.tar.gz emacs-7ca9cfdaabe5c7dcc151f5da19b1fc7fd2b703e6.zip | |
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/ps-mule.el | 50 |
2 files changed, 27 insertions, 30 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f3275116a9b..bbb1baf5d6f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2010-10-14 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * ps-mule.el (ps-mule-font-spec-list): Delete it. Not used | ||
| 4 | anymore. | ||
| 5 | (ps-mule-begin-job): Fix for the case that only ENCODING is set in | ||
| 6 | a font-spec (bug#7197). | ||
| 7 | |||
| 1 | 2010-10-10 Jan Djärv <jan.h.d@swipnet.se> | 8 | 2010-10-10 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 9 | ||
| 3 | * term/ns-win.el (ns-right-alternate-modifier): New defvar. | 10 | * term/ns-win.el (ns-right-alternate-modifier): New defvar. |
diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el index 51c4cc20bec..0fcb6dff79b 100644 --- a/lisp/ps-mule.el +++ b/lisp/ps-mule.el | |||
| @@ -319,31 +319,19 @@ by `ps-font-family' and `ps-header-font-family'. | |||
| 319 | 319 | ||
| 320 | See also `ps-mule-font-info-database-bdf'.") | 320 | See also `ps-mule-font-info-database-bdf'.") |
| 321 | 321 | ||
| 322 | (defvar ps-mule-font-spec-list nil | ||
| 323 | "Array of FONT-SPEC lists for each font type. | ||
| 324 | |||
| 325 | Elements are for `normal' font, `bold' font, `italic' font, and | ||
| 326 | `bold-italic' font in this order. | ||
| 327 | |||
| 328 | Each element is a list of FONT-SPEC which has this form: | ||
| 329 | |||
| 330 | (ID CHARSET (FONT-SRC FONT-NAME ENCODING) EXTRA-DATA) | ||
| 331 | |||
| 332 | Where | ||
| 333 | |||
| 334 | ID is a number for this FONT-SPEC and is unique in the list. | ||
| 335 | |||
| 336 | CHARSET, FONT-SRC, FONT-NAME, ENCODING are the same as those in | ||
| 337 | `ps-mule-font-info-database' (which see). | ||
| 338 | |||
| 339 | EXTRA-DATA is a data attached by external libraries. | ||
| 340 | |||
| 341 | Each list is ordered by the current charset priorities. | ||
| 342 | |||
| 343 | This variable is setup by `ps-mule-begin-job' from | ||
| 344 | `ps-mule-font-info-database'.") | ||
| 345 | |||
| 346 | ;; Functions to access each element of FONT-SPEC. | 322 | ;; Functions to access each element of FONT-SPEC. |
| 323 | ;; | ||
| 324 | ;; FONT-SPEC is a vector of this form: | ||
| 325 | ;; [ID CHARSET FONT-ID FONT-SRC FONT-NAME ENCODING BYTES EXTRA-DATA] | ||
| 326 | ;; Where | ||
| 327 | ;; | ||
| 328 | ;; ID is an identification number for this FONT-SPEC and is unique in the list. | ||
| 329 | ;; | ||
| 330 | ;; CHARSET, FONT-SRC, FONT-NAME, ENCODING, and BYTES are the same as those in | ||
| 331 | ;; `ps-mule-font-info-database' (which see). | ||
| 332 | ;; | ||
| 333 | ;; EXTRA-DATA is a data attached by external libraries. | ||
| 334 | |||
| 347 | (defsubst ps-mule-font-spec-id (font-spec) (aref font-spec 0)) | 335 | (defsubst ps-mule-font-spec-id (font-spec) (aref font-spec 0)) |
| 348 | (defsubst ps-mule-font-spec-charset (font-spec) (aref font-spec 1)) | 336 | (defsubst ps-mule-font-spec-charset (font-spec) (aref font-spec 1)) |
| 349 | (defsubst ps-mule-font-spec-font-id (font-spec) (aref font-spec 2)) | 337 | (defsubst ps-mule-font-spec-font-id (font-spec) (aref font-spec 2)) |
| @@ -1043,7 +1031,7 @@ It checks if all multi-byte characters in the region are printable or not." | |||
| 1043 | (if (and (not (find-composition from to)) | 1031 | (if (and (not (find-composition from to)) |
| 1044 | (save-excursion | 1032 | (save-excursion |
| 1045 | (goto-char from) | 1033 | (goto-char from) |
| 1046 | (= (skip-chars-forward "\x00-\xFF" to) to))) | 1034 | (= (skip-chars-forward "\x00-\x7F" to) to))) |
| 1047 | ;; All characters can be printed by normal PostScript fonts. | 1035 | ;; All characters can be printed by normal PostScript fonts. |
| 1048 | (setq ps-basic-plot-string-function 'ps-basic-plot-string | 1036 | (setq ps-basic-plot-string-function 'ps-basic-plot-string |
| 1049 | ps-encode-header-string-function 'identity) | 1037 | ps-encode-header-string-function 'identity) |
| @@ -1085,17 +1073,19 @@ It checks if all multi-byte characters in the region are printable or not." | |||
| 1085 | (setq font-info-list (cons font-info font-info-list)))) | 1073 | (setq font-info-list (cons font-info font-info-list)))) |
| 1086 | (setq font-info-list (nreverse font-info-list))) | 1074 | (setq font-info-list (nreverse font-info-list))) |
| 1087 | 1075 | ||
| 1076 | ;; Now font-info-list is an alist ordered by charset priority. | ||
| 1088 | ;; Store FONT-SPECs in each element of font-spec-alist. | 1077 | ;; Store FONT-SPECs in each element of font-spec-alist. |
| 1089 | (dolist (font-info font-info-list) | 1078 | (dolist (font-info font-info-list) |
| 1090 | (let ((font-spec-vec (make-vector 4 nil)) | 1079 | (let ((font-spec-vec (make-vector 4 nil)) |
| 1091 | (charset (car font-info)) | 1080 | (charset (car font-info)) |
| 1092 | encoding font-spec) | 1081 | encoding bytes font-spec) |
| 1093 | (dolist (e (cdr font-info)) | 1082 | (dolist (e (cdr font-info)) |
| 1094 | (setq encoding (or (nth 3 e) charset) | 1083 | (setq encoding (nth 3 e) bytes (nth 4 e)) |
| 1095 | font-spec (vector id-max charset font-id | 1084 | (unless encoding |
| 1085 | (setq encoding charset bytes (charset-dimension charset))) | ||
| 1086 | (setq font-spec (vector id-max charset font-id | ||
| 1096 | (nth 1 e) (nth 2 e) encoding | 1087 | (nth 1 e) (nth 2 e) encoding |
| 1097 | (or (nth 4 e) (charset-dimension encoding)) | 1088 | (or bytes 1) nil) |
| 1098 | nil) | ||
| 1099 | id-max (1+ id-max)) | 1089 | id-max (1+ id-max)) |
| 1100 | (if (ps-mule-check-font font-spec) | 1090 | (if (ps-mule-check-font font-spec) |
| 1101 | (aset font-spec-vec | 1091 | (aset font-spec-vec |