mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-07-29 09:18:43 -04:00
24 lines
831 B
C++
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));
|
|
}
|
|
}
|