Files
Seele/src/Engine/UI/Style/Fonts.h
T

19 lines
751 B
C++

#pragma once
#include "UI/Style/Class.h"
#include <string>
#include <string_view>
namespace Seele {
namespace UI {
// standard font aliases. the name must match what the importer registered the
// font as (e.g. the arial import in main.cpp). the import (AssetImporter::importFont)
// must happen before the first System::style() call — see the invariant in System.h.
// a font *class* is a tag type with a static apply() that sets Style::fontName;
// the name is runtime data (a string literal can't be a C++ template arg), and
// Text::applyStyle resolves it to a PFontAsset (falling back to Theme::defaultFont).
struct Font_Arial {
static void apply(Style& s, const Theme&) { s.fontName = "arial"; }
};
} // namespace UI
} // namespace Seele