8#include "unicode_bidi_class.hpp"
9#include "unicode_description.hpp"
66using unicode_bidi_char_info_iterator = unicode_bidi_char_info_vector::iterator;
67using unicode_bidi_char_info_const_iterator = unicode_bidi_char_info_vector::const_iterator;
74 template<
typename... Args>
75 void emplace_character(Args &&...args)
noexcept
81template<
typename OutputIt,
typename SetCodePo
int>
82static void unicode_bidi_L4(
83 unicode_bidi_char_info_iterator first,
84 unicode_bidi_char_info_iterator last,
86 SetCodePoint set_code_point)
noexcept
88 for (
auto it = first; it != last; ++it, ++output_it) {
89 if (it->direction == unicode_bidi_class::R && it->description->bidi_bracket_type() != unicode_bidi_bracket_type::n) {
90 set_code_point(*output_it, it->description->bidi_mirrored_glyph());
96 unicode_bidi_class force_paragraph_direction = unicode_bidi_class::unknown;
97 bool enable_mirrored_brackets =
true;
98 bool enable_line_separator =
true;
101[[nodiscard]] unicode_bidi_char_info_iterator unicode_bidi_P1(
102 unicode_bidi_char_info_iterator first,
103 unicode_bidi_char_info_iterator last,
131template<
typename It,
typename GetCodePo
int,
typename SetCodePo
int>
135 GetCodePoint get_code_point,
136 SetCodePoint set_code_point,
137 detail::unicode_bidi_test_parameters test_parameters = {})
139 auto proxy = detail::unicode_bidi_char_info_vector{};
143 for (
auto it = first; it != last; ++it) {
144 proxy.emplace_back(index++, get_code_point(*it));
147 auto proxy_last = detail::unicode_bidi_P1(
std::begin(proxy),
std::end(proxy), test_parameters);
148 last = shuffle_by_index(first, last,
std::begin(proxy), proxy_last, [](ttlet &item) {
152 detail::unicode_bidi_L4(
std::begin(proxy), proxy_last, first, set_code_point);
Definition unicode_bidi.hpp:14
char32_t code_point
The current code point.
Definition unicode_bidi.hpp:22
unicode_bidi_class bidi_class
The original bidi class of the code-point.
Definition unicode_bidi.hpp:37
size_t index
Index from the first character in the original list.
Definition unicode_bidi.hpp:17
int8_t embedding_level
The embedding level.
Definition unicode_bidi.hpp:27
unicode_description const * description
Description of the code-point.
Definition unicode_bidi.hpp:41
unicode_bidi_char_info(size_t index, unicode_bidi_class bidi_class) noexcept
Constructor for testing to bypass normal initialization.
Definition unicode_bidi.hpp:54
unicode_bidi_class direction
Current computed direction of the code-point.
Definition unicode_bidi.hpp:32
Definition unicode_bidi.hpp:69
Definition unicode_bidi.hpp:95
Description of a unicode code point.
Definition unicode_description.hpp:62
constexpr unicode_bidi_class bidi_class() const noexcept
The bidi class of this code-point This function is used by the bidirectional algorithm to figure out ...
Definition unicode_description.hpp:134
T emplace_back(T... args)