Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [14.3.1] - 2025-01-24

### Fixed

- Fixed characters out of unicode range reporting a cell size if 0 https://github.com/Textualize/rich/pull/3944

## [14.3.0] - 2025-01-24

### Fixed
Expand Down Expand Up @@ -2177,6 +2183,7 @@ Major version bump for a breaking change to `Text.stylize signature`, which corr

- First official release, API still to be stabilized

[14.3.1]: https://github.com/textualize/rich/compare/v14.3.0...v14.3.1
[14.3.0]: https://github.com/textualize/rich/compare/v14.2.0...v14.3.0
[14.2.0]: https://github.com/textualize/rich/compare/v14.1.0...v14.2.0
[14.1.0]: https://github.com/textualize/rich/compare/v14.0.0...v14.1.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "rich"
homepage = "https://github.com/Textualize/rich"
documentation = "https://rich.readthedocs.io/en/latest/"
version = "14.3.0"
version = "14.3.1"
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
authors = ["Will McGugan <willmcgugan@gmail.com>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion rich/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_character_cell_size(character: str, unicode_version: str = "auto") -> in
codepoint = ord(character)
table = load_cell_table(unicode_version).widths
if codepoint > table[-1][1]:
return 0
return 1
lower_bound = 0
upper_bound = len(table) - 1
index = (lower_bound + upper_bound) // 2
Expand Down
6 changes: 6 additions & 0 deletions tests/test_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,9 @@ def test_split_graphemes(
assert cell_len(text) == expected_cell_length
assert spans == expected_spans
assert cell_length == expected_cell_length


def test_nerd_font():
"""Regression test for https://github.com/Textualize/rich/issues/3943"""
# Not allocated by unicode, but used by nerd fonts
assert cell_len("\U000f024d") == 1
Loading