mirror of
https://github.com/fmtlib/fmt.git
synced 2026-07-31 00:36:58 +08:00
fmt::detail::display_width_of() only treated East Asian Wide/Fullwidth
code points and two hand-picked emoji ranges as two columns wide, so
emoji outside those ranges (e.g. the Dingbats block: cross mark U+274C,
white heavy check mark U+2705) were measured as one column even though
most terminals render them double-width. This produced visibly
inconsistent padding under {:^N} compared to CJK text (fixes #4851).
Replaced the ad hoc boolean expression with a sorted table of ranges
(East Asian Wide/Fullwidth plus the full Emoji_Presentation set from
Unicode's emoji-data.txt) looked up via binary search, and added
regression tests covering the original report plus edge cases:
multiple emoji, mixed emoji/CJK/ASCII content, precision truncation,
alignment/fill variants, newly covered emoji ranges, and regional
indicator (flag) pairs.
|
||
|---|---|---|
| .. | ||
| add-subdirectory-test | ||
| compile-error-test | ||
| cuda-test | ||
| find-package-test | ||
| fuzzing | ||
| gtest | ||
| static-export-test | ||
| args-test.cc | ||
| assert-test.cc | ||
| base-test.cc | ||
| c-test.c | ||
| chrono-test.cc | ||
| CMakeLists.txt | ||
| color-test.cc | ||
| compile-test.cc | ||
| detect-stdfs.cc | ||
| enforce-checks-test.cc | ||
| format-impl-test.cc | ||
| format-test.cc | ||
| gtest-extra-test.cc | ||
| gtest-extra.cc | ||
| gtest-extra.h | ||
| header-only-test.cc | ||
| mock-allocator.h | ||
| module-test.cc | ||
| no-builtin-types-test.cc | ||
| noexception-test.cc | ||
| os-test.cc | ||
| ostream-test.cc | ||
| perf-sanity.cc | ||
| posix-mock-test.cc | ||
| posix-mock.h | ||
| printf-test.cc | ||
| ranges-odr-test.cc | ||
| ranges-test.cc | ||
| scan-test.cc | ||
| scan.h | ||
| std-test.cc | ||
| test-assert.h | ||
| test-main.cc | ||
| unicode-test.cc | ||
| util.cc | ||
| util.h | ||
| xchar-test.cc | ||