418 |
|
|
419 |
(defun ps-mule-encode-bit (string delta) |
(defun ps-mule-encode-bit (string delta) |
420 |
(let* ((dim (charset-dimension (char-charset (string-to-char string)))) |
(let* ((dim (charset-dimension (char-charset (string-to-char string)))) |
421 |
(len (* (ps-mule-chars-in-string string) dim)) |
(len (* (length string) dim)) |
422 |
(str (make-string len 0)) |
(str (make-string len 0)) |
423 |
(i 0) |
(i 0) |
424 |
(j 0)) |
(j 0)) |
425 |
(if (= dim 1) |
(if (= dim 1) |
426 |
(while (< j len) |
(while (< j len) |
427 |
(aset str j |
(aset str j |
428 |
(+ (nth 1 (split-char (ps-mule-string-char string i))) delta)) |
(+ (nth 1 (split-char (aref string i))) delta)) |
429 |
(setq i (ps-mule-next-index string i) |
(setq i (1+ i) |
430 |
j (1+ j))) |
j (1+ j))) |
431 |
(while (< j len) |
(while (< j len) |
432 |
(let ((split (split-char (ps-mule-string-char string i)))) |
(let ((split (split-char (aref string i)))) |
433 |
(aset str j (+ (nth 1 split) delta)) |
(aset str j (+ (nth 1 split) delta)) |
434 |
(aset str (1+ j) (+ (nth 2 split) delta)) |
(aset str (1+ j) (+ (nth 2 split) delta)) |
435 |
(setq i (ps-mule-next-index string i) |
(setq i (1+ i) |
436 |
j (+ j 2))))) |
j (+ j 2))))) |
437 |
str)) |
str)) |
438 |
|
|
468 |
|
|
469 |
;; Special encoding for mule-unicode-* characters. |
;; Special encoding for mule-unicode-* characters. |
470 |
(defun ps-mule-encode-ucs2 (string) |
(defun ps-mule-encode-ucs2 (string) |
471 |
(let* ((len (ps-mule-chars-in-string string)) |
(let* ((len (length string)) |
472 |
(str (make-string (* 2 len) 0)) |
(str (make-string (* 2 len) 0)) |
473 |
(i 0) |
(i 0) |
474 |
(j 0) |
(j 0) |
475 |
ch hi lo) |
ch hi lo) |
476 |
(while (< i len) |
(while (< i len) |
477 |
(setq ch (encode-char (ps-mule-string-char string i) 'ucs) |
(setq ch (encode-char (aref string i) 'ucs) |
478 |
hi (lsh ch -8) |
hi (lsh ch -8) |
479 |
lo (logand ch 255)) |
lo (logand ch 255)) |
480 |
(aset str j hi) |
(aset str j hi) |
796 |
(cons from ps-width-remaining) |
(cons from ps-width-remaining) |
797 |
(cons (if composition |
(cons (if composition |
798 |
(nth 1 composition) |
(nth 1 composition) |
799 |
(ps-mule-next-point from)) |
(1+ from)) |
800 |
run-width))) |
run-width))) |
801 |
;; We assume that all characters in this range have the same width. |
;; We assume that all characters in this range have the same width. |
802 |
(setq char-width (* char-width (charset-width ps-mule-current-charset))) |
(setq char-width (* char-width (charset-width ps-mule-current-charset))) |
849 |
|
|
850 |
;; This case is obsolete for Emacs 21. |
;; This case is obsolete for Emacs 21. |
851 |
((eq ps-mule-current-charset 'composition) |
((eq ps-mule-current-charset 'composition) |
852 |
(ps-mule-plot-composition from (ps-mule-next-point from) bg-color)) |
(ps-mule-plot-composition from (1+ from) bg-color)) |
853 |
|
|
854 |
(t |
(t |
855 |
;; No way to print this charset. Just show a vacant box of an |
;; No way to print this charset. Just show a vacant box of an |