mirror of
https://github.com/fmtlib/fmt.git
synced 2026-09-13 22:32:36 +08:00
* Widen display_width_of() to cover Emoji_Presentation code points
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.
* Make wide_cp_ranges C++11-compatible; apply clang-format
* Move wide_cp_range struct into display_width_of()
* Derive wide_cp_ranges from East_Asian_Width data, restore constexpr
* Move wide_cp_ranges to display_width_of function body
* Update format.h
* Update wide_cp_ranges array to include comments
* Add inline to display_width_of and add 1F300-1F5FF and 1F900-1F9FF ranges to match [format.string.std]
* Update display_width_of lo hi varible declaration
---------
Co-authored-by: Eduardo Gomez Saldias <50159560+edugomez102@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| 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 | ||
| enum-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 | ||