Move wide_cp_range struct into display_width_of()

This commit is contained in:
Eduardo Gomez Saldias 2026-07-28 13:32:28 +02:00
parent 4a2a6e448d
commit 8793ca53e5

View File

@ -655,13 +655,12 @@ FMT_CONSTEXPR void for_each_codepoint(string_view s, F f) {
} while (buf_ptr < buf + num_chars_left);
}
struct wide_cp_range {
uint32_t first;
uint32_t last;
};
inline auto display_width_of(uint32_t cp) noexcept -> size_t {
if (cp < 0x1100) return 1;
struct wide_cp_range {
uint32_t first;
uint32_t last;
};
// Code points with display width 2: East Asian Wide/Fullwidth
// (https://www.unicode.org/reports/tr11/) and Emoji_Presentation
// (https://www.unicode.org/reports/tr51/) ranges, sorted and merged.