Skip to content

Commit

Permalink
support ligatures display while being input (mintty/wsltty#123, #601)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Sep 23, 2018
1 parent 3ee5a8a commit 1456721
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/mintty.1
Expand Up @@ -1425,6 +1425,13 @@ The RowSpacing value is added to that.
.br
(Corresponds roughly to the xterm resource \fBscaleHeight\fP.)

.TP
\fBLigatures support\fP (LigaturesSupport=0)
By default, ligatures, as supported by the selected font, are rendered
if they are output to the terminal in one chunk. When this option is
set =1, mintty redisplays the left part of the line whenever a character
is output, so ligatures are also supported while being input.

.TP
\fB\fP(ColSpacing=0)
Additional column padding; ColSpacing=1 can avoid boldened glyphs being clipped.
Expand Down
2 changes: 2 additions & 0 deletions src/config.c
Expand Up @@ -176,6 +176,7 @@ const config default_cfg = {
.col_spacing = 0,
.row_spacing = 0,
.padding = 1,
.ligatures_support = 0,
.handle_dpichanged = true,
.check_version_update = 900,
.word_chars = "",
Expand Down Expand Up @@ -403,6 +404,7 @@ options[] = {
{"ColSpacing", OPT_INT, offcfg(col_spacing)},
{"RowSpacing", OPT_INT, offcfg(row_spacing)},
{"Padding", OPT_INT, offcfg(padding)},
{"LigaturesSupport", OPT_INT, offcfg(ligatures_support)},
{"HandleDPI", OPT_BOOL, offcfg(handle_dpichanged)},
{"CheckVersionUpdate", OPT_INT, offcfg(check_version_update)},
{"WordChars", OPT_STRING, offcfg(word_chars)},
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Expand Up @@ -174,6 +174,7 @@ typedef struct {
int geom_sync;
int col_spacing, row_spacing;
int padding;
int ligatures_support;
int handle_dpichanged;
int check_version_update;
string word_chars;
Expand Down
2 changes: 2 additions & 0 deletions src/termout.c
Expand Up @@ -279,6 +279,8 @@ write_char(wchar c, int width)
clear_cc(line, curs->x);
line->chars[curs->x].chr = c;
line->chars[curs->x].attr = curs->attr;
if (cfg.ligatures_support)
term_invalidate(0, curs->y, curs->x, curs->y);
}

if (curs->wrapnext && curs->autowrap && width > 0) {
Expand Down

0 comments on commit 1456721

Please sign in to comment.