• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/

Lines Matching defs:mule

1 ;;; ps-mule.el --- provide multi-byte character facility to ps-print
10 ;; Keywords: wp, print, PostScript, multibyte, mule
33 ;; About ps-mule
53 ;; `ps-mule-font-info-database-default' differently.
55 ;; `ps-mule-font-info-database-latin' (see
178 `ps-mule-font-info-database-default' differently.
180 `ps-mule-font-info-database-latin' (see
215 (defvar ps-mule-font-info-database
257 (defconst ps-mule-font-info-database-latin
260 "Sample setting of `ps-mule-font-info-database' to use latin fonts.")
262 (defcustom ps-mule-font-info-database-default
263 ps-mule-font-info-database-latin
268 (defconst ps-mule-font-info-database-ps
270 (normal builtin "Ryumin-Light.Katakana" ps-mule-encode-7bit 1)
271 (bold builtin "GothicBBB-Medium.Katakana" ps-mule-encode-7bit 1)
272 (bold-italic builtin "GothicBBB-Medium.Katakana" ps-mule-encode-7bit 1))
274 (normal builtin "Ryumin-Light.Hankaku" ps-mule-encode-7bit 1)
275 (bold builtin "GothicBBB-Medium.Hankaku" ps-mule-encode-7bit 1))
277 (normal builtin "Ryumin-Light-H" ps-mule-encode-7bit 2)
278 (bold builtin "GothicBBB-Medium-H" ps-mule-encode-7bit 2))
280 (normal builtin "Munhwa-Regular-KSC-EUC-H" ps-mule-encode-7bit 2)
281 (bold builtin "Munhwa-Bold-KSC-EUC-H" ps-mule-encode-7bit 2))
283 "Sample setting of the `ps-mule-font-info-database' to use builtin PS font.
287 (defconst ps-mule-font-info-database-bdf
312 (normal bdf "12x24rk.bdf" ps-mule-encode-8bit 1))
314 (normal bdf "12x24rk.bdf" ps-mule-encode-7bit 1))
320 (normal bdf "jiskan24.bdf" ps-mule-encode-7bit 2))
322 (normal bdf "gb24st.bdf" ps-mule-encode-7bit 2))
324 (normal bdf "jiskan24.bdf" ps-mule-encode-7bit 2))
326 (normal bdf "hanglm24.bdf" ps-mule-encode-7bit 2))
328 (normal bdf ("jksp40.bdf" "jisksp40.bdf") ps-mule-encode-7bit 2))
330 (normal bdf ("cns1-40.bdf" "cns-1-40.bdf") ps-mule-encode-7bit 2))
332 (normal bdf ("cns2-40.bdf" "cns-2-40.bdf") ps-mule-encode-7bit 2))
338 (normal bdf ("sish24-etl.bdf" "etl24-sisheng.bdf") ps-mule-encode-7bit 1))
340 (normal bdf ("ipa24-etl.bdf" "etl24-ipa.bdf") ps-mule-encode-8bit 1))
346 (normal bdf ("arab24-0-etl.bdf" "etl24-arabic0.bdf") ps-mule-encode-7bit 1))
348 (normal bdf ("arab24-1-etl.bdf" "etl24-arabic1.bdf") ps-mule-encode-7bit 1))
351 (normal bdf ("lao24-mule.bdf" "mule-lao-24.bdf") lao 1))
353 (normal bdf ("arab24-2-etl.bdf" "etl24-arabic2.bdf") ps-mule-encode-7bit 1))
355 (normal bdf ("isci24-mule.bdf" "mule-iscii-24.bdf") ps-mule-encode-7bit 1))
357 (normal bdf ("ind1c24-mule.bdf" "mule-indian-1col-24.bdf") ps-mule-encode-7bit 2))
359 (normal bdf ("tib1c24-mule.bdf" "mule-tibmdx-1col-24.bdf") ps-mule-encode-7bit 2))
361 (normal bdf ("ethio24f-uni.bdf" "ethiomx24f-uni.bdf") ps-mule-encode-ethiopic 2))
363 (normal bdf ("cns3-40.bdf" "cns-3-40.bdf") ps-mule-encode-7bit 2))
365 (normal bdf ("cns4-40.bdf" "cns-4-40.bdf") ps-mule-encode-7bit 2))
367 (normal bdf ("cns5-40.bdf" "cns-5-40.bdf") ps-mule-encode-7bit 2))
369 (normal bdf ("cns6-40.bdf" "cns-6-40.bdf") ps-mule-encode-7bit 2))
371 (normal bdf ("cns7-40.bdf" "cns-7-40.bdf") ps-mule-encode-7bit 2))
373 (normal bdf ("ind24-mule.bdf" "mule-indian-24.bdf") ps-mule-encode-7bit 2))
375 (normal bdf ("tib24p-mule.bdf" "tib24-mule.bdf" "mule-tibmdx-24.bdf")
376 ps-mule-encode-7bit 2))
377 (mule-unicode-0100-24ff
378 (normal bdf "etl24-unicode.bdf" ps-mule-encode-ucs2 2))
379 (mule-unicode-2500-33ff
380 (normal bdf "etl24-unicode.bdf" ps-mule-encode-ucs2 2))
381 (mule-unicode-e000-ffff
382 (normal bdf "etl24-unicode.bdf" ps-mule-encode-ucs2 2)))
383 "Sample setting of the `ps-mule-font-info-database' to use BDF fonts.
390 Using this list as default value to `ps-mule-font-info-database', all
393 See also `ps-mule-font-info-database-ps-bdf'.")
395 (defconst ps-mule-font-info-database-ps-bdf
396 (cons (car ps-mule-font-info-database-latin)
397 (cdr (cdr ps-mule-font-info-database-bdf)))
398 "Sample setting of the `ps-mule-font-info-database' to use BDF fonts.
403 Using this list as default value to `ps-mule-font-info-database', all
408 See also `ps-mule-font-info-database-bdf'.")
412 (defun ps-mule-encode-7bit (string)
413 (ps-mule-encode-bit string 0))
415 (defun ps-mule-encode-8bit (string)
416 (ps-mule-encode-bit string 128))
418 (defun ps-mule-encode-bit (string delta)
439 (if (boundp 'mule-version) ; only if mule package is loaded
458 (if (boundp 'mule-version)
459 ;; bound mule-version
460 (defun ps-mule-encode-ethiopic (string)
464 ;; unbound mule-version
465 (defun ps-mule-encode-ethiopic (string)
468 ;; Special encoding for mule-unicode-* characters.
469 (defun ps-mule-encode-ucs2 (string)
486 (defvar ps-mule-current-charset nil)
488 (defun ps-mule-get-font-spec (charset font-type)
494 FONT-SPEC is extracted from `ps-mule-font-info-database'.
496 See the documentation of `ps-mule-font-info-database' for the meaning of each
498 (let ((slot (cdr (assq charset ps-mule-font-info-database))))
506 (defsubst ps-mule-font-spec-src (font-spec) (car font-spec))
507 (defsubst ps-mule-font-spec-name (font-spec) (nth 1 font-spec))
508 (defsubst ps-mule-font-spec-encoding (font-spec) (nth 2 font-spec))
509 (defsubst ps-mule-font-spec-bytes (font-spec) (nth 3 font-spec))
511 (defsubst ps-mule-printable-p (charset)
516 (ps-mule-get-font-spec charset 'normal)))
518 (defconst ps-mule-external-libraries
551 (defun ps-mule-init-external-library (font-spec)
553 See the documentation of `ps-mule-get-font-spec' for FONT-SPEC's meaning."
554 (let* ((font-src (ps-mule-font-spec-src font-spec))
555 (slot (assq font-src ps-mule-external-libraries)))
568 (defvar ps-mule-font-cache nil)
570 (defun ps-mule-generate-font (font-spec charset &optional header-p)
575 (let* ((font-name (ps-mule-font-spec-name font-spec))
577 (font-cache (assoc font-name ps-mule-font-cache))
578 (font-src (ps-mule-font-spec-src font-spec))
579 (func (nth 4 (assq font-src ps-mule-external-libraries)))
598 (eq ps-mule-current-charset 'ascii))
607 ps-mule-font-cache (cons font-cache ps-mule-font-cache)))
610 (defun ps-mule-generate-glyphs (font-spec code-list)
612 (let* ((font-src (ps-mule-font-spec-src font-spec))
613 (func (nth 5 (assq font-src ps-mule-external-libraries))))
617 (ps-mule-font-spec-bytes font-spec))))))
619 (defun ps-mule-prepare-font (font-spec string charset
631 (let* ((font-name (ps-mule-font-spec-name font-spec))
634 (font-cache (assoc font-name ps-mule-font-cache)))
636 (setq font-cache (ps-mule-generate-font font-spec charset header-p)))
643 (if (nth 5 (assq (ps-mule-font-spec-src font-spec)
644 ps-mule-external-libraries))
647 (bytes (ps-mule-font-spec-bytes font-spec))
661 (ps-mule-generate-glyphs font-spec newcodes))))))
664 (defun ps-mule-prepare-ascii-font (string)
668 (ps-mule-get-font-spec
672 (ps-mule-prepare-font font-spec string 'ascii))))
675 (defun ps-mule-set-ascii-font ()
676 (unless (eq ps-mule-current-charset 'ascii)
678 (setq ps-mule-current-charset 'ascii)))
683 (defvar ps-mule-charset-list nil)
686 (defconst ps-mule-prologue
764 (defvar ps-mule-prologue-generated nil)
766 (defun ps-mule-prologue-generated ()
767 (unless ps-mule-prologue-generated
768 (ps-output-prologue ps-mule-prologue)
769 (setq ps-mule-prologue-generated t)))
771 (defun ps-mule-find-wrappoint (from to char-width &optional composition)
780 and TO belong to a charset in `ps-mule-current-charset'. Otherwise,
792 (if (or composition (eq ps-mule-current-charset 'composition))
804 (setq char-width (* char-width (charset-width ps-mule-current-charset)))
816 (defun ps-mule-plot-string (from to &optional bg-color)
830 (setq ps-mule-current-charset
832 (let* ((wrappoint (ps-mule-find-wrappoint
837 (font-spec (ps-mule-get-font-spec ps-mule-current-charset font-type))
850 (ps-output-string (ps-mule-string-encoding font-spec string))
853 ((eq ps-mule-current-charset 'latin-iso8859-1)
855 (ps-output-string (ps-mule-string-ascii string))
859 ((eq ps-mule-current-charset 'composition)
860 (ps-mule-plot-composition from (1+ from) bg-color))
867 (if (eq ps-mule-current-charset 'composition)
869 (charset-width ps-mule-current-charset))))))
873 (defun ps-mule-plot-composition (from to &optional bg-color)
888 (wrappoint (ps-mule-find-wrappoint
897 (ps-mule-plot-components
898 (ps-mule-prepare-font-for-components components font-type)
908 (defun ps-mule-prepare-font-for-components (components font-type)
919 (font (or (eq charset ps-mule-current-charset)
925 (setq ps-mule-current-charset charset
926 str (ps-mule-string-encoding
927 (ps-mule-get-font-spec charset font-type)
937 (defun ps-mule-plot-components (components tail)
960 (defvar ps-mule-composition-prologue-generated nil)
962 (defconst ps-mule-composition-prologue
1138 (defun ps-mule-string-ascii (str)
1146 (defun ps-mule-string-encoding (font-spec str &optional no-setfont header-p)
1147 (let ((encoding (ps-mule-font-spec-encoding font-spec)))
1158 (if (ps-mule-font-spec-src font-spec)
1159 (ps-mule-prepare-font font-spec str ps-mule-current-charset
1168 (defvar ps-mule-bitmap-prologue-generated nil)
1170 (defconst ps-mule-bitmap-prologue
1324 (defun ps-mule-generate-bitmap-prologue ()
1325 (unless ps-mule-bitmap-prologue-generated
1326 (setq ps-mule-bitmap-prologue-generated t)
1327 (list ps-mule-bitmap-prologue)))
1329 (defun ps-mule-generate-bitmap-font (&rest args)
1332 (defun ps-mule-generate-bitmap-glyph (font-name code dwidth bbx bitmap)
1341 (defun ps-mule-initialize ()
1343 (setq ps-mule-font-cache nil
1344 ps-mule-prologue-generated nil
1345 ps-mule-composition-prologue-generated nil
1346 ps-mule-bitmap-prologue-generated nil)
1348 ps-mule-external-libraries))
1350 (defvar ps-mule-header-charsets nil)
1353 (defun ps-mule-encode-header-string (string fonttag)
1362 (when ps-mule-header-charsets
1363 (if (eq (car ps-mule-header-charsets) 'latin-iso8859-1)
1376 (ps-mule-current-charset (car ps-mule-header-charsets))
1379 (font-spec (ps-mule-get-font-spec ps-mule-current-charset
1382 (/= (charset-dimension ps-mule-current-charset) 1))
1394 (let ((charsets (list 'ascii (car ps-mule-header-charsets)))
1401 (setq string (ps-mule-string-encoding font-spec string nil t))))))
1404 (defun ps-mule-show-warning (charsets from to header-footer-list)
1467 (defun ps-mule-begin-job (from to)
1470 (setq ps-mule-charset-list nil
1471 ps-mule-header-charsets nil
1472 ps-mule-font-info-database
1474 ps-mule-font-info-database-ps)
1476 ps-mule-font-info-database-bdf)
1478 ps-mule-font-info-database-ps-bdf)
1480 ps-mule-font-info-database-default)))
1483 ;; Initialize `ps-mule-charset-list'. If some characters aren't
1487 (setq ps-mule-charset-list
1492 ps-mule-header-charsets
1499 (dolist (cs ps-mule-charset-list)
1500 (or (ps-mule-printable-p cs)
1502 (dolist (cs ps-mule-header-charsets)
1503 (or (ps-mule-printable-p cs)
1507 (ps-mule-show-warning unprintable-charsets from to
1513 (or ps-mule-composition-prologue-generated
1526 (ps-mule-prologue-generated)
1527 (ps-output-prologue ps-mule-composition-prologue)
1528 (setq ps-mule-composition-prologue-generated t)))))))
1530 (setq ps-mule-current-charset 'ascii)
1532 (if (or ps-mule-charset-list ps-mule-header-charsets)
1533 (dolist (elt (append ps-mule-header-charsets ps-mule-charset-list))
1534 (ps-mule-prologue-generated)
1535 (ps-mule-init-external-library (ps-mule-get-font-spec elt 'normal))))
1537 ;; If ASCII font is also specified in ps-mule-font-info-database,
1539 (let ((font-spec (ps-mule-get-font-spec 'ascii 'normal)))
1542 (ps-mule-prologue-generated)
1543 (ps-mule-init-external-library font-spec)
1548 (ps-mule-prepare-font (ps-mule-get-font-spec 'ascii (car font))
1555 (if (and ps-mule-header-charsets
1556 (not (eq (car ps-mule-header-charsets) 'latin-iso8859-1))
1557 (= (charset-dimension (car ps-mule-header-charsets)) 1))
1558 (let ((font-spec (ps-mule-get-font-spec (car ps-mule-header-charsets)
1564 (ps-mule-prepare-font font-spec "0123456789/" 'ascii t t)))))
1566 (if ps-mule-charset-list
1578 (defun ps-mule-begin-page ()
1579 (setq ps-mule-current-charset 'ascii))
1582 (provide 'ps-mule)
1585 ;;; ps-mule.el ends here