1 /*
2 Copyright (C) 2016-2021, Dirk Krause
3 SPDX-License-Identifier: BSD-3-Clause
4 */
5 
6 /*
7 	WARNING: This file was generated by the dkct program (see
8 	http://dktools.sourceforge.net/ for details).
9 	Changes you make here will be lost if dkct is run again!
10 	You should modify the original source and run dkct on it.
11 	Original source: dk4font.ctr
12 */
13 
14 /**	@file dk4font.h Header file for the dk4font module.
15 */
16 
17 #ifndef DK4FONT_H_INCLUDED
18 /** Avoid multiple inclusions. */
19 #define DK4FONT_H_INCLUDED 1
20 
21 
22 #ifndef	DK4CONF_H_INCLUDED
23 #if DK4_BUILDING_DKTOOLS4
24 #include "dk4conf.h"
25 #else
26 #include <dktools-4/dk4conf.h>
27 #endif
28 #endif
29 
30 
31 /**	Font numbers the module can handle.
32 */
33 typedef enum {
34 	DK4_FONT_TIMES_ROMAN		= 0,
35 	DK4_FONT_TIMES_ITALIC ,
36 	DK4_FONT_TIMES_BOLD ,
37 	DK4_FONT_TIMES_BOLD_ITALIC ,
38 	DK4_FONT_AVANTGARDE_BOOK ,
39 	DK4_FONT_AVANTGARDE_BOOK_OBLIQUE ,
40 	DK4_FONT_AVANTGARDE_DEMI ,
41 	DK4_FONT_AVANTGARDE_DEMI_OBLIQUE ,
42 	DK4_FONT_BOOKMAN_LIGHT ,
43 	DK4_FONT_BOOKMAN_LIGHT_ITALIC ,
44 	DK4_FONT_BOOKMAN_DEMI ,
45 	DK4_FONT_BOOKMAN_DEMI_ITALIC ,
46 	DK4_FONT_COURIER ,
47 	DK4_FONT_COURIER_OBLIQUE ,
48 	DK4_FONT_COURIER_BOLD ,
49 	DK4_FONT_COURIER_BOLD_OBLIQUE ,
50 	DK4_FONT_HELVETICA ,
51 	DK4_FONT_HELVETICA_OBLIQUE ,
52 	DK4_FONT_HELVETICA_BOLD ,
53 	DK4_FONT_HELVETICA_BOLD_OBLIQUE ,
54 	DK4_FONT_HELVETICA_NARROW ,
55 	DK4_FONT_HELVETICA_NARROW_OBLIQUE ,
56 	DK4_FONT_HELVETICA_NARROW_BOLD ,
57 	DK4_FONT_HELVETICA_NARROW_BOLD_OBLIQUE ,
58 	DK4_FONT_NEW_CENTURY_SCHOOLBOOK_ROMAN ,
59 	DK4_FONT_NEW_CENTURY_SCHOOLBOOK_ITALIC ,
60 	DK4_FONT_NEW_CENTURY_SCHOOLBOOK_BOLD ,
61 	DK4_FONT_NEW_CENTURY_SCHOOLBOOK_BOLD_ITALIC ,
62 	DK4_FONT_PALATINO_ROMAN ,
63 	DK4_FONT_PALATINO_ITALIC ,
64 	DK4_FONT_PALATINO_BOLD ,
65 	DK4_FONT_PALATINO_BOLD_ITALIC ,
66 	DK4_FONT_SYMBOL ,
67 	DK4_FONT_ZAPF_CHANCERY ,
68 	DK4_FONT_ZAPF_DINGBATS ,
69 
70 	/*	We might want to add further LaTeX fonts here but no PS font name is
71 		available for fonts after this point.
72 		Remember to add corresponding entries to the dk4font_tex_family_names,
73 		dk4font_tex_names and dk4font_features arrays in the module section.
74 		Order of fonts here must correspond to the order of information
75 		in these arrays!
76 	*/
77 
78 	/*	Finally we set some constants for comparisons.
79 	*/
80 
81 	DK4_FONT_PS_MAX	= DK4_FONT_ZAPF_DINGBATS,			/**< Maximum for PS. */
82 	DK4_FONT_MAX	= DK4_FONT_ZAPF_DINGBATS			/**< Maximum value. */
83 } dk4_font_number_t;
84 
85 
86 /**	Font features.
87 */
88 enum {
89 	/*	Font families.
90 	*/
91 	DK4_FONT_FEATURE_ROMAN		=	 0, /**< Roman font. */
92 	DK4_FONT_FEATURE_SANS_SERIF	=	 1,	/**< Sans-serif font. */
93 	DK4_FONT_FEATURE_TTY		=	 2,	/**< Typewriter style font. */
94 	DK4_FONT_FEATURE_SYMBOL		=	 3,	/**< Symbol font. */
95 	DK4_FONT_FEATURE_SCRIPT		=	 4,	/**< Script, imitating hand writing. */
96 
97 	/*	Font modifications.
98 	*/
99 	DK4_FONT_FEATURE_BOLD		=	 8,	/**< Bold font. */
100 	DK4_FONT_FEATURE_ITALIC		=	16,	/**< Italic font. */
101 	DK4_FONT_FEATURE_OBLIQUE	=	32,	/**< Oblique font. */
102 	DK4_FONT_FEATURE_NARROW		=	64,	/**< Narrow or condensed font. */
103 
104 	/*	Masks to retrieve family or certain features.
105 	*/
106 	DK4_FONT_FEATURE_FT_MASK	=	 7,	/**< Mask to retrieve sf or tty. */
107 	DK4_FONT_FEATURE_ITOB_MASK	=	48,	/**< Mask for italic or oblique. */
108 };
109 
110 
111 #ifdef	__cplusplus
112 extern "C" {
113 #endif
114 
115 
116 /**	Retrieve font name (without leading slash) for a PS font.
117 	@param	fno	Font number.
118 	@return	Valid pointer on success (fno refers to a PS font), NULL otherwise.
119 */
120 
121 const char *
122 dk4font_get_ps_name(dk4_font_number_t fno);
123 
124 
125 /**	Retrieve LaTeX font family name for a font.
126 	@param	fno	Font number.
127 	@return	Valid pointer on success, NULL on error.
128 */
129 
130 const char *
131 dk4font_get_latex_family_name(dk4_font_number_t fno);
132 
133 
134 /**	Retrieve LaTeX font name for a font.
135 	@param	fno	Font number.
136 	@return	Valid pointer on success, NULL on error.
137 */
138 
139 const char *
140 dk4font_get_latex_font_name(dk4_font_number_t fno);
141 
142 
143 /**	Retrieve font feature set for a font.
144 	@param	fno	Font number.
145 	@return	Font feature set.
146 */
147 
148 int
149 dk4font_get_features(dk4_font_number_t fno);
150 
151 
152 /**	Get font number for integer number.
153 	@param	fno	Font number as int.
154 	@return	Font number as dk4_font_number_t.
155 */
156 
157 dk4_font_number_t
158 dk4font_number_from_int(int fno);
159 
160 
161 /**	Retrieve font family.
162 	@param	fno		Font number.
163 	@return	Font family.
164 */
165 
166 int
167 dk4font_get_family(dk4_font_number_t fno);
168 
169 
170 #ifdef	__cplusplus
171 }
172 #endif
173 
174 
175 
176 /* vim: set ai sw=4 ts=4 : */
177 
178 #endif
179