mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-18 05:34:02 -04:00
wip: grapheme shaping
This commit is contained in:
parent
c1cde66f70
commit
b9ef703eb1
16 changed files with 340 additions and 178 deletions
30
config.c
30
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue