File: generics.lisp

package info (click to toggle)
cedilla 0.6-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 812 kB
  • ctags: 308
  • sloc: lisp: 3,716; makefile: 50; sh: 13
file content (93 lines) | stat: -rw-r--r-- 3,062 bytes parent folder | download | duplicates (2)
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
;;; This file is part of Cedilla.
;;; Copyright (C) 2002 by Juliusz Chroboczek.

;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.

;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.

(in-package "CEDILLA")

(defgeneric get-glyph (font name &optional index)
  (:documentation
   "Retrieve a glyph from FONT.
Depending on the font type, this looks the glyph up by NAME or by INDEX.")
  )

(defgeneric put-glyph (font glyph &optional index)
  (:documentation
   "Insert a glyph into FONT.
Depending on the font type, this inserts the glyph by GLYPH-NAME or by INDEX.")
  )

(defgeneric find-font-glyph (ccs font &optional dotless)
  (:documentation
   "Find a glyph in FONT that is suitable for typesetting CCS.
If DOTLESS is true, a dotless glyph will be requested; it is the callers
responsability to ensure that CCS is usually dotted.")
  )

(defgeneric typeset-glyph (glyph stream)
  (:documentation
   "Typeset GLYPH on the PostScript stream STREAM.
It is the callee's responsibility to call SYNCHRONISE-POSITION if necessary,
and to update *{CURRENT,TYPESETTER}-{X,Y}*.")
  )

(defgeneric typeset-font-glyph (glyph instance index stream)
  (:documentation
   "Typeset the FONT-GLYPH GLYPH associated to INSTANCE on STREAM.
This is called by the TYPESET-GLYPH method on FONT-GLYPH.")
  )

(defgeneric make-font-instance (font)
  (:documentation
   "Make a font instance suitable for use with FONT and insert it into FONT.")
  )

(defgeneric ensure-instance (glyph)
  (:documentation
   "Ensure that GLYPH belongs to an instance.
This will be called for any glyph that we decide is useful.  For composite,
magic etc. glyphs, this should recursively call ENSURE-INSTANCE on the
glyph's descendents.")
  )

(defgeneric make-transformed-glyph (glyph matrix)
  (:documentation
   "Make a linearly transformed version of GLYPH."))


(defgeneric setup-font (stream font size name)
  (:documentation
   "Do any set-up needed before using FONT.
If the font is realised as a PS font, the PS code will refer to it by the
given name.")
  )


(defgeneric setup-font-instance (stream instance name)
  (:documentation
   "Do any set-up needed before using INSTANCE.
If the instance is realised as a PS font, the PS code will refer to it by the
given name.")
  )

(defgeneric select-font-instance (instance stream)
  (:documentation
   "Switch to using the given INSTANCE.
This typically selects the associated PS font for realised instances, and
does nothing for unrealised instances.")
  )

(defgeneric download-resource (resource out)
  (:documentation
   "Download the given PostScript RESOURCE.
DSC bracketing is taken care of in :BEFORE and :AFTER methods.")
  )