;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:51:47 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/ps-bdf.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`ps-bdf.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\303\304!\210\301B\305\301!\204 \306\302B\305\302!\204 \306\306\207" [current-load-list installation-directory coding-system-for-read require ps-mule boundp nil] 2)
#@114 *List of directories to search for `BDF' font files.
The default value is '("/usr/local/share/emacs/fonts/bdf").
(defvar bdf-directory-list (byte-code "\302>\203 \303\301!\203 \304\305	\"C\207\306\207" [system-type installation-directory (ms-dos windows-nt) boundp expand-file-name "fonts/bdf" ("/usr/local/share/emacs/fonts/bdf")] 3) (#$ . -800))
(byte-code "\303>\203 \304\301!\203 \305\306	\"C\304\207" [system-type installation-directory bdf-directory-list (ms-dos windows-nt) boundp expand-file-name "fonts/bdf"] 3)
#@141 Return an absolute path name of a `BDF' font file BDFNAME.
It searches directories listed in the variable `bdf-directory-list'
for BDFNAME.
(defalias 'bdf-expand-file-name #[(bdfname) "\304!\203 \305!\205- \207	\306\211\203+ \307@\"\305\n!\204+ \306A\211\204 \n*\207" [bdfname bdf-directory-list dir dir-list file-name-absolute-p file-readable-p nil expand-file-name] 4 (#$ . 1335)])
#@146 Return modification time of FILENAME.
The value is a list of two integers, the first integer has high-order
16 bits, the second has low 16 bits.
(defalias 'bdf-file-mod-time #[(filename) "\301\302!8\207" [filename 5 file-attributes] 3 (#$ . 1739)])
(put 'bdf-file-mod-time 'byte-optimizer 'byte-compile-inline-expand)
#@193 Return non-nil if and only if FILENAME is newer than MOD-TIME.
MOD-TIME is a modification time as a list of two integers, the first
integer has high-order 16 bits, the second has low 16 bits.
(defalias 'bdf-file-newer-than-time #[(filename mod-time) "\306!\211\205+ 	\307\310!8)\211@\f@V\206* U\205* \nA@\fA@V+)\207" [filename file-name new-mod-time new-time mod-time time bdf-expand-file-name 5 file-attributes] 4 (#$ . 2065)])
#@176 Return a buffer visiting a bdf file BDFNAME.
If BDFNAME is not an absolute path, directories listed in
`bdf-directory-list' is searched.
If BDFNAME doesn't exist, return nil.
(defalias 'bdf-find-file #[(bdfname) "\304!\211\205 \305\306!\307\212q\210\310	!\210+)\207" [bdfname file-name coding-system-for-read buf bdf-expand-file-name generate-new-buffer " *bdf-work*" no-conversion insert-file-contents] 3 (#$ . 2512)])
#@68 Name of cache file which contains information of `BDF' font files.
(defvar bdf-cache-file (byte-code "\301=\203 \302\207\303\304!\207" [system-type ms-dos "~/_bdfcache.el" convert-standard-filename "~/.bdfcache.el"] 2) (#$ . 2945))
#@320 Cached information of `BDF' font files.  It is a list of FONT-INFO.
FONT-INFO is a list of the following format:
    (BDFFILE ABSOLUTE-PATH MOD-TIME SIZE FONT-BOUNDING-BOX
     RELATIVE-COMPOSE BASELINE-OFFSET CODE-RANGE MAXLEN OFFSET-VECTOR)
See the documentation of the function `bdf-read-font-info' for more detail.
(defvar bdf-cache nil (#$ . 3186))
#@180 Return a cached information about `BDF' font files from a cache file.
The variable `bdf-cache-file' holds the cache file name.
If the cache file is not readable, this return nil.
(defalias 'bdf-read-cache #[nil "\301\301\302\303\217\207" [bdf-cache nil (byte-code "\302!\205 \303!\210	<\203 	\207\304\211\207" [bdf-cache-file bdf-cache file-readable-p load-file nil] 2) ((error))] 3 (#$ . 3547)])
#@190 Write out cached information of `BDF' font file to a file.
The variable `bdf-cache-file' holds the cache file name.
The file is written if and only if the file already exists and writable.
(defalias 'bdf-write-cache #[nil "\205 \302	!\205 \303	!\205 \304\305\306\"\307	#\207" [bdf-cache bdf-cache-file file-exists-p file-writable-p write-region format "(setq bdf-cache '%S)\n" nil] 4 (#$ . 3957)])
#@310 Cache FONT-INFO as information about one `BDF' font file.
FONT-INFO is a list of the following format:
    (BDFFILE ABSOLUTE-PATH MOD-TIME SIZE FONT-BOUNDING-BOX
     RELATIVE-COMPOSE BASELINE-OFFSET CODE-RANGE MAXLEN OFFSET-VECTOR)
See the documentation of the function `bdf-read-font-info' for more detail.
(defalias 'bdf-set-cache #[(font-info) "\303@	\"\211\203 \nA\241\202 	B\211)\207" [font-info bdf-cache slot assoc] 4 (#$ . 4367)])
#@27 Initialize `bdf' library.
(defalias 'bdf-initialize #[nil "\300 \205	 \301\302\303\"\207" [bdf-read-cache add-hook kill-emacs-hook bdf-write-cache] 3 (#$ . 4820)])
(defalias 'bdf-compact-code #[(code code-range) "	\302HW\204 	\303HV\203 	\304H\305\306\"	\307HZ	\310H	\311HZT_\312\313\"	\311HZ\\\207" [code code-range 4 5 6 lsh -8 0 3 2 logand 255] 4])
(defalias 'bdf-expand-code #[(code code-range) "\303H\304HZT\n	\245\305H\\\306_\n	\246\304H\\\\)\207" [code-range code0-range code 3 2 0 256] 4])
(defalias 'bdf-search-and-read #[(match limit) "eb\210\302	\303#\205 \304\225b\210\305p!\207" [match limit search-forward t 0 read] 4])
#@1532 Read `BDF' font file BDFNAME and return information (FONT-INFO) of the file.
FONT-INFO is a list of the following format:
    (BDFFILE ABSOLUTE-PATH MOD-TIME FONT-BOUNDING-BOX
     RELATIVE-COMPOSE BASELINE-OFFSET CODE-RANGE MAXLEN OFFSET-VECTOR)

BDFFILE is a name of a font file (excluding directory part).

ABSOLUTE-PATH is an absolute path of the font file.

MOD-TIME is last modification time as a list of two integers, the
first integer has high-order 16 bits, the second has low 16 bits.

SIZE is a size of the font.  This value is got from SIZE record of the
font.

FONT-BOUNDING-BOX is the font bounding box as a list of four integers,
BBX-WIDTH, BBX-HEIGHT, BBX-XOFF, and BBX-YOFF.

RELATIVE-COMPOSE is an integer value of the font's property
`_MULE_RELATIVE_COMPOSE'.  If the font doesn't have this property, the
value is 0.

BASELINE-OFFSET is an integer value of the font's property
`_MULE_BASELINE_OFFSET'.  If the font doesn't have this property, the
value is 0.

CODE-RANGE is a vector of minimum 1st byte, maximum 1st byte, minimum
2nd byte, maximum 2nd byte, minimum code, maximum code, and default
code.  For 1-byte fonts, the first two elements are 0.

MAXLEN is a maximum bytes of one glyph information in the font file.

OFFSET-VECTOR is a vector of a file position which starts bitmap data
of the glyph in the font file.

Nth element of OFFSET-VECTOR is a file position for the glyph of code
CODE, where N and CODE are in the following relation:
    (bdf-compact-code CODE) => N, (bdf-expand-code N) => CODE
(defalias 'bdf-read-font-info #[(bdfname) "\306!\211\205 \307	!\310\311\310\312.\312/\3120\3121\3122\n\203- \313\314\"\210\2022 \315\316\"\210\317\216\212\nq\210eb\210\320\321!\210\322\323p!\323p!\323p!\323p!$\211/\324H\310V\203h \325\326\"\203h /\324/\324H[I\210eb\210\320\327!\210\323p!\211./\330H\324\245X\203\205 /\330H.\331\332\312\"0\320\333!\210\334y\210`3\331\3353\"\206\236 \311\331\3363\"\206\250 \310)\337\211\340\310\211\211\312\211\211\211\211\211456789:;<=>?\320\333\312\341#\2033\342 4\320\343!\210\323p!5\3445\345\"7\3465\347\"6=5^=:5]:?7^?<7]<>6^>;6];\320\350!\210`4Z]54B8B8\202\316 \322?<>;=:0\206G=&1\351\352:1\"T\312\"28\203w8@98A82\3529@1\"9AI\210\202W.\313\353\"\210	\211@\354\355@!8)./\f12\257\n.\n\207" [bdfname absolute-path buf maxlen relative-compose baseline-offset bdf-expand-file-name bdf-find-file 0 false nil message "Reading %s..." error "BDF file %s doesn't exist" ((kill-buffer buf)) search-forward "\nFONTBOUNDINGBOX" vector read 3 string-match "jiskan\\(16\\|24\\)" "\nSIZE " 1 bdf-search-and-read "\nDEFAULT_CHAR" "\nSTARTCHAR" -1 "\n_MULE_RELATIVE_COMPOSE" "\n_MULE_BASELINE_OFFSET" 256 65536 t line-beginning-position "\nENCODING" lsh -8 logand 255 "ENDCHAR" make-vector bdf-compact-code "Reading %s...done" 5 file-attributes size font-bounding-box default-char code-range offset-vector limit offset code code1 code0 glyph-list glyph max-code max-code1 max-code0 min-code min-code1 min-code0 filename] 13 (#$ . 5476)])
(defalias 'bdf-info-absolute-path #[(font-info) "A@\207" [font-info] 1])
(put 'bdf-info-absolute-path 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'bdf-info-mod-time #[(font-info) "\3018\207" [font-info 2] 2])
(put 'bdf-info-mod-time 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'bdf-info-size #[(font-info) "\3018\207" [font-info 3] 2])
(put 'bdf-info-size 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'bdf-info-font-bounding-box #[(font-info) "\3018\207" [font-info 4] 2])
(put 'bdf-info-font-bounding-box 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'bdf-info-relative-compose #[(font-info) "\3018\207" [font-info 5] 2])
(put 'bdf-info-relative-compose 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'bdf-info-baseline-offset #[(font-info) "\3018\207" [font-info 6] 2])
(put 'bdf-info-baseline-offset 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'bdf-info-code-range #[(font-info) "\3018\207" [font-info 7] 2])
(put 'bdf-info-code-range 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'bdf-info-maxlen #[(font-info) "\3018\207" [font-info 8] 2])
(put 'bdf-info-maxlen 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'bdf-info-offset-vector #[(font-info) "\3018\207" [font-info 9] 2])
(put 'bdf-info-offset-vector 'byte-optimizer 'byte-compile-inline-expand)
#@312 Return information about `BDF' font file BDFNAME.
The value FONT-INFO is a list of the following format:
    (BDFFILE ABSOLUTE-PATH MOD-TIME SIZE FONT-BOUNDING-BOX
     RELATIVE-COMPOSE BASELINE-OFFSET CODE-RANGE MAXLEN OFFSET-VECTOR)
See the documentation of the function `bdf-read-font-info' for more detail.
(defalias 'bdf-get-font-info #[(bdfname) "\204 \303 \210\304	\"\211\203' \305\n\211A@)!\203' \306	\n\307\n8)\"\203/ \310	!\311\n!\210\n)\207" [bdf-cache bdfname font-info bdf-read-cache assoc file-readable-p bdf-file-newer-than-time 2 bdf-read-font-info bdf-set-cache] 5 (#$ . 9923)])
#@240 Return information about `BDF' font file with alternative names BDFNAMES.

If BDFNAMES is a list of file names, this function finds the first file
in the list which exists and is readable, then calls `bdf-get-font-info'
on that file name.
(defalias 'bdf-find-font-info #[(bdfnames) "\211\211:\203 \n\203 \n@\303	!\204 \304\nA\211\204 \305	\206& @!*\207" [bdfnames fname fnlist bdf-expand-file-name nil bdf-get-font-info] 3 (#$ . 10533)])
#@376 Read `BDF' font file BDFNAME to get bitmap data at file position OFFSET.
BDFNAME is an absolute path name of the font file.
MAXLEN specifies how many bytes we should read at least.
The value is a list of DWIDTH, BBX, and BITMAP-STRING.
DWIDTH is a pixel width of a glyph.
BBX is a bounding box of the glyph.
BITMAP-STRING is a string representing bits by hexadecimal digits.
(defalias 'bdf-read-bitmap #[(bdfname offset maxlen) "\306\307	!\310\234\211\311\234\312\313\313\313\314\315\217\210\n\fE.\207" [coding-system-for-read bdfname bbx dwidth bitmap-string height no-conversion bdf-get-font-info 4 0 "" nil (byte-code "\306\307\310!!\311\216rq\210\312	\313\n\211\\$\210eb\210\314\315!\210\316p!eb\210\314\317!\210\320\316p!\316p!\316p!\316p!$\211\321H\322H\314\323!\210\321y\210e`|\210\324\325!\203` \326`\327\225\"Z`\327\225|\210\324\330!\204\210 \314\330\313\331#\210\332y\210\324\333!\203\205 TS\332y\210\202o \321y\210\321I\210\322I\210`d|\210eb\210m\204\251 \313\210\334\321!\210\202\233 \335  +\313\207" [#1=#:temp-buffer bdfname offset maxlen dwidth bbx get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents nil search-forward "\nDWIDTH" read "\nBBX" vector 1 3 "\nBITMAP" looking-at "\\(0+\n\\)+" count-lines 0 "ENDCHAR" move -1 "0+$" delete-char buffer-string height yoff bitmap-string] 7) ((error)) yoff] 4 (#$ . 10989)])
#@332 Return bitmap information of glyphs of CODES in `BDF' font file BDFNAME.
CODES is a list of encoding number of glyphs in the file.
The value is a list of CODE, DWIDTH, BBX, and BITMAP-STRING.
DWIDTH is a pixel width of a glyph.
BBX is a bounding box of the glyph.
BITMAP-STRING is a string representing bits by hexadecimal digits.
(defalias 'bdf-get-bitmaps #[(bdfname codes) "\306!\211\211A@)	\307	8)	\310	8)	\311	8)\312\313\f\"-\207" [bdfname font-info absolute-path maxlen code-range offset-vector bdf-find-font-info 8 7 9 mapcar #[(x) "\305	\n\306\"H\f#B\207" [x absolute-path offset-vector code-range maxlen bdf-read-bitmap bdf-compact-code] 7] codes] 4 (#$ . 12470)])
(defalias 'bdf-generate-prologue #[nil "\204 \301 \210\302 \207" [bdf-cache bdf-initialize ps-mule-generate-bitmap-prologue] 1])
(defalias 'bdf-generate-font #[(charset font-spec) "\3048)\305	!	:\203 	@\202 	\306	\3078)\211\303N)\310H\n\307\n8)\n\311\n8)\n\312\n8)\n\310\n8)&+\207" [font-spec font-name font-info charset 1 bdf-find-font-info ps-mule-generate-bitmap-font 3 4 5 6] 10])
(defalias 'bdf-generate-glyphs #[(font-spec code-list bytes) "\3038)\304\305\306	\n\"\")\207" [font-spec font-name code-list 1 mapcar #[(x) "\302\303:\203\f @\202 	#\207" [font-name x apply ps-mule-generate-bitmap-glyph] 4] bdf-get-bitmaps] 5])
(provide 'ps-bdf)
