34 typedef std::basic_string<char, neolib::ci_char_traits<std::char_traits<char> > >
ci_string;
108 return g.
font != font_id{};
233 template <
typename GlyphT,
typename ConstIterator = GlyphT const*,
typename Iterator = GlyphT*>
310 template <
typename Container,
typename ConstIterator =
typename Container::const_iterator,
typename Iterator =
typename Container::iterator>
314 typedef Container base_type;
329 static constexpr std::size_t SMALL_OPTIMIZATION_FONT_COUNT = 4;
330 typedef Container container_type;
334 typedef std::pair<neolib::small_cookie_ref_ptr, font> cache_entry;
339 const font& glyph_font()
const;
340 const font& glyph_font(font_id aFontId)
const;
342 void cache_glyph_font(font_id aFontId)
const;
343 void cache_glyph_font(
const font& aFont)
const;
347 mutable cache iCache;
352 template <
typename Iter>
354 container_type{ aBegin, aEnd },
362 self_type&
operator=(
const self_type& aOther);
363 self_type&
operator=(self_type&& aOther);
370 bool empty()
const override;
372 void clear()
override;
374 template<
class... Args >
377 auto& result = container_type::emplace_back(std::forward<Args>(args)...);
378 iExtents = std::nullopt;
383 using container_type::back;
393 bool operator==(
const self_type& aOther)
const;
420 mutable cache<neogfx::size> iExtents;
447 template <
typename GlyphIter>
448 glyph_text(font
const& aFont, GlyphIter aGlyphsBegin, GlyphIter aGlyphsEnd) :
451 for (
auto const&
glyph : std::ranges::subrange(aGlyphsBegin, aGlyphsEnd))
506 template <
typename Iter>
511 for (Iter i = aBegin; !gotOne && i != aEnd; ++i)
539 typedef std::function<font(std::size_t)> function_type;
542 iSelectorFunction{ aSelectorFunction }
548 return iSelectorFunction(CharacterPos);
551 function_type iSelectorFunction;
570 return to_glyph_text(aContext, aString.data(), aString.data() + aString.size(),
font_selector{ aFontSelector }, aAlignBaselines);
578 return to_glyph_text(aContext, aString.data(), aString.data() + aString.size(),
font_selector{ aFontSelector }, aAlignBaselines);
const_iterator cend() const override
self_type & operator=(const self_type &aOther)
ConstIterator const_iterator
self_type & align_baselines() override
basic_glyph_text_content()
void set_major_font(const font &aFont) override
void cache_glyph_font(font_id aFontId) const override
i_basic_glyph_text< typename Container::value_type, ConstIterator, Iterator > abstract_type
std::pair< const_iterator, const_iterator > word_break(const_iterator aBegin, const_iterator aFrom) const override
void push_back(const_reference aGlyphChar) override
void set_extents(const neogfx::size &aExtents) override
vector< size_type > const & line_breaks() const override
const_iterator cbegin() const override
iterator begin() override
size_type size() const override
value_type const & const_reference
const font & glyph_font() const override
scalar baseline() const override
void clone(i_ref_ptr< abstract_type > &aClone) const override
neogfx::size extents() const override
reference emplace_back(Args &&... args)
basic_glyph_text_content(Iter aBegin, Iter aEnd)
bool empty() const override
const font & major_font() const override
container_type const & container() const
void set_baseline(scalar aBaseline) override
bool operator!=(const character_type &aRhs) const
character_type(text_category aCategory)
bool operator==(const character_type &aRhs) const
character_type(text_category aCategory, text_direction aDirection)
font select_font(std::size_t CharacterPos) const override
font_selector(function_type const &aSelectorFunction)
i_glyph_text::const_iterator const_iterator
i_glyph_text::const_reference const_reference
const font & glyph_font() const
const_iterator end() const
glyph_text(font const &aFont, GlyphIter aGlyphsBegin, GlyphIter aGlyphsEnd)
i_glyph_text::difference_type difference_type
i_glyph_text::iterator iterator
const font & glyph_font(const_reference aGlyphChar) const
const_iterator begin() const
glyph_text(glyph_text const &aOther)
const_reference back() const
i_glyph_text::const_pointer const_pointer
std::pair< iterator, iterator > word_break(const_iterator aBegin, const_iterator aFrom)
const_iterator cbegin() const
const_iterator cend() const
glyph_text(font const &aFont)
i_glyph_text::pointer pointer
neogfx::size extents() const
neogfx::size extents(const_reference aGlyphChar) const
glyph_text(i_glyph_text &aContents)
glyph_text operator=(const glyph_text &aOther)
void set_extents(const neogfx::size &aExtents)
i_glyph_text::size_type size_type
std::pair< const_iterator, const_iterator > word_break(const_iterator aBegin, const_iterator aFrom) const
neogfx::size extents(const_iterator aBegin, const_iterator aEnd) const
const i_glyph & glyph(const_reference aGlyphChar) const
i_glyph_text::reference reference
i_glyph_text & content() const
virtual std::pair< const_iterator, const_iterator > word_break(const_iterator aBegin, const_iterator aFrom) const =0
ConstIterator const_iterator
virtual i_vector< size_type > const & line_breaks() const =0
virtual std::pair< iterator, iterator > word_break(const_iterator aBegin, const_iterator aFrom)=0
value_type const * const_pointer
virtual neogfx::size extents(const_reference aGlyphChar) const =0
virtual void cache_glyph_font(const font &aFont) const =0
virtual void clone(i_ref_ptr< self_type > &aClone) const =0
virtual void set_extents(const neogfx::size &aExtents)=0
virtual neogfx::size extents() const =0
virtual iterator begin()=0
virtual const font & major_font() const =0
virtual const font & glyph_font(const_reference aGlyphChar) const =0
virtual size_type size() const =0
const_iterator end() const
virtual const font & glyph_font() const =0
virtual self_type & align_baselines()=0
virtual const i_glyph & glyph(const_reference aGlyphChar) const =0
value_type const & const_reference
std::ptrdiff_t difference_type
virtual i_vector< size_type > & line_breaks()=0
virtual void set_baseline(scalar aBaseline)=0
const_iterator begin() const
virtual const_iterator cbegin() const =0
virtual neogfx::size extents(const_iterator aBegin, const_iterator aEnd) const =0
virtual void cache_glyph_font(font_id aFontId) const =0
virtual align_baselines_result align_baselines(iterator aBegin, iterator aEnd, bool aJustCalculate=false)=0
virtual void push_back(const_reference aGlyphChar)=0
virtual bool empty() const =0
virtual const_iterator cend() const =0
virtual void set_major_font(const font &aFont)=0
virtual scalar baseline() const =0
ref_ptr< self_type > clone() const
virtual font select_font(std::size_t CharacterPos) const =0
virtual ~i_font_selector()=default
glyph_text to_glyph_text(i_graphics_context const &aContext, std::string_view const &aString, std::function< font(std::size_t)> aFontSelector, bool aAlignBaselines=true)
glyph_text to_glyph_text(i_graphics_context const &aContext, char32_t const *aUtf32Begin, char32_t const *aUtf32End, std::function< font(std::size_t)> aFontSelector, bool aAlignBaselines=true)
glyph_text to_glyph_text(i_graphics_context const &aContext, std::u32string_view const &aString, std::function< font(std::size_t)> aFontSelector, bool aAlignBaselines=true)
virtual glyph_text create_glyph_text(font const &aFont)=0
glyph_text to_glyph_text(i_graphics_context const &aContext, i_string const &aString, std::function< font(std::size_t)> aFontSelector, bool aAlignBaselines=true)
virtual glyph_text to_glyph_text(i_graphics_context const &aContext, char const *aUtf8Begin, char const *aUtf8End, i_font_selector const &aFontSelector, bool aAlignBaselines=true)=0
virtual glyph_text to_glyph_text(i_graphics_context const &aContext, char32_t const *aUtf32Begin, char32_t const *aUtf32End, i_font_selector const &aFontSelector, bool aAlignBaselines=true)=0
virtual glyph_text create_glyph_text()=0
virtual ~i_glyph_text_factory()=default
glyph_text to_glyph_text(i_graphics_context const &aContext, char const *aUtf8Begin, char const *aUtf8End, std::function< font(std::size_t)> aFontSelector, bool aAlignBaselines=true)
virtual size_type size() const noexcept=0
virtual const value_type * c_str() const noexcept=0
void set_mnemonic(glyph_char &g, bool aMnemonic)
bool below_ascender_line(glyph_char const &g)
bool is_whitespace(glyph_char const &g)
bool category_has_no_direction(glyph_char const &g)
std::basic_string< char, neolib::ci_char_traits< std::char_traits< char > > > ci_string
void set_subscript(glyph_char &g, bool aSubscript, bool aAboveBaseline=false)
void set_subpixel(glyph_char &g, bool aSubpixel)
bool above_baseline(glyph_char const &g)
constexpr std::size_t SMALL_OPTIMIZATION_GLYPH_TEXT_GLYPH_COUNT
bool underline(glyph_char const &g)
text_direction direction(glyph_char const &g)
std::optional< glyph_text > optional_glyph_text
bool mnemonic(glyph_char const &g)
bool right_to_left(glyph_char const &g)
bool left_to_right(glyph_char const &g)
constexpr object_type category(object_type aType)
basic_glyph_text_content< neolib::vecarray< glyph_char, SMALL_OPTIMIZATION_GLYPH_TEXT_GLYPH_COUNT, -1 >, glyph_char const *, glyph_char * > glyph_text_content
bool superscript(glyph_char const &g)
bool operator==(const basic_rect< CoordinateType, CoordinateSystem > &left, const basic_rect< CoordinateType, CoordinateSystem > &right)
bool has_font(glyph_char const &g)
bool has_font_glyph(glyph_char const &g)
void set_category(glyph_char &g, text_category c)
bool is_non_line_breaking_whitespace(glyph_char const &g)
bool is_emoji(glyph_char const &g)
bool subpixel(glyph_char const &g)
bool is_line_breaking_whitespace(glyph_char const &g)
bool subscript(glyph_char const &g)
void set_underline(glyph_char &g, bool aUnderline)
void set_superscript(glyph_char &g, bool aSuperscript, bool aBelowAscenderLine=false)
text_direction glyph_text_direction(Iter aBegin, Iter aEnd)
bool is_digit(glyph_char const &g)
std::array< vec3, 4 > quad
std::array< vec2f, 4 > quadf_2d
boost::fast_pool_allocator< T, boost::default_user_allocator_new_delete, boost::details::pool::null_mutex, NextSize > fast_pool_allocator
std::uint32_t cluster_index
std::pair< cluster_index, cluster_index > cluster_range
glyph_text::difference_type end
glyph_text::difference_type begin
neolib::vecarray< line, 8, -1 > lines_t