aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-08-20 17:25:35 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-24 15:30:45 +0000
commitb9ef703eb14ba2357b847b62a715b4e97f690209 (patch)
treec6e65e05499e292a4f51d09453f44d1bdf0f93ad /config.c
parentMerge branch 'sixel-heap-user-after-free-after-blending' (diff)
wip: grapheme shaping
Diffstat (limited to 'config.c')
-rw-r--r--config.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/config.c b/config.c
index 81392043..a95f8485 100644
--- a/config.c
+++ b/config.c
@@ -2129,6 +2129,33 @@ parse_section_tweak(
LOG_WARN("tweak: damage whole window");
}
+ else if (strcmp(key, "grapheme-shaping") == 0) {
+ conf->tweak.grapheme_shaping = str_to_bool(value);
+
+#if !defined(FOOT_GRAPHEME_CLUSTERING)
+ if (conf->tweak.grapheme_shaping) {
+ LOG_AND_NOTIFY_WARN(
+ "%s:%d: [tweak]: "
+ "grapheme-shaping enabled but foot was not compiled with "
+ "support for it", path, lineno);
+ conf->tweak.grapheme_shaping = false;
+ }
+#endif
+
+ if (conf->tweak.grapheme_shaping && !conf->can_shape_grapheme) {
+ LOG_WARN(
+ "%s:%d [tweak]: "
+ "grapheme-shaping enabled but fcft was not compiled with "
+ "support for it", path, lineno);
+
+ /* Keep it enabled though - this will cause us to do
+ * grapheme-clustering at least */
+ }
+
+ if (conf->tweak.grapheme_shaping)
+ LOG_WARN("tweak: grapheme shaping");
+ }
+
else if (strcmp(key, "render-timer") == 0) {
if (strcmp(value, "none") == 0) {
conf->tweak.render_timer_osd = false;
@@ -2580,6 +2607,7 @@ config_load(struct config *conf, const char *conf_path,
config_override_t *overrides, bool errors_are_fatal)
{
bool ret = false;
+ enum fcft_capabilities fcft_caps = fcft_capabilities();
*conf = (struct config) {
.term = xstrdup(DEFAULT_TERM),
@@ -2620,6 +2648,7 @@ config_load(struct config *conf, const char *conf_path,
.label_letters = xwcsdup(L"sadfjklewcmpgh"),
.osc8_underline = OSC8_UNDERLINE_URL_MODE,
},
+ .can_shape_grapheme = fcft_caps & FCFT_CAPABILITY_GRAPHEME_SHAPING,
.scrollback = {
.lines = 1000,
.indicator = {
@@ -2694,6 +2723,7 @@ config_load(struct config *conf, const char *conf_path,
.tweak = {
.fcft_filter = FCFT_SCALING_FILTER_LANCZOS3,
.allow_overflowing_double_width_glyphs = true,
+ .grapheme_shaping = false,
.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,