Mercurial > emacs
comparison lisp/ps-mule.el @ 61074:6a54f94240ca
(ps-mule-plot-string): Translate characters by
ps-print-translation-table.
(ps-mule-begin-job): Call find-charset-region/string with
ps-print-translation-table.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 29 Mar 2005 05:07:16 +0000 |
parents | 0d38d6148c13 |
children | d1615c2ff814 |
comparison
equal
deleted
inserted
replaced
61073:449d2654bc2d | 61074:6a54f94240ca |
---|---|
822 | 822 |
823 (ENDPOS . RUN-WIDTH) | 823 (ENDPOS . RUN-WIDTH) |
824 | 824 |
825 Where ENDPOS is the end position of the sequence and RUN-WIDTH is the width of | 825 Where ENDPOS is the end position of the sequence and RUN-WIDTH is the width of |
826 the sequence." | 826 the sequence." |
827 (setq ps-mule-current-charset (charset-after from)) | 827 (let ((ch (char-after from))) |
828 (setq ps-mule-current-charset | |
829 (char-charset (or (aref ps-print-translation-table ch) ch)))) | |
828 (let* ((wrappoint (ps-mule-find-wrappoint | 830 (let* ((wrappoint (ps-mule-find-wrappoint |
829 from to (ps-avg-char-width 'ps-font-for-text))) | 831 from to (ps-avg-char-width 'ps-font-for-text))) |
830 (to (car wrappoint)) | 832 (to (car wrappoint)) |
831 (font-type (car (nth ps-current-font | 833 (font-type (car (nth ps-current-font |
832 (ps-font-alist 'ps-font-for-text)))) | 834 (ps-font-alist 'ps-font-for-text)))) |
833 (font-spec (ps-mule-get-font-spec ps-mule-current-charset font-type)) | 835 (font-spec (ps-mule-get-font-spec ps-mule-current-charset font-type)) |
834 (string (buffer-substring-no-properties from to))) | 836 (string (buffer-substring-no-properties from to))) |
837 (dotimes (i (length string)) | |
838 (let ((ch (aref ps-print-translation-table (aref string i)))) | |
839 (if ch | |
840 (aset string i ch)))) | |
835 (cond | 841 (cond |
836 ((= from to) | 842 ((= from to) |
837 ;; We can't print any more characters in the current line. | 843 ;; We can't print any more characters in the current line. |
838 nil) | 844 nil) |
839 | 845 |
1467 (let ((header-footer-list (ps-header-footer-string)) | 1473 (let ((header-footer-list (ps-header-footer-string)) |
1468 unprintable-charsets) | 1474 unprintable-charsets) |
1469 (setq ps-mule-charset-list | 1475 (setq ps-mule-charset-list |
1470 (delq 'ascii (delq 'eight-bit-control | 1476 (delq 'ascii (delq 'eight-bit-control |
1471 (delq 'eight-bit-graphic | 1477 (delq 'eight-bit-graphic |
1472 (find-charset-region from to)))) | 1478 (find-charset-region |
1479 from to ps-print-translation-table)))) | |
1473 ps-mule-header-charsets | 1480 ps-mule-header-charsets |
1474 (delq 'ascii (delq 'eight-bit-control | 1481 (delq 'ascii (delq 'eight-bit-control |
1475 (delq 'eight-bit-graphic | 1482 (delq 'eight-bit-graphic |
1476 (find-charset-string | 1483 (find-charset-string |
1477 (mapconcat | 1484 (mapconcat |
1478 'identity header-footer-list "")))))) | 1485 'identity header-footer-list "") |
1486 ps-print-translation-table))))) | |
1479 (dolist (cs ps-mule-charset-list) | 1487 (dolist (cs ps-mule-charset-list) |
1480 (or (ps-mule-printable-p cs) | 1488 (or (ps-mule-printable-p cs) |
1481 (push cs unprintable-charsets))) | 1489 (push cs unprintable-charsets))) |
1482 (dolist (cs ps-mule-header-charsets) | 1490 (dolist (cs ps-mule-header-charsets) |
1483 (or (ps-mule-printable-p cs) | 1491 (or (ps-mule-printable-p cs) |