- a->params.ops = &ascii_render_ops;
- a->params.aux = a;
- a->params.size[H] = a->width;
- a->params.size[V] = INT_MAX;
- a->params.font_size[H] = 1;
- a->params.font_size[V] = 1;
-
- static const int ascii_line_widths[RENDER_N_LINES] = {
- [RENDER_LINE_NONE] = 0,
- [RENDER_LINE_SINGLE] = 1,
- [RENDER_LINE_DASHED] = 1,
- [RENDER_LINE_THICK] = 1,
- [RENDER_LINE_THIN] = 1,
- [RENDER_LINE_DOUBLE] = 1,
+
+ static const int ascii_line_widths[TABLE_N_STROKES] = {
+ [TABLE_STROKE_NONE] = 0,
+ [TABLE_STROKE_SOLID] = 1,
+ [TABLE_STROKE_DASHED] = 1,
+ [TABLE_STROKE_THICK] = 1,
+ [TABLE_STROKE_THIN] = 1,
+ [TABLE_STROKE_DOUBLE] = 1,
+ };
+
+ struct ascii_driver *a = xmalloc (sizeof *a);
+ *a = (struct ascii_driver) {
+ .driver = {
+ .class = &ascii_driver_class,
+ .name = xstrdup (fh_get_file_name (fh)),
+ .device_type = device_type
+ },
+
+ .emphasis = parse_boolean (opt (o, "emphasis", "false")),
+ .chart_file_name = parse_chart_file_name (opt (o, "charts",
+ fh_get_file_name (fh))),
+
+ .fg = parse_color (opt (o, "foreground-color", "#000000000000")),
+ .bg = parse_color (opt (o, "background-color", "#FFFFFFFFFFFF")),
+
+ .width_mode = (width > 0 ? FIXED_WIDTH
+ : terminal ? TERMINAL_WIDTH
+ : VIEW_WIDTH),
+ .width = width,
+
+ .min_hbreak = parse_int (opt (o, "min-hbreak", "-1"), -1, INT_MAX),
+
+ .box = box == BOX_ASCII ? get_ascii_box () : get_unicode_box (),
+
+ .handle = fh,
+ .file = file,
+
+ .params = (struct render_params) {
+ .ops = &ascii_render_ops,
+ .aux = a,
+ .size = { [H] = a->width, [V] = INT_MAX },
+ .font_size = { [H] = 1, [V] = 1 },
+ .line_widths = ascii_line_widths,
+ .rtl = render_direction_rtl (),
+ .printing = true,
+ },