28 #ifndef YSL_INC_Service_TextBase_h_
29 #define YSL_INC_Service_TextBase_h_ 1
32 #include YFM_YSLib_Service_YGDI
33 #include YFM_YSLib_Adaptor_Font
34 #include YFM_YSLib_Core_YStorage
117 PDefHOp(
TextState&, =,
const PenStyle& ps)
118 ImplRet(PenStyle::operator=(ps), *
this)
131 ImplRet(Rect(Pen.
X, Pen.
Y - Font.GetAscender(), Font.GetAdvance(
c),
185 return (ts.
Pen.
Y - ts.
Margin.
Top) / GetTextLineHeightExOf(ts);
s8 GetAscender() const
取升部。
yconstexpr Padding DefaultMargin(2, 2, 2, 2)
默认边距。
void SetPenOf(TextState &ts, SPos x, SPos y)
设置笔位置。
void MovePen(TextState &ts, ucs4_t c)
PenStyle(const Drawing::Font &fnt={}, Drawing::Color c=Drawing::ColorSpace::White)
构造:使用指定字体家族、字体大小和颜色。
std::uint16_t SDst
屏幕坐标距离。
SDst GetTextLineHeightOf(const TextState &ts)
取当前指定文本状态的字体设置对应的行高。
Padding Margin
边距:文本区域到显示区域的距离。
GBinaryGroup< SPos > Point
屏幕二维点(直角坐标表示)。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
u16 GetCurrentTextLineNOf(const TextState &ts)
取笔所在的当前行数。
void SetCurrentTextLineNOf(TextState &ts, u16 n)
SPos GetTextLineBaseOf(const TextState &ts)
取第一行的基线位置(纵坐标)。
#define yconstexpr
指定编译时常量表达式。
void CarriageReturn(TextState &ts)
回车。
void AdjustEndOfLine(TextState &ts, const Rect &r, SDst w)
按指定显示区域和文本区域的宽重新设置右边距。
char32_t ucs4_t
UCS-4 字符类型。
#define DefGetterMem(_q, _t, _n, _m)
PDefH(void, DrawLineSeg, const Graphics &g, const Rect &bounds, const Point &p1, const Point &p2, Color c) ImplExpr(DrawLineSeg(g
FontSize GetHeight() const ynothrow
取字体对应的字符高度。
字型家族 (Typeface Family) 标识。
SDst GetTextLineHeightExOf(const TextState &ts)
取当前指定文本状态的字体设置对应的行高与行距之和。