Skip to content

Commit

Permalink
OSC 7750 for dynamic change of emojis style; support style Emojis=zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Feb 19, 2021
1 parent 3ad9946 commit 3ee999c
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/mintty.1
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,8 @@ Supported styles are:
\(en \fBsamsung\fP Use Samsung emoji graphics.
.br
\(en \fBwindows\fP Use Windows emoji graphics.
.br
\(en \fBzoom\fP Use Zoom emoji graphics.

Note that all style options only work if the respective emoji graphics repository
is deployed in a mintty resource directory, subdirectory \fIemojis\fP.
Expand Down
6 changes: 4 additions & 2 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ static opt_val
{"facebook", EMOJIS_FB},
{"samsung", EMOJIS_SAMSUNG},
{"windows", EMOJIS_WINDOWS},
{"zoom", EMOJIS_ZOOM},
{0, 0}
},
[OPT_EMOJI_PLACEMENT] = (opt_val[]) {
Expand Down Expand Up @@ -976,8 +977,9 @@ set_option(string name, string val_str, bool from_file)
}
}
//__ %2$s: option name, %1$s: invalid value
opterror(_("Ignoring invalid value '%s' for option '%s'"),
from_file, val_str, name);
if (!wnd) // report errors only during initialisation
opterror(_("Ignoring invalid value '%s' for option '%s'"),
from_file, val_str, name);
return -1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum { FLASH_FRAME = 1, FLASH_BORDER = 2, FLASH_FULL = 4, FLASH_REVERSE = 8 };
enum { EMOJIS_NONE = 0, EMOJIS_ONE = 1, EMOJIS_NOTO = 2, EMOJIS_APPLE = 3,
EMOJIS_GOOGLE = 4, EMOJIS_TWITTER = 5, EMOJIS_FB = 6,
EMOJIS_SAMSUNG = 7, EMOJIS_WINDOWS = 8, EMOJIS_JOYPIXELS = 9,
EMOJIS_OPENMOJI = 10 };
EMOJIS_OPENMOJI = 10, EMOJIS_ZOOM = 11 };
enum { EMPL_STRETCH = 0, EMPL_ALIGN = 1, EMPL_MIDDLE = 2, EMPL_FULL = 3 };

// Colour values.
Expand Down
5 changes: 5 additions & 0 deletions src/term.c
Original file line number Diff line number Diff line change
Expand Up @@ -1770,6 +1770,11 @@ fallback:;
sep = "-";
zwj = false;
sel = false;
when EMOJIS_ZOOM:
pre = "zoom/";
sep = "-";
zwj = false;
sel = false;
when EMOJIS_ONE:
pre = "emojione/";
when EMOJIS_APPLE:
Expand Down
4 changes: 4 additions & 0 deletions src/termout.c
Original file line number Diff line number Diff line change
Expand Up @@ -3886,6 +3886,10 @@ do_cmd(void)
}
}
}
when 7750:
set_arg_option("Emojis", strdup(s));
clear_emoji_data();
win_invalidate_all(false);
when 8: { // hyperlink attribute
char * link = s;
char * url = strchr(s, ';');
Expand Down
4 changes: 4 additions & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Configuration
* Support style Emojis=zoom.
* OSC 7750 for dynamic change of emojis style.

### 3.4.5 (17 February 2021) ###

Terminal features
Expand Down
8 changes: 8 additions & 0 deletions wiki/CtrlSeqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,14 @@ As usual, OSC sequences can also be terminated with `^[\` (_ST_, the string term
When the font size is queried, a sequence that would restore the current font and window size is sent.


## Emojis style ##

Like OSC 50 for font style, this sequence can change the emojis style.
For values, see setting `Emojis` in the manual.

> `^[]7750;_emojis-style_`^G`

## Locale ##

The locale and charset used by the terminal can be queried or changed using
Expand Down
2 changes: 2 additions & 0 deletions wiki/Tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,8 @@ Emoji data can be found at the following sources:
* [JoyPixels](https://www.joypixels.com/) (formerly EmojiOne)
* Download JoyPixels Free (or Premium)
* Deploy the preferred subdirectory (e.g. png/unicode/128) as `joypixels`
* Zoom (with an installed Zoom meeting client)
* Deploy $APPDATA/Zoom/data/Emojis/*.png into `zoom`
<img align=right src=https://github.com/mintty/mintty/wiki/mintty-emojis.png>

To “Clone” with limited download volume, use the command `git clone --depth 1`.
Expand Down

0 comments on commit 3ee999c

Please sign in to comment.