0
|
1 /* =========================================================================
|
|
2 * Freetype GL - A C OpenGL Freetype engine
|
|
3 * Platform: Any
|
|
4 * WWW: http://code.google.com/p/freetype-gl/
|
|
5 * -------------------------------------------------------------------------
|
|
6 * Copyright 2011,2012 Nicolas P. Rougier. All rights reserved.
|
|
7 *
|
|
8 * Redistribution and use in source and binary forms, with or without
|
|
9 * modification, are permitted provided that the following conditions are met:
|
|
10 *
|
|
11 * 1. Redistributions of source code must retain the above copyright notice,
|
|
12 * this list of conditions and the following disclaimer.
|
|
13 *
|
|
14 * 2. Redistributions in binary form must reproduce the above copyright
|
|
15 * notice, this list of conditions and the following disclaimer in the
|
|
16 * documentation and/or other materials provided with the distribution.
|
|
17 *
|
|
18 * THIS SOFTWARE IS PROVIDED BY NICOLAS P. ROUGIER ''AS IS'' AND ANY EXPRESS OR
|
|
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
21 * EVENT SHALL NICOLAS P. ROUGIER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
|
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28 *
|
|
29 * The views and conclusions contained in the software and documentation are
|
|
30 * those of the authors and should not be interpreted as representing official
|
|
31 * policies, either expressed or implied, of Nicolas P. Rougier.
|
|
32 * ========================================================================= */
|
|
33 #ifndef __MARKUP_H__
|
|
34 #define __MARKUP_H__
|
|
35
|
|
36 #ifdef __cplusplus
|
|
37 extern "C" {
|
|
38 #endif
|
|
39
|
|
40 #include "texture-font.h"
|
|
41 #include "vec234.h"
|
|
42
|
|
43 /**
|
|
44 * @file markup.h
|
|
45 * @author Nicolas Rougier (Nicolas.Rougier@inria.fr)
|
|
46 *
|
|
47 * @defgroup markup Markup
|
|
48 *
|
|
49 * Simple structure that describes text properties.
|
|
50 *
|
|
51 * <b>Example Usage</b>:
|
|
52 * @code
|
|
53 * #include "markup.h"
|
|
54 *
|
|
55 * ...
|
|
56 *
|
|
57 * vec4 black = {{0.0, 0.0, 0.0, 1.0}};
|
|
58 * vec4 white = {{1.0, 1.0, 1.0, 1.0}};
|
|
59 * vec4 none = {{1.0, 1.0, 1.0, 0.0}};
|
|
60 *
|
|
61 * markup_t normal = {
|
|
62 * .family = "Droid Serif",
|
|
63 * .size = 24.0,
|
|
64 * .bold = 0,
|
|
65 * .italic = 0,
|
|
66 * .rise = 0.0,
|
|
67 * .spacing = 1.0,
|
|
68 * .gamma = 1.0,
|
|
69 * .foreground_color = black, .background_color = none,
|
|
70 * .underline = 0, .underline_color = black,
|
|
71 * .overline = 0, .overline_color = black,
|
|
72 * .strikethrough = 0, .strikethrough_color = black,
|
|
73 * .font = 0,
|
|
74 * };
|
|
75 *
|
|
76 * ...
|
|
77 *
|
|
78 * @endcode
|
|
79 *
|
|
80 * @{
|
|
81 */
|
|
82
|
|
83
|
|
84 /**
|
|
85 * Simple structure that describes text properties.
|
|
86 */
|
|
87 typedef struct
|
|
88 {
|
|
89 /**
|
|
90 * A font family name such as "normal", "sans", "serif" or "monospace".
|
|
91 */
|
|
92 char * family;
|
|
93
|
|
94 /**
|
|
95 * Font size.
|
|
96 */
|
|
97 float size;
|
|
98
|
|
99 /**
|
|
100 * Whether text is bold.
|
|
101 */
|
|
102 int bold;
|
|
103
|
|
104 /**
|
|
105 * Whether text is italic.
|
|
106 */
|
|
107 int italic;
|
|
108
|
|
109 /**
|
|
110 * Vertical displacement from the baseline.
|
|
111 */
|
|
112 float rise;
|
|
113
|
|
114 /**
|
|
115 * Spacing between letters.
|
|
116 */
|
|
117 float spacing;
|
|
118
|
|
119 /**
|
|
120 * Gamma correction.
|
|
121 */
|
|
122 float gamma;
|
|
123
|
|
124 /**
|
|
125 * Text color.
|
|
126 */
|
|
127 vec4 foreground_color;
|
|
128
|
|
129 /**
|
|
130 * Background color.
|
|
131 */
|
|
132 vec4 background_color;
|
|
133
|
|
134 /**
|
|
135 * Whether outline is active.
|
|
136 */
|
|
137 int outline;
|
|
138
|
|
139 /**
|
|
140 * Outline color.
|
|
141 */
|
|
142 vec4 outline_color;
|
|
143
|
|
144 /**
|
|
145 * Whether underline is active.
|
|
146 */
|
|
147 int underline;
|
|
148
|
|
149 /**
|
|
150 * Underline color.
|
|
151 */
|
|
152 vec4 underline_color;
|
|
153
|
|
154 /**
|
|
155 * Whether overline is active.
|
|
156 */
|
|
157 int overline;
|
|
158
|
|
159 /**
|
|
160 * Overline color.
|
|
161 */
|
|
162 vec4 overline_color;
|
|
163
|
|
164 /**
|
|
165 * Whether strikethrough is active.
|
|
166 */
|
|
167 int strikethrough;
|
|
168
|
|
169 /**
|
|
170 * Strikethrough color.
|
|
171 */
|
|
172 vec4 strikethrough_color;
|
|
173
|
|
174 /**
|
|
175 * Pointer on the corresponding font (family/size/bold/italic)
|
|
176 */
|
|
177 texture_font_t * font;
|
|
178
|
|
179 } markup_t;
|
|
180
|
|
181
|
|
182 extern markup_t default_markup;
|
|
183
|
|
184
|
|
185 /** @} */
|
|
186
|
|
187 #ifdef __cplusplus
|
|
188 }
|
|
189 #endif
|
|
190
|
|
191 #endif /* __MARKUP_H__ */
|