3 // <groff_src_dir>/src/include/printer.h
5 /* Copyright (C) 1989-2018 Free Software Foundation, Inc.
7 Written by James Clark (jjc@jclark.com)
9 This file is part of groff.
11 groff is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 groff is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
27 The class 'printer' performs the postprocessing. Each
28 postprocessor only needs to implement a derived class of 'printer' and
29 a suitable function 'make_printer' for the device-dependent tasks.
30 Then the methods of class 'printer' are called automatically by
31 'do_file()' in 'input.cpp'.
49 struct font_pointer_list {
51 font_pointer_list *next;
53 font_pointer_list(font *, font_pointer_list *);
60 void load_font(int, const char *);
61 void set_ascii_char(unsigned char, const environment *, int * = 0);
62 void set_special_char(const char *, const environment *, int * = 0);
63 virtual void set_numbered_char(int, const environment *, int * = 0);
64 glyph *set_char_and_width(const char *, const environment *,
66 font *get_font_from_index(int);
67 virtual void draw(int, int *, int, const environment *);
68 // perform change of line color (text, outline) in the print-out
69 virtual void change_color(const environment * const);
70 // perform change of fill color in the print-out
71 virtual void change_fill_color(const environment * const);
72 virtual void begin_page(int) = 0;
73 virtual void end_page(int) = 0;
74 virtual font *make_font(const char *);
75 virtual void end_of_line();
76 virtual void special(char *, const environment *, char = 'p');
77 virtual void devtag(char *, const environment *, char = 'p');
80 font_pointer_list *font_list;
84 // information about named characters
88 const char *named_char_s;
92 font *find_font(const char *);
93 virtual void set_char(glyph *, font *, const environment *, int,
97 printer *make_printer();