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

Lines Matching +defs:font +defs:size

1 ;;; ps-bdf.el --- BDF font file handler for ps-print
9 ;; Keywords: wp, BDF, font, PostScript
31 ;; Functions for getting bitmap information from X's BDF font file are
48 "*List of directories to search for `BDF' font files.
58 "Return an absolute path name of a `BDF' font file BDFNAME.
113 "Name of cache file which contains information of `BDF' font files.")
116 "Cached information of `BDF' font files. It is a list of FONT-INFO.
120 See the documentation of the function `bdf-read-font-info' for more detail.")
123 "Return a cached information about `BDF' font files from a cache file.
137 "Write out cached information of `BDF' font file to a file.
146 (defun bdf-set-cache (font-info)
147 "Cache FONT-INFO as information about one `BDF' font file.
151 See the documentation of the function `bdf-read-font-info' for more detail."
152 (let ((slot (assoc (car font-info) bdf-cache)))
154 (setcdr slot (cdr font-info))
155 (setq bdf-cache (cons font-info bdf-cache)))))
182 (defun bdf-read-font-info (bdfname)
183 "Read `BDF' font file BDFNAME and return information (FONT-INFO) of the file.
188 BDFFILE is a name of a font file (excluding directory part).
190 ABSOLUTE-PATH is an absolute path of the font file.
195 SIZE is a size of the font. This value is got from SIZE record of the
196 font.
198 FONT-BOUNDING-BOX is the font bounding box as a list of four integers,
201 RELATIVE-COMPOSE is an integer value of the font's property
202 `_MULE_RELATIVE_COMPOSE'. If the font doesn't have this property, the
205 BASELINE-OFFSET is an integer value of the font's property
206 `_MULE_BASELINE_OFFSET'. If the font doesn't have this property, the
213 MAXLEN is a maximum bytes of one glyph information in the font file.
216 of the glyph in the font file.
226 size
227 font-bounding-box
239 (setq font-bounding-box
245 (and (> (aref font-bounding-box 3) 0)
247 (aset font-bounding-box 3
248 (- (aref font-bounding-box 3))))
252 (setq size (read (current-buffer)))
255 (and (<= size (/ (aref font-bounding-box 1) 3))
256 (setq size (aref font-bounding-box 1)))
309 size font-bounding-box relative-compose baseline-offset
312 (defsubst bdf-info-absolute-path (font-info) (nth 1 font-info))
313 (defsubst bdf-info-mod-time (font-info) (nth 2 font-info))
314 (defsubst bdf-info-size (font-info) (nth 3 font-info))
315 (defsubst bdf-info-font-bounding-box (font-info) (nth 4 font-info))
316 (defsubst bdf-info-relative-compose (font-info) (nth 5 font-info))
317 (defsubst bdf-info-baseline-offset (font-info) (nth 6 font-info))
318 (defsubst bdf-info-code-range (font-info) (nth 7 font-info))
319 (defsubst bdf-info-maxlen (font-info) (nth 8 font-info))
320 (defsubst bdf-info-offset-vector (font-info) (nth 9 font-info))
322 (defun bdf-get-font-info (bdfname)
323 "Return information about `BDF' font file BDFNAME.
327 See the documentation of the function `bdf-read-font-info' for more detail."
330 (let ((font-info (assoc bdfname bdf-cache)))
331 (if (or (not font-info)
332 (not (file-readable-p (bdf-info-absolute-path font-info)))
333 (bdf-file-newer-than-time bdfname (bdf-info-mod-time font-info)))
335 (setq font-info (bdf-read-font-info bdfname))
336 (bdf-set-cache font-info)))
337 font-info))
339 (defun bdf-find-font-info (bdfnames)
340 "Return information about `BDF' font file with alternative names BDFNAMES.
343 in the list which exists and is readable, then calls `bdf-get-font-info'
354 (bdf-get-font-info (or fname (car bdfnames)))))
357 "Read `BDF' font file BDFNAME to get bitmap data at file position OFFSET.
358 BDFNAME is an absolute path name of the font file.
365 (bbx (elt (bdf-get-font-info bdfname) 4))
409 "Return bitmap information of glyphs of CODES in `BDF' font file BDFNAME.
415 (let* ((font-info (bdf-find-font-info bdfname))
416 (absolute-path (bdf-info-absolute-path font-info))
417 ;;(font-bounding-box (bdf-info-font-bounding-box font-info))
418 (maxlen (bdf-info-maxlen font-info))
419 (code-range (bdf-info-code-range font-info))
420 (offset-vector (bdf-info-offset-vector font-info)))
436 ;; Called from ps-mule-generate-font.
437 (defun bdf-generate-font (charset font-spec)
438 (let* ((font-name (ps-mule-font-spec-name font-spec))
439 (font-info (bdf-find-font-info font-name))
440 (font-name (if (consp font-name) (car font-name) font-name)))
441 (ps-mule-generate-bitmap-font font-name
442 (ps-mule-font-spec-bytes font-spec)
444 (bdf-info-size font-info)
445 (bdf-info-relative-compose font-info)
446 (bdf-info-baseline-offset font-info)
447 (bdf-info-font-bounding-box font-info))))
450 (defun bdf-generate-glyphs (font-spec code-list bytes)
451 (let ((font-name (ps-mule-font-spec-name font-spec)))
454 (if (consp font-name) (car font-name) font-name)
456 (bdf-get-bitmaps font-name code-list))))