add: more font
This commit is contained in:
@@ -65,12 +65,32 @@ int main()
|
||||
{110, (int)display->getSize().height - 10},
|
||||
5);
|
||||
|
||||
target.DrawText("abcdefghijklmnopqrstuvwxyz", {100, 50}, *font, 14);
|
||||
target.DrawText("Hallo Welt!", {100, 50}, *font, 14);
|
||||
target.DrawText("Hallo Welt!", {50, 100}, *font, 30);
|
||||
|
||||
display->Display(target.getImage());
|
||||
|
||||
std::this_thread::sleep_for(10s);
|
||||
|
||||
target.Clear();
|
||||
|
||||
frame::Vector pos = display->getSize() / 2;
|
||||
|
||||
auto text = "10:30";
|
||||
|
||||
pos.x -= font->getLength(text, 250) / 2;
|
||||
pos.y += font->getHeight(text, 250) / 2;
|
||||
pos.y -= font->getMaxYOffset(text, 250) + font->getHeight(text, 250);
|
||||
|
||||
target.DrawText(text, pos, *font, 250);
|
||||
|
||||
target.DrawTextGlyphBounds(text, pos, *font, 250);
|
||||
target.DrawLine({0, (int32_t)pos.y},
|
||||
{(int32_t)display->getSize().width, pos.y});
|
||||
display->Display(target.getImage());
|
||||
|
||||
std::this_thread::sleep_for(10s);
|
||||
|
||||
display->Clear(frame::display::Color::WHITE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user