Skip to content

Commit

Permalink
Release v3.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
janlelis committed Jan 13, 2025
1 parent 4bcbf6a commit a515fa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Basic/Single Emoji character without Variation Selector | No special handling
Basic/Single Emoji character with VS15 (Text) | No special handling
Basic/Single Emoji character with VS16 (Emoji) | 2 or East Asian Width (see table below)
Single Emoji character with Skin Tone Modifier | 2
Skin Tone Modifier used in isolation or with invalid base | 2 if Emoji mode is configured to RGI
Skin Tone Modifier used in isolation or with invalid base | 2 if Emoji mode is configured to `:rgi` / `:rgi_at`
Emoji Sequence | 2 if Emoji belongs to configured Emoji set (see table below)

#### Emoji Modes
Expand All @@ -135,7 +135,7 @@ The `emoji:` option can be used to configure which type of Emoji should be consi

Unfortunately, the level of Emoji support varies a lot between terminals. While some of them are able to display (almost) all Emoji sequences correctly, others fall back to displaying sequences of basic Emoji. When `emoji: true` or `emoji: :auto` is used, the gem will attempt to set the best fitting Emoji setting for you (e.g. `:rgi_at` on "Apple_Terminal" or `false` on Gnome's terminal widget).

Please note that Emoji display and number of terminal columns used might differs a lot. For example, it might be the case that a terminal does not understand which Emoji to display, but still manages to calculate the proper amount of terminal cells. The automatic Emoji support level per terminal only considers the latter (cursor position), not the actual Emoji image(s) displayed. Please [open an issue](https://github.com/janlelis/unicode-display_width/issues/new) if you notice your terminal application could use a better default value. Also see the [ucs-detect project](https://ucs-detect.readthedocs.io/results.html), which is a great resource that compares various terminal's Unicode/Emoji capabilities. You can checkout how your terminals renders different kind of Emoji types with this [terminal-emoji-width.rb script](https://github.com/janlelis/unicode-display_width/blob/main/misc/terminal-emoji-width.rb).
Please note that Emoji display and number of terminal columns used might differs a lot. For example, it might be the case that a terminal does not understand which Emoji to display, but still manages to calculate the proper amount of terminal cells. The automatic Emoji support level per terminal only considers the latter (cursor position), not the actual Emoji image(s) displayed. Please [open an issue](https://github.com/janlelis/unicode-display_width/issues/new) if you notice your terminal application could use a better default value. Also see the [ucs-detect project](https://ucs-detect.readthedocs.io/results.html), which is a great resource that compares various terminal's Unicode/Emoji capabilities. You can visually check how your terminals renders different kind of Emoji types with the [terminal-emoji-width.rb script](https://github.com/janlelis/unicode-display_width/blob/main/misc/terminal-emoji-width.rb).

**To terminal implementors reading this:** Although the practice of giving all Emoji/ZWJ sequences a width of 2 (`:all` mode described above) has some advantages, it does not lead to a particularly good developer experience. Since there is always the possibility of well-formed Emoji that are currently not supported (non-RGI / future Unicode) appearing, those sequences will take more cells. Instead of overflowing, cutting off sequences or displaying placeholder-Emoji, could it be worthwile to implement the `:rgi` option (only known Emoji get width 2) and give those unknown Emoji the space they need? This would support the idea that the meaning of an unknown Emoji sequence can still be conveyed (without messing up the terminal at the same time). Just a thought…

Expand Down
2 changes: 1 addition & 1 deletion lib/unicode/display_width/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Unicode
class DisplayWidth
VERSION = "3.1.3"
VERSION = "3.1.4"
UNICODE_VERSION = "16.0.0"
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../../../data/")
INDEX_FILENAME = DATA_DIRECTORY + "/display_width.marshal.gz"
Expand Down

0 comments on commit a515fa2

Please sign in to comment.