-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h.in
296 lines (260 loc) · 18.9 KB
/
config.h.in
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
#ifndef CONFIG_H
#define CONFIG_H
#cmakedefine CUSTOM_FONT_SUPPORTED 1
#cmakedefine PNG_SUPPORTED 1
#cmakedefine JPG_SUPPORTED 1
#cmakedefine IS_LINUX 1
#cmakedefine IS_WINDOWS 1
#cmakedefine HAVE_SYS_STAT_H 1
#ifndef PNG_SUPPORTED
#define PNG_SUPPORTED 0
#endif
#ifndef JPG_SUPPORTED
#define JPG_SUPPORTED 0
#endif
#define SHORT_OPTION_PREFIX "-"
#define OPTION_PREFIX SHORT_OPTION_PREFIX SHORT_OPTION_PREFIX
#define LIST_FONTS "list-fonts"
#define FONT_PROFILE "font-profile"
#define COLOR_RULE "color-rule"
#define FONT_SIZE "font-size"
#define DRAWING_CHARACTER "drawing-character"
#define AS_IMAGE "as-image"
#define OUTPUT "output"
#define LIST_EASINGS "list-easings"
#define LIST_COMPOSITION_MODES "list-composition-modes"
#define LIST_BLEND_MODES "list-blend-modes"
#define COMPOSITION_RULE "composition-rule"
#define DPI "dpi"
#define BACKGROUND_COLOR "background-color"
#define LINE_HEIGHT "line-height"
#define JUSTIFY "justify"
#define STROKE_WIDTH "stroke-width"
#define FINAL_SIZE "final-size"
#define UNINSTALL_FONT "uninstall-font"
#define INSTALL_FONT "install-font"
#define QUALITY_INDEX "quality-index"
#define EASING_DIRECTION "easing-direction"
#define PADDING_LEFT "padding-left"
#define PADDING_RIGHT "padding-right"
#define PADDING_TOP "padding-top"
#define PADDING_BOTTOM "padding-bottom"
#define TEST_COLOR "test-color"
#define HELP_PROMPT "help"
#define LIST_FONTS_SHORT_FORM "lF"
#define FONT_PROFILE_SHORT_FORM "pF"
#define COLOR_RULE_SHORT_FORM "rC"
#define FONT_SIZE_SHORT_FORM "sF"
#define DRAWING_CHARACTER_SHORT_FORM "cD"
#define AS_IMAGE_SHORT_FORM "iA"
#define OUTPUT_SHORT_FORM "o"
#define LIST_EASINGS_SHORT_FORM "eL"
#define LIST_COMPOSITION_MODES_SHORT_FORM "cL"
#define LIST_BLEND_MODES_SHORT_FORM "bL"
#define COMPOSITION_RULE_SHORT_FORM "c"
#define DPI_SHORT_FORM "iR"
#define BACKGROUND_COLOR_SHORT_FORM "bG"
#define LINE_HEIGHT_SHORT_FORM "hL"
#define JUSTIFY_SHORT_FORM "j"
#define STROKE_WIDTH_SHORT_FORM "wS"
#define FINAL_SIZE_SHORT_FORM "fS"
#define UNINSTALL_FONT_SHORT_FORM "uF"
#define INSTALL_FONT_SHORT_FORM "iF"
#define QUALITY_INDEX_SHORT_FORM "iQ"
#define EASING_DIRECTION_SHORT_FORM "dE"
#define PADDING_LEFT_SHORT_FORM "pL"
#define PADDING_RIGHT_SHORT_FORM "pR"
#define PADDING_TOP_SHORT_FORM "pT"
#define PADDING_BOTTOM_SHORT_FORM "pB"
#define TEST_COLOR_SHORT_FORM "cT"
#define HELP_PROMPT_SHORT_FORM "h"
#define OPTIONIFY( value) OPTION_PREFIX value
#define OPTIONIFY_SHORT( value) SHORT_OPTION_PREFIX value
#define STRUCTURE_PREFIX( value) OPTIONIFY_SHORT( value ## _SHORT_FORM) ", " OPTIONIFY( value)
#define MESSAGE( option) option ## _MESSAGE
#define SHORT( value) value ## _SHORT_FORM
#define LIST_FONTS_MESSAGE "Lists the fonts installed on your @OPERATING_SYSTEM@ system.\n" \
#define FONT_PROFILE_MESSAGE "Set the font family to use for display.\n" \
"See " OPTIONIFY( INSTALL_FONT) "\n"\
"Example:\n" \
OPTIONIFY( FONT_PROFILE) "=\"Noto sans Regular\"\n" \
"If font was installed using " OPTIONIFY( INSTALL_FONT) ",\n use: " \
OPTIONIFY( FONT_PROFILE) "=\"Noto sans - Regular\"\n"
#define FONT_SIZE_MESSAGE "Set the default font size used by characters that don't match any\n" \
"rule or with rules not with no explicit font size specified.\n"
#define AS_IMAGE_MESSAGE "Prepare output mode to export in image format.\n" \
"This option only works if it is configured with" \
" -DPNG_SUPPORTED=ON or -DJPG_SUPPORTED=ON\n"
#define OUTPUT_MESSAGE "Set the filename to write rendering into\n" \
OPTIONIFY( OUTPUT) " image.png\n" \
"NB! jpeg images are also supported.\n"
#define DPI_MESSAGE "Set the resolution of the characters to display.\n" \
#define LINE_HEIGHT_MESSAGE "Set the distance between rows of text.\n" \
#define QUALITY_INDEX_MESSAGE "Set the quality of the output image.\n" \
#define JUSTIFY_MESSAGE "Move multiline text `left`, `right` or `center`.\n" \
"Usage:\n" \
OPTIONIFY( JUSTIFY) "=`left`\n"
#define STROKE_WIDTH_MESSAGE "Set the outline thickness for all characters.\n" \
"Usage:\n" \
OPTIONIFY( STROKE_WIDTH) "=`12`\n"
#define FINAL_SIZE_MESSAGE "Set the resulting size for the image.\n" \
"Supported interpolation methods are:\n" \
"bi-linear, bi-cubic.\n" \
"Usage:\n" \
OPTIONIFY( FINAL_SIZE) "=`300 * 300 bi-cubic`.\n" \
OPTIONIFY( FINAL_SIZE) "=`300w` - Keeps aspect ratio.\n" \
#define DRAWING_CHARACTER_MESSAGE "This option can be used to control character used in\n" \
" drawing glyphs to display in console mode.\n"
#define INSTALL_FONT_MESSAGE "Add font file to the list to use usable fonts.\n" \
"This option is only available if source code is \n" \
"compiled with -DCUSTOM_FONT_SUPPORTED=ON\n"
#define UNINSTALL_FONT_MESSAGE "Removed `font-family - font-face` from the list of installed font.\n" \
"This option is only available if source code is\n" \
"compiled with -DCUSTOM_FONT_SUPPORTED=ON\n"
#define BACKGROUND_COLOR_MESSAGE "Set the background color of the output image to generated.\n" \
"This option if only available if source code is compiled with\n" \
"-DPNG_SUPPORTED=ON or -DJPG_SUPPORTED=ON\n"
#define LIST_EASINGS_MESSAGE " list the easing functions available.\n" \
#define LIST_COMPOSITION_MODES_MESSAGE "List all composition modes available.\n" \
#define LIST_BLEND_MODES_MESSAGE "List all blend modes available.\n" \
#define COLOR_RULE_MESSAGE "Set the color rule to use in generating text.\n" \
"Usage examples:\n" \
"SINGLE LINE TEXTS:\n" \
"1. " OPTIONIFY( COLOR_RULE) "=[1]{Red}\n" \
" Set the first character encountered in text to red.\n" \
"2. " OPTIONIFY( COLOR_RULE) "=[1..]{Red}\n" \
" Set all text characters encountered in text to red.\n" \
"3. " OPTIONIFY( COLOR_RULE) "=[1..4]{Red}\n" \
" Set the first to fourth characters in text to red.\n" \
"4. " OPTIONIFY( COLOR_RULE) "=[1..4:50]{Red}\n" \
" Set the first to fourth characters to 50px and color to red.\n" \
"5. " OPTIONIFY( COLOR_RULE) "=[1..4:50-30 -easeInOutSine]{Red}\n" \
" Set the first to fourth character to tween from 50 to 30px using\n" \
" easeInOutSine as the easing function. Paint the text red.\n" \
"6. " OPTIONIFY( COLOR_RULE) "=[1..4:50-30-60 -easeInOutSine]{Red}\n" \
" Set the first to fourth character to tween from 50px to 30px\n" \
" and then finally, finish at 60px. Paint the font color red.\n" \
"7. " OPTIONIFY( COLOR_RULE) "=[1..]{Red -> Green}\n" \
" Set all characters to transition color from red to green using\n" \
" linear easing function.\nNote that the easing will be character based.\n" \
" If easing within characters is expected, a `+` should be added\n" \
" (e.g [1..]{ Red -> Green +}).\n" \
"8. " OPTIONIFY( COLOR_RULE) "=[1..]{Red -> Green +easeInOutSine}\n" \
" Set all characters to transition color from red to green using\n" \
" easeInOutSine function.\nNote that the easing will be character based.\n" \
"If easing within characters is expected, a `+` should be added\n" \
" (e.g [1..]{ Red -> Green +easeInOutSine}).\n" \
"9. " OPTIONIFY( COLOR_RULE) "=[1..]{Red -> Green -R(.5, .5, .3) +}\n" \
" Set all characters to transition color from Red to Green using\n" \
" radial gradient at origin (0.5, 0.5) with spread at 0.3\n" \
"10. " OPTIONIFY( COLOR_RULE) "=[1..]{Red -> Green -C +}\n" \
" Set all characters to colors transition from red to green using\n" \
" conical gradient.\n" \
"11. " OPTIONIFY( COLOR_RULE) "=[1..]{-C(red, green, blue) +}\n" \
" Set all characters to transition color from red at 0deg\n"\
" to green at 180deg and finally ending with blue at 360deg.\n" \
"Any number of colors are allowed as opposed to radial gradient which\n" \
" allows only two color transition.\n" \
"12. " OPTIONIFY( COLOR_RULE) "=[1..]{-C(from 50deg, " \
"red, blue 180deg, orange) +}\n" \
" Set all characters to ease using conical gradient.\n"\
"The conical angle starts at 50deg, blue starts at 180deg\n" \
" and finishes with orange.\n" \
"13. " OPTIONIFY( COLOR_RULE) "=[1..]{red:3f}\n" \
" Set the font color to red with background transparency of 63.\n"\
"14. " OPTIONIFY( COLOR_RULE) "=[1..]{(red + blue)}\n" \
" Set the font color to the result of additive color mixing\n" \
"of red and blue which is magenta.\n" \
"15. " OPTIONIFY( COLOR_RULE) "=[1..]{(red:3f + blue:2f)}\n" \
" Produces same result as in step `14`.\n" \
"To set the opacity of the mixed color, use:\n" \
OPTIONIFY( COLOR_RULE) "=[1..]{(red:3f + blue: 2f):ff}. Where `0xff`\n" \
" is the opacity override override.\n" \
"16. " OPTIONIFY( COLOR_RULE) "=[1..]{(cyan - yellow)}\n" \
" Set the font color to the result of subtractive mixing of\n" \
"cyan and yellow which is green.\n" \
"17. " OPTIONIFY( COLOR_RULE) "=[1..]{(red:ff:30 + blue:ff:70)}\n" \
" Set the font color to the result of mixing 30% red with 70%\n" \
"blue with maximum opacity of 255. If the sum is greater than 100%,\n" \
"the result is clamped to 100%.\n" \
"18. " OPTIONIFY( COLOR_RULE) "=[1..]{(red::30 + blue::70):ff}\n" \
" Set the color to the sum of red and blue with mixing ratio of\n" \
"30% red and 70% blue.\n" \
"19. " OPTIONIFY( COLOR_RULE) "=[1..]{(red/blue +/- green/yellow)}\n" \
" Set the outline color to the result of subtractive color mixing of\n" \
"blue and yellow (black). Also set the font color to the result of\n"\
"additive mixture of red and green(yellow).\n" \
"MULTILINE TEXTS:\n" \
"1. " OPTIONIFY( COLOR_RULE) "=[(1,1)]{Red}\n" \
" Set the character at the first row and first column(only) to red.\n" \
"2. " OPTIONIFY( COLOR_RULE) "=[(1,1)..]{Red}\n" \
" Set all characters in text to color red.\n" \
" This command is has same effect as:\n" \
" " OPTIONIFY( COLOR_RULE) "=[(1,1)..(-1,-1)]{Red}\n" \
"3. " OPTIONIFY( COLOR_RULE) "=[(1,1)..(-1,3)]{Red}\n" \
" Set all characters that are contained in the bounding box created\n" \
" by (1, 1) to (3, 3) to red.\n" \
"NB! The color rules defined for single line texts also work here as well.\n" \
#define COMPOSITION_RULE_MESSAGE "Set the method through which the generated text\n" \
" is blended with an image provided by " OPTIONIFY( COMPOSITION_RULE) "\n" \
"Usage examples:\n" \
"1. " OPTIONIFY( COMPOSITION_RULE) "=\"mode=source-over\"\n" \
"Set the order to which images should be applied on top of each other as \n" \
"`source-over`.The generated text is place at the top-left\n" \
" corner of the output.\n" \
"2. " OPTIONIFY( COMPOSITION_RULE) \
"=\"from 30deg at .5, .5, mode=source-over\"\n" \
"Set the order of stacking as source-over rotate the source image by 30deg.\n" \
"See also: `" OPTIONIFY( COMPOSITION_RULE) "`.\n"
#define EASING_DIRECTION_MESSAGE "Specify the direction for color to flow in linear gradient.\n" \
"Allowed values are: `row` or `col`.\n" \
"Usage:\n" \
OPTIONIFY( EASING_DIRECTION) "=row\n"
#define PADDING_LEFT_MESSAGE "Set the spacing left of generated text.\n" \
"Usage:\n" \
OPTIONIFY( PADDING_LEFT) "=10\n"
#define PADDING_RIGHT_MESSAGE "Set the spacing right of generated text.\n" \
"Usage:\n" \
OPTIONIFY( PADDING_RIGHT) "=10\n"
#define PADDING_TOP_MESSAGE "Set the spacing above generated text.\n" \
"Usage:\n" \
OPTIONIFY( PADDING_TOP) "=10\n"
#define PADDING_BOTTOM_MESSAGE "Set the spacing below generated text.\n" \
"Usage:\n" \
OPTIONIFY( PADDING_BOTTOM) "=10\n"
#define TEST_COLOR_MESSAGE "Inquire about the result of mixing colors.\n" \
"Usage:\n" \
OPTIONIFY( TEST_COLOR) "=(red::30 + blue)\n" \
#define HELP_PROMPT_MESSAGE "Show this prompt.\n" \
#define START(var) (
#define ADD(var) 1 +
#define END(var) 1)
#define OPTIONS_COUNT START() \
ADD( LIST_FONTS ) \
ADD( FONT_PROFILE ) \
ADD( COLOR_RULE ) \
ADD( FONT_SIZE ) \
ADD( DRAWING_CHARACTER ) \
ADD( AS_IMAGE ) \
ADD( OUTPUT ) \
ADD( LIST_EASINGS ) \
ADD( LIST_COMPOSITION_MODES) \
ADD( LIST_BLEND_MODES ) \
ADD( COMPOSITION_RULE ) \
ADD( DPI ) \
ADD( BACKGROUND_COLOR ) \
ADD( LINE_HEIGHT ) \
ADD( JUSTIFY ) \
ADD( STROKE_WIDTH ) \
ADD( FINAL_SIZE ) \
ADD( UNINSTALL_FONT ) \
ADD( INSTALL_FONT ) \
ADD( QUALITY_INDEX ) \
ADD( EASING_DIRECTION ) \
ADD( PADDING_LEFT ) \
ADD( PADDING_RIGHT ) \
ADD( PADDING_TOP ) \
ADD( PADDING_BOTTOM ) \
ADD( TEST_COLOR ) \
END( HELP_PROMPT )
#endif