"\t-h, --help [off] Print this help and exit\n"
"\t-v, --verbose [off] Print verbose messages\n"
"\t --debug [off] Enable debug mode\n"
- "\t --silent [off] Suppress notices and warnings\n",
+ "\t --silent [off] Suppress notices and warnings\n"
+ "\n"
+ "Font Options:\n"
+ "\t --font-engine <engine> [pango]\n"
+ "\t Font engine\n"
+ "\t --font-size <points> [15]\n"
+ "\t Font size in points\n"
+ "\t --font-name <name> [monospace]\n"
+ "\t Font name\n"
+ "\t --font-dpi <dpi> [96]\n"
+ "\t Force DPI value for all fonts\n",
"wlterm");
/*
* 80 char line:
CONF_OPTION_BOOL('v', "verbose", NULL, &wlt_conf.verbose, false),
CONF_OPTION_BOOL(0, "debug", aftercheck_debug, &wlt_conf.debug, false),
CONF_OPTION_BOOL(0, "silent", NULL, &wlt_conf.silent, false),
+ CONF_OPTION_STRING(0, "font-engine", NULL, &wlt_conf.font_engine, "pango"),
+ CONF_OPTION_UINT(0, "font-size", NULL, &wlt_conf.font_size, 12),
+ CONF_OPTION_STRING(0, "font-name", NULL, &wlt_conf.font_name, "monospace"),
+ CONF_OPTION_UINT(0, "font-dpi", NULL, &wlt_conf.font_ppi, 96),
};
int main(int argc, char **argv)
#include "tsm_unicode.h"
#include "tsm_screen.h"
#include "tsm_vte.h"
+#include "wlt_main.h"
#include "wlt_toolkit.h"
#define LOG_SUBSYSTEM "wlt_terminal"
tmp = x + buf->width;
if (tmp < x || x >= term->buffer.width)
- return -EINVAL;
+ return 0;
if (tmp > term->buffer.width)
width = term->buffer.width - x;
else
tmp = y + buf->height;
if (tmp < y || y >= term->buffer.height)
- return -EINVAL;
+ return 0;
if (tmp > term->buffer.height)
height = term->buffer.height - y;
else
{
struct wlt_terminal *term;
int ret;
- const struct kmscon_font_attr attr = { "", 0, 20, false, false, 0, 0 };
+ struct kmscon_font_attr attr = { "", 0, 20, false, false, 0, 0 };
if (!out || !wnd)
return -EINVAL;
term->wnd = wnd;
term->eloop = wlt_window_get_eloop(wnd);
- ret = kmscon_font_find(&term->font_normal, &attr, NULL);
+ attr.ppi = wlt_conf.font_ppi;
+ attr.points = wlt_conf.font_size;
+ strncpy(attr.name, wlt_conf.font_name, KMSCON_FONT_MAX_NAME - 1);
+ attr.name[KMSCON_FONT_MAX_NAME - 1] = 0;
+
+ ret = kmscon_font_find(&term->font_normal, &attr, wlt_conf.font_engine);
if (ret) {
log_error("cannot create font");
goto err_free;