1 /** Format attributes utilities
10 #include "document/format.h"
11 #include "document/options.h"
12 #include "terminal/draw.h"
13 #include "util/color.h"
17 get_screen_char_template(struct screen_char
*template,
18 struct document_options
*options
,
19 struct text_style style
)
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
);