28 #ifndef YSL_INC_Service_TextLayout_h_
29 #define YSL_INC_Service_TextLayout_h_ 1
32 #include YFM_YSLib_Service_TextRenderer
107 template<
typename _tIter,
115 for(; *s != char() && w < max_width;
yunseq(++s, ++r))
126 template<
typename _tIter,
135 for(; n-- != 0 && *s !=
c && w < max_width;
yunseq(++s, ++
r))
146 template<
typename _tIter,
155 for(; s != g && *s !=
c && w < max_width;
yunseq(++s, ++
r))
163 template<
class _tString,
165 inline pair<size_t, SDst>
174 template<
class _tString,
176 inline pair<size_t, SDst>
189 template<
typename _tIter,
196 for(; *s != char(); ++
s)
208 template<
typename _tIter,
215 for(; n-- != 0 && *s !=
c; ++
s)
227 template<
typename _tIter,
234 for(; s != g && *s !=
c; ++
s)
245 template<
class _tString,
256 template<
class _tString,
269 template<
typename _tIter,
286 template<
typename _tIter,
302 template<
class _tString,
315 template<
typename _tIter,
322 std::for_each(first, last,
323 [&](decltype(*first)& str){
326 if(ln_width > max_width)
327 max_width = ln_width;
SDst FetchStringWidth(const Font &fnt, _tIter s)
取迭代器指定的单行字符串在字体指定、无边界限制时的显示宽度。
static auto first(const _tIterator &i) -> decltype((i->first))
pair< size_t, SDst > FetchStringOffsets(size_t max_width, const Font &fnt, _tIter s)
取迭代器指定的单行字符串在指定字体和宽度时的最多能显示的字符数和宽。
SDst FetchMaxTextWidth(const Font &font, _tIter first, _tIter last)
取指定字体显示的迭代器范围中的文本的最大宽度。
_tIter PrintString(_tRenderer &r, _tIter s)
打印迭代器指定的起始字符的字符串,直至区域末尾或字符迭代终止。
enable_if_t< is_class< decay_t< _tParam >>::value, int > enable_for_string_class_t
选择字符串类类型的特定重载避免和其它非字符串类型冲突。
std::uint16_t SDst
屏幕坐标距离。
YF_API SDst FetchResizedBottomMargin(const TextState &, SDst)
取指定文本状态和文本区域高调整的底边距。
SDst AdjustBottomMarginOf(TextRegion &tr)
按字体高度和行距调整文本区域的底边距。
YF_API SPos FetchLastLineBasePosition(const TextState &, SDst)
取指定文本状态在指定高的区域中表示的最底行的基线位置(纵坐标)。
Padding Margin
边距:文本区域到显示区域的距离。
YF_API SDst FetchCharWidth(const Font &, ucs4_t)
取指定的字符使用指定字体的显示宽度。
#define yunseq
无序列依赖表达式组求值。
YF_API u16 FetchResizedLineN(const TextState &ts, SDst)
取指定文本状态和文本区域高所能显示的最大文本行数。
bool is_undereferenceable(const any_input_iterator< _type, _tDifference, _tPointer, _tReference > &i)
enable_if_t< is_same< decltype(++std::declval< _tParam & >()), _tParam & >::value, int > enable_for_iterator_t
选择迭代器类型的特定重载避免和其它类型冲突。
char32_t ucs4_t
UCS-4 字符类型。
#define YAssert(_expr, _msg)