Bug 1004: NEWS and AUTHORS
[elinks/kon.git] / src / document / format.c
blobbcae2ac0c964005a5ad282721df3fade1c60d740
1 /** Format attributes utilities
2 * @file */
4 #ifdef HAVE_CONFIG_H
5 #include "config.h"
6 #endif
8 #include "elinks.h"
10 #include "document/format.h"
11 #include "document/options.h"
12 #include "terminal/draw.h"
13 #include "util/color.h"
16 void
17 get_screen_char_template(struct screen_char *template,
18 struct document_options *options,
19 struct text_style style)
21 template->attr = 0;
22 template->data = ' ';
24 if (style.attr) {
25 if (style.attr & AT_UNDERLINE) {
26 template->attr |= SCREEN_ATTR_UNDERLINE;
29 if (style.attr & AT_BOLD) {
30 template->attr |= SCREEN_ATTR_BOLD;
33 if (style.attr & AT_ITALIC) {
34 template->attr |= SCREEN_ATTR_ITALIC;
37 if (style.attr & AT_GRAPHICS) {
38 template->attr |= SCREEN_ATTR_FRAME;
43 struct color_pair colors = INIT_COLOR_PAIR(style.bg, style.fg);
44 set_term_color(template, &colors, options->color_flags, options->color_mode);