-
Notifications
You must be signed in to change notification settings - Fork 41
/
config.lisp
95 lines (77 loc) · 3.98 KB
/
config.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
;;; cl-pdf copyright 2002-2005 Marc Battyani see license.txt for the details
;;; You can reach me at [email protected] or [email protected]
;;; The homepage of cl-pdf is here: http://www.fractalconcept.com/asp/html/cl-pdf.html
(in-package #:pdf)
;;; This file contains some special variables which need to be set
;;; depending on your Lisp implementation/OS/installation.
(defconstant +external-format+
#-(or sbcl lispworks clisp allegro ccl abcl ecl clasp) :default
#+abcl '(:iso-8859-1 :eol-style :lf)
#+ecl '(:latin-1 :lf)
#+clasp :iso-8859-1
#+ccl :latin1
#+sbcl :latin-1
#+allegro :octets
#+lispworks '(:latin-1 :eol-style :lf)
#+clisp (ext:make-encoding :charset 'charset:iso-8859-1 :line-terminator :unix))
;; Map exceptional but useful characters to the [0-255] range for a single-byte encoding
;; Add more here...
(defparameter *char-single-byte-codes*
'((#.(code-char #x2013) . #x96) ; En dash: 8211 -> 150
(#.(code-char #x2014) . #x97) ; Em dash: 8212 -> 151
(#.(code-char #x2022) . #xB7) ; Bullet: 8226 -> 183
(#.(code-char #x2026) . #x85) ; Ellipsis: 8230 -> 133
(#.(code-char #x2039) . #x8B) ; Single left angle quotation mark: 8249 -> 139
(#.(code-char #x203A) . #x9B) ; Single right angle quotation mark: 8250 -> 155
(#.(code-char #x2122) . #x99) ; Trademark: 8482 -> 153
))
;; Charset for strings mentioned outside content streams, e.g. in outlines.
;; See #<method write-object (string &optional root-level)>
(defvar *default-charset*
#+(and lispworks5 win32) (ef::ef-coded-character-set win32:*multibyte-code-page-ef*)
#-(and lispworks5 win32) *char-single-byte-codes*) ; last resort
(defvar *min-size-for-compression* 300)
(defvar *compress-streams* nil
"Enables the internal streams compression by zlib")
(defvar *embed-fonts* :default
"t, nil, or :default (let make-font-dictionary and font-descriptor decide for themselves)")
(defvar *compress-fonts* t "nil or decode filter designator")
;the cl-pdf base directory
(defvar *cl-pdf-base-directory*
(make-pathname :name nil :type nil :version nil
:defaults #.(or #-gcl *compile-file-truename* *load-truename*))
"The base directory for cl-pdf source and auxiliary data")
;; The *afm-files-directories* is only for the 14 predefined fonts.
;; other fonts must have their afm files read only when they are loaded
;; Rationale for redefinition:
;; Neither of the versions of search-for-file can search the original value of
;; *afm-files-directories* (#P"cl-pdf/afm/*.afm") as it contains wildcards!
(defparameter *afm-files-directories*
(list (merge-pathnames #P"afm/" *cl-pdf-base-directory*))
"The list of directories containing the Adobe Font Metrics and other font files.
Can be expanded by additionally loaded modules.")
;; define the :pdf-binary feature if your Lisp implementation accepts
;; to write binary sequences to character streams
;; For LW you need version 4.2.7 minimum
#+(or lispworks allegro sbcl)
(pushnew :pdf-binary *features*)
;(eval-when (:compile-toplevel :load-toplevel :execute)
#+use-uffi-zlib
(defvar *zlib-search-paths* `(,(directory-namestring *load-truename*)
#+lispworks
,(directory-namestring (lw:lisp-image-name))
"/usr/local/lib/"
"/usr/lib/"
"/windows/system32/"
"/winnt/system32/")
"The paths where to search the zlib shared library")
;a catchall for various kind of errors that can happen in the generation of a document.
; just catch 'max-number-of-pages-reached if you want to do something with this.
(defvar *max-number-of-pages* 1000
"The maximum number of pages for a document")
(defvar *a4-portrait-page-bounds* #(0 0 595 841))
(defvar *letter-portrait-page-bounds* #(0 0 612 792))
(defvar *a4-landscape-page-bounds* #(0 0 841 595))
(defvar *letter-landscape-page-bounds* #(0 0 792 612))
(defvar *default-page-bounds* *a4-portrait-page-bounds*)
(defvar *load-images-lazily* nil)