LibGfx: Remove unused FontStyleMapping helpers
This commit is contained in:
parent
8e616a1ec0
commit
0166f555eb
1 changed files with 0 additions and 70 deletions
|
|
@ -16,19 +16,6 @@ struct FontStyleMapping {
|
|||
StringView name;
|
||||
};
|
||||
|
||||
static constexpr Array<FontStyleMapping, 10> font_weight_names = { {
|
||||
{ 100, "Thin"sv },
|
||||
{ 200, "Extra Light"sv },
|
||||
{ 300, "Light"sv },
|
||||
{ 400, "Regular"sv },
|
||||
{ 500, "Medium"sv },
|
||||
{ 600, "Semi Bold"sv },
|
||||
{ 700, "Bold"sv },
|
||||
{ 800, "Extra Bold"sv },
|
||||
{ 900, "Black"sv },
|
||||
{ 950, "Extra Black"sv },
|
||||
} };
|
||||
|
||||
static constexpr Array<FontStyleMapping, 4> font_slope_names = { {
|
||||
{ 0, "Regular"sv },
|
||||
{ 1, "Italic"sv },
|
||||
|
|
@ -36,45 +23,6 @@ static constexpr Array<FontStyleMapping, 4> font_slope_names = { {
|
|||
{ 3, "Reclined"sv },
|
||||
} };
|
||||
|
||||
static constexpr Array<FontStyleMapping, 9> font_width_names = { {
|
||||
{ 1, "Ultra Condensed"sv },
|
||||
{ 2, "Extra Condensed"sv },
|
||||
{ 3, "Condensed"sv },
|
||||
{ 4, "Semi Condensed"sv },
|
||||
{ 5, "Normal"sv },
|
||||
{ 6, "Semi Expanded"sv },
|
||||
{ 7, "Expanded"sv },
|
||||
{ 8, "Extra Expanded"sv },
|
||||
{ 9, "Ultra Expanded"sv },
|
||||
} };
|
||||
|
||||
static constexpr StringView weight_to_name(int weight)
|
||||
{
|
||||
for (auto& it : font_weight_names) {
|
||||
if (it.style == weight)
|
||||
return it.name;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
static constexpr int name_to_weight(StringView name)
|
||||
{
|
||||
for (auto& it : font_weight_names) {
|
||||
if (it.name == name)
|
||||
return it.style;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
static constexpr StringView slope_to_name(int slope)
|
||||
{
|
||||
for (auto& it : font_slope_names) {
|
||||
if (it.style == slope)
|
||||
return it.name;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
static constexpr int name_to_slope(StringView name)
|
||||
{
|
||||
for (auto& it : font_slope_names) {
|
||||
|
|
@ -84,22 +32,4 @@ static constexpr int name_to_slope(StringView name)
|
|||
return {};
|
||||
}
|
||||
|
||||
static constexpr StringView width_to_name(int width)
|
||||
{
|
||||
for (auto& it : font_width_names) {
|
||||
if (it.style == width)
|
||||
return it.name;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
static constexpr int name_to_width(StringView name)
|
||||
{
|
||||
for (auto& it : font_width_names) {
|
||||
if (it.name == name)
|
||||
return it.style;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue