aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-06-30 16:00:33 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-07-01 05:58:06 +0000
commit9817e44c325f5d44f64bfa768107998134ea7f59 (patch)
tree60412220158008983064e696073355dbe0d37c52 /config.c
parentvt: limit grapheme width to 2 cells (diff)
config: add tweak.grapheme-width-method=wcswidth|at-most-2
Diffstat (limited to 'config.c')
-rw-r--r--config.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/config.c b/config.c
index 372e9f9c..cb407c24 100644
--- a/config.c
+++ b/config.c
@@ -2255,6 +2255,15 @@ parse_section_tweak(
LOG_WARN("tweak: grapheme shaping");
}
+ else if (strcmp(key, "grapheme-width-method") == 0) {
+ if (strcmp(value, "at-most-2") == 0)
+ conf->tweak.grapheme_width_method = GRAPHEME_WIDTH_MAX_2;
+ else if (strcmp(value, "wcswidth") == 0)
+ conf->tweak.grapheme_width_method = GRAPHEME_WIDTH_WCSWIDTH;
+
+ LOG_WARN("%s:%d [tweak]: grapheme-width-method=%s", path, lineno, value);
+ }
+
else if (strcmp(key, "render-timer") == 0) {
if (strcmp(value, "none") == 0) {
conf->tweak.render_timer_osd = false;
@@ -2823,6 +2832,7 @@ config_load(struct config *conf, const char *conf_path,
.fcft_filter = FCFT_SCALING_FILTER_LANCZOS3,
.allow_overflowing_double_width_glyphs = true,
.grapheme_shaping = false,
+ .grapheme_width_method = GRAPHEME_WIDTH_MAX_2,
.delayed_render_lower_ns = 500000, /* 0.5ms */
.delayed_render_upper_ns = 16666666 / 2, /* half a frame period (60Hz) */
.max_shm_pool_size = 512 * 1024 * 1024,