Add Roboto Flex as default attribution font

This commit is contained in:
Dan Paulat 2024-03-02 23:28:35 -06:00
parent 5efeeb1080
commit 6b00c55bac
8 changed files with 16 additions and 6 deletions

View file

@ -67,6 +67,7 @@ Supercell Wx uses assets from the following sources:
| [Font Awesome Free](https://fontawesome.com/) | CC BY 4.0 License |
| [Inconsolata](https://fonts.google.com/specimen/Inconsolata) | SIL Open Font License |
| [NOAA's Weather and Climate Toolkit](https://www.ncdc.noaa.gov/wct/) | Public Domain | Default Color Tables |
| [Roboto Flex](https://fonts.google.com/specimen/Roboto+Flex) | SIL Open Font License |
| [Supercell thunderstorm with dramatic clouds](https://www.shutterstock.com/image-photo/supercell-thunderstorm-dramatic-clouds-1354353521) | Shutterstock Standard License | Photo by John Sirlin
Services

Binary file not shown.

View file

@ -18,6 +18,7 @@
<file>res/fonts/din1451alt.ttf</file>
<file>res/fonts/din1451alt_g.ttf</file>
<file>res/fonts/Inconsolata-Regular.ttf</file>
<file>res/fonts/RobotoFlex-Regular.ttf</file>
<file>res/icons/scwx-64.png</file>
<file>res/icons/scwx-256.ico</file>
<file>res/icons/scwx-256.png</file>

View file

@ -28,7 +28,8 @@ static void LoadTextures();
static const std::vector<std::pair<types::Font, std::string>> fontNames_ {
{types::Font::din1451alt, ":/res/fonts/din1451alt.ttf"},
{types::Font::din1451alt_g, ":/res/fonts/din1451alt_g.ttf"},
{types::Font::Inconsolata_Regular, ":/res/fonts/Inconsolata-Regular.ttf"}};
{types::Font::Inconsolata_Regular, ":/res/fonts/Inconsolata-Regular.ttf"},
{types::Font::RobotoFlex_Regular, ":/res/fonts/RobotoFlex-Regular.ttf"}};
void Initialize()
{

View file

@ -15,19 +15,23 @@ static const std::string logPrefix_ = "scwx::qt::settings::text_settings";
static const std::string kAlteDIN1451Mittelscrhift_ {
"Alte DIN 1451 Mittelschrift"};
static const std::string kInconsolata_ {"Inconsolata"};
static const std::string kRobotoFlex_ {"Roboto Flex"};
static const std::string kRegular_ {"Regular"};
static const std::unordered_map<types::FontCategory, std::string>
kDefaultFontFamily_ {
{types::FontCategory::Default, kAlteDIN1451Mittelscrhift_},
{types::FontCategory::Tooltip, kInconsolata_}};
{types::FontCategory::Tooltip, kInconsolata_},
{types::FontCategory::Attribution, kRobotoFlex_}};
static const std::unordered_map<types::FontCategory, std::string>
kDefaultFontStyle_ {{types::FontCategory::Default, kRegular_},
{types::FontCategory::Tooltip, kRegular_}};
{types::FontCategory::Tooltip, kRegular_},
{types::FontCategory::Attribution, kRegular_}};
static const std::unordered_map<types::FontCategory, double>
kDefaultFontPointSize_ {{types::FontCategory::Default, 12.0},
{types::FontCategory::Tooltip, 10.5}};
{types::FontCategory::Tooltip, 10.5},
{types::FontCategory::Attribution, 9.0}};
class TextSettings::Impl
{

View file

@ -37,7 +37,8 @@ enum class Font
{
din1451alt,
din1451alt_g,
Inconsolata_Regular
Inconsolata_Regular,
RobotoFlex_Regular
};
} // namespace types

View file

@ -14,6 +14,7 @@ namespace types
static const std::unordered_map<FontCategory, std::string> fontCategoryName_ {
{FontCategory::Default, "Default"},
{FontCategory::Tooltip, "Tooltip"},
{FontCategory::Attribution, "Attribution"},
{FontCategory::Unknown, "?"}};
static const std::unordered_map<TooltipMethod, std::string> tooltipMethodName_ {

View file

@ -15,10 +15,11 @@ enum class FontCategory
{
Default,
Tooltip,
Attribution,
Unknown
};
typedef scwx::util::
Iterator<FontCategory, FontCategory::Default, FontCategory::Tooltip>
Iterator<FontCategory, FontCategory::Default, FontCategory::Attribution>
FontCategoryIterator;
enum class TooltipMethod