1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00
Commit Graph

7 Commits

Author SHA1 Message Date
Wez Furlong
6368198b4f refine emoji-presentation script
refs: #1607
2022-02-02 06:57:08 -07:00
Wez Furlong
5f2c905db8 shaping: feed presentation width from the terminal through to glyph info
This allows unicode_version to be respected again when rendering.

The updated emoji-presentation.sh script now highlights this slightly
better by putting `.` characters after the emoji; unicode version 14
emoji presentation will show the `.` in the 3rd column, while earlier
versions will show it in the 2nd column for glyphs that are sensitive
to the version.

refs: #1607
refs: #1563
2022-02-01 09:23:57 -07:00
Wez Furlong
81f2c1cda1 update emoji presentation test script
refs: #1607
2022-02-01 08:04:16 -07:00
Wez Furlong
9589c7a647 Respect emoji-variation-sequences.txt
Not all codepoints are valid when combined with a presentation
selector.

This commit ensures that we respect the valid sequences defined
by the current version of unicode (version 14).

refs: #1231
refs: #997
2021-11-25 14:37:24 -07:00
Wez Furlong
225e7a1243 introduce unicode_version config
This is a fairly far-reaching commit. The idea is:

* Introduce a unicode_version config that specifies the default level
  of unicode conformance for each newly created Terminal (each Pane)
* The unicode_version is passed down to the `grapheme_column_width`
  function which interprets the width based on the version
* `Cell` records the width so that later calculations don't need to
  know the unicode version

In a subsequent diff, I will introduce an escape sequence that allows
setting/pushing/popping the unicode version so that it can be overridden
via eg: a shell alias prior to launching an application that uses a
different version of unicode from the default.

This approach allows output from multiple applications with differing
understanding of unicode to coexist on the same screen a little more
sanely.

Note that the default `unicode_version` is set to 9, which means that
emoji presentation selectors are now by-default ignored.  This was
selected to better match the level of support in widely deployed
applications.

I expect to raise that default version in the future.

Also worth noting: there are a number of callers of
`unicode_column_width` in things like overlays and lua helper functions
that pass `None` for the unicode version: these will assume the latest
known-to-wezterm/termwiz version of unicode to be desired. If those
overlays do things with emoji presentation selectors, then there may be
some alignment artifacts. That can be tackled in a follow up commit.

refs: #1231
refs: #997
2021-11-25 09:00:45 -07:00
Wez Furlong
7c5d53c689 use zsh rather than bash for emoji-presentation test 2021-11-08 20:49:16 -07:00
Wez Furlong
0866e5d213 fonts/shaping: respect the Presentation selection for a cluster
This commit annotates fonts with a boolean that indicates whether
we think it contains glyphs with emoji presentation, and then
passes the cluster.presentation field down to the shaper.

If the presentation doesn't match the current font in the fallback,
then it will be skipped until we exhaust its options.

`wezterm ls-fonts` also shows whether we think a font has emoji
presentation.

refs: #997
2021-08-11 09:11:59 -07:00