mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Move ShapedText to the detail namespace and expose it in the headers
This makes it accessible for the new TextEditor implementation in juce_gui_basics.
This commit is contained in:
parent
e31fb368b6
commit
1b595311d0
39 changed files with 891 additions and 607 deletions
|
|
@ -177,13 +177,13 @@ public:
|
|||
return text.size();
|
||||
}
|
||||
|
||||
BidiParagraph createParagraph (size_t offset, std::optional<TextDirection> d = {}) const
|
||||
BidiParagraph createParagraph (size_t offset, std::optional<detail::TextDirection> d = {}) const
|
||||
{
|
||||
BidiParagraph::ParagraphPtr result { SBAlgorithmCreateParagraph (algorithm.get(), offset, text.size() - offset, [&]() -> SBLevel
|
||||
{
|
||||
if (! d.has_value())
|
||||
return SBLevelDefaultLTR;
|
||||
return *d == TextDirection::rtl ? 1 : 0;
|
||||
return *d == detail::TextDirection::rtl ? 1 : 0;
|
||||
}()) };
|
||||
|
||||
jassert (result != nullptr);
|
||||
|
|
@ -192,7 +192,7 @@ public:
|
|||
}
|
||||
|
||||
template <typename Fn>
|
||||
void forEachParagraph (Fn&& callback, std::optional<TextDirection> dir = {}) const
|
||||
void forEachParagraph (Fn&& callback, std::optional<detail::TextDirection> dir = {}) const
|
||||
{
|
||||
for (size_t i = 0; i < text.size();)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -82,12 +82,4 @@ enum class TextBreakType
|
|||
hard // The sequence of characters must be broken here.
|
||||
};
|
||||
|
||||
/** Types of text direction. This may also be applied to characters. */
|
||||
enum class TextDirection
|
||||
{
|
||||
ltr, // This text reads left to right.
|
||||
|
||||
rtl // This text reads right to left.
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue