add: more font
This commit is contained in:
@@ -173,7 +173,7 @@ namespace frame::render
|
||||
void RenderTarget::DrawText(std::string_view pText,
|
||||
Vector pCenterLineStart,
|
||||
font::Font const& pFont,
|
||||
uint8_t size)
|
||||
uint32_t size)
|
||||
{
|
||||
auto pos = pCenterLineStart;
|
||||
for(auto c : pText)
|
||||
@@ -182,6 +182,31 @@ namespace frame::render
|
||||
}
|
||||
}
|
||||
|
||||
void RenderTarget::DrawTextGlyphBounds(std::string_view pText,
|
||||
Vector pCenterLineStart,
|
||||
font::Font const& pFont,
|
||||
uint32_t size)
|
||||
{
|
||||
auto pos = pCenterLineStart;
|
||||
|
||||
auto lineSpacing = pFont.getLineSpacing(size);
|
||||
auto _3 = lineSpacing / 3;
|
||||
for(auto c : pText)
|
||||
{
|
||||
auto const& g = pFont.getGlyph(size, c);
|
||||
DrawRect({int32_t(pos.x), int32_t(pos.y - _3 * 2)},
|
||||
{int32_t(pos.x + g.advance), int32_t(pos.y + _3)},
|
||||
1);
|
||||
|
||||
pos.x += g.advance;
|
||||
}
|
||||
}
|
||||
|
||||
void RenderTarget::Clear(Color color)
|
||||
{
|
||||
image.Clear(color);
|
||||
}
|
||||
|
||||
void RenderTarget::DrawPointsMirrorCircle(Vector const& center,
|
||||
Vector const& pos,
|
||||
Color color)
|
||||
|
||||
Reference in New Issue
Block a user