Files
MuditaOS/module-gui/test/test-catch-text/test-gui-Font.cpp
pholat 50a1f97643 [feature] Font handling feature (#527)
* Font renamed to RawFont
* Added gui::Font adapter
2020-07-15 12:15:14 +02:00

24 lines
831 B
C++

#include <catch2/catch.hpp>
#include <FontManager.hpp>
#include <Font.hpp>
#include <Style.hpp>
TEST_CASE("Testo Font")
{
using namespace gui;
auto &fm = FontManager::getInstance();
fm.init("assets");
SECTION("medium font")
{
auto f = Font(27);
auto raw_font = fm.getFont(style::window::font::medium);
REQUIRE(fm.getFont("gt_pressura_regular_27") == raw_font); /// check that style is ok
REQUIRE(f.raw() == raw_font); /// check that Font() works ok
f.setWeight(Font::Weight::Bold);
REQUIRE(f.raw() == fm.getFont(style::window::font::mediumbold)); // check for changed weight
f.setSize(30); // we are bold, now set size 30 which is bigbold
REQUIRE(f.raw() == fm.getFont(style::window::font::bigbold));
}
}