Added support for italic and bold variants of studio and satcom fonts
They aren't currently used anywhere1008-fix
parent
3801ab87a2
commit
ff97df74c6
|
@ -46,7 +46,10 @@ const std::map<Gfx::FontType, std::string> defaultFont =
|
||||||
{ Gfx::FONT_COMMON_ITALIC, "dvu_sans_italic.ttf" },
|
{ Gfx::FONT_COMMON_ITALIC, "dvu_sans_italic.ttf" },
|
||||||
{ Gfx::FONT_STUDIO, "dvu_sans_mono.ttf" },
|
{ Gfx::FONT_STUDIO, "dvu_sans_mono.ttf" },
|
||||||
{ Gfx::FONT_STUDIO_BOLD, "dvu_sans_mono_bold.ttf" },
|
{ Gfx::FONT_STUDIO_BOLD, "dvu_sans_mono_bold.ttf" },
|
||||||
|
{ Gfx::FONT_STUDIO_ITALIC, "dvu_sans_mono_italic.ttf" },
|
||||||
{ Gfx::FONT_SATCOM, "dvu_sans.ttf" },
|
{ Gfx::FONT_SATCOM, "dvu_sans.ttf" },
|
||||||
|
{ Gfx::FONT_SATCOM_BOLD, "dvu_sans_bold.ttf" },
|
||||||
|
{ Gfx::FONT_SATCOM_ITALIC, "dvu_sans_italic.ttf" },
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::map<Gfx::FontType, std::string> fontType =
|
const std::map<Gfx::FontType, std::string> fontType =
|
||||||
|
@ -56,7 +59,10 @@ const std::map<Gfx::FontType, std::string> fontType =
|
||||||
{ Gfx::FONT_COMMON_ITALIC, "FontCommonItalic" },
|
{ Gfx::FONT_COMMON_ITALIC, "FontCommonItalic" },
|
||||||
{ Gfx::FONT_STUDIO, "FontStudio" },
|
{ Gfx::FONT_STUDIO, "FontStudio" },
|
||||||
{ Gfx::FONT_STUDIO_BOLD, "FontStudioBold" },
|
{ Gfx::FONT_STUDIO_BOLD, "FontStudioBold" },
|
||||||
|
{ Gfx::FONT_STUDIO_ITALIC, "FontStudioItalic" },
|
||||||
{ Gfx::FONT_SATCOM, "FontSatCom" },
|
{ Gfx::FONT_SATCOM, "FontSatCom" },
|
||||||
|
{ Gfx::FONT_SATCOM_BOLD, "FontSatComBold" },
|
||||||
|
{ Gfx::FONT_SATCOM_ITALIC, "FontSatComItalic" },
|
||||||
};
|
};
|
||||||
|
|
||||||
class CFontConfig
|
class CFontConfig
|
||||||
|
|
|
@ -128,14 +128,12 @@ bool CText::Create()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_fonts[FONT_COMMON] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_COMMON));
|
for (auto type : {FONT_COMMON, FONT_STUDIO, FONT_SATCOM})
|
||||||
m_fonts[FONT_COMMON_BOLD] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_COMMON_BOLD));
|
{
|
||||||
m_fonts[FONT_COMMON_ITALIC] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_COMMON_ITALIC));
|
m_fonts[static_cast<Gfx::FontType>(type)] = MakeUnique<MultisizeFont>(fontConfig.GetFont(type));
|
||||||
|
m_fonts[static_cast<Gfx::FontType>(type|FONT_BOLD)] = MakeUnique<MultisizeFont>(fontConfig.GetFont(static_cast<Gfx::FontType>(type|FONT_BOLD)));
|
||||||
m_fonts[FONT_SATCOM] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_SATCOM));
|
m_fonts[static_cast<Gfx::FontType>(type|FONT_ITALIC)] = MakeUnique<MultisizeFont>(fontConfig.GetFont(static_cast<Gfx::FontType>(type|FONT_ITALIC)));
|
||||||
|
}
|
||||||
m_fonts[FONT_STUDIO] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_STUDIO));
|
|
||||||
m_fonts[FONT_STUDIO_BOLD] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_STUDIO_BOLD));
|
|
||||||
|
|
||||||
for (auto it = m_fonts.begin(); it != m_fonts.end(); ++it)
|
for (auto it = m_fonts.begin(); it != m_fonts.end(); ++it)
|
||||||
{
|
{
|
||||||
|
|
|
@ -83,14 +83,19 @@ enum FontType
|
||||||
//! Alias for italic colobot font
|
//! Alias for italic colobot font
|
||||||
FONT_COMMON_ITALIC = FONT_COMMON | FONT_ITALIC,
|
FONT_COMMON_ITALIC = FONT_COMMON | FONT_ITALIC,
|
||||||
|
|
||||||
//! Courier (monospace) font used mainly in code editor (only regular & bold)
|
//! Studio font used mainly in code editor
|
||||||
FONT_STUDIO = 0x01,
|
FONT_STUDIO = 0x01,
|
||||||
//! Alias for bold courier font
|
//! Alias for bold studio font
|
||||||
FONT_STUDIO_BOLD = FONT_STUDIO | FONT_BOLD,
|
FONT_STUDIO_BOLD = FONT_STUDIO | FONT_BOLD,
|
||||||
|
//! Alias for italic studio font (at this point not used anywhere)
|
||||||
|
FONT_STUDIO_ITALIC = FONT_STUDIO | FONT_ITALIC,
|
||||||
|
|
||||||
//! SatCom font used for interface
|
//! SatCom font used for interface (currently bold and italic wariants aren't used anywhere)
|
||||||
|
|
||||||
FONT_SATCOM = 0x02,
|
FONT_SATCOM = 0x02,
|
||||||
|
//! Alias for bold satcom font
|
||||||
|
FONT_SATCOM_BOLD = FONT_SATCOM | FONT_BOLD,
|
||||||
|
//! Alias for italic satcom font
|
||||||
|
FONT_SATCOM_ITALIC = FONT_SATCOM | FONT_ITALIC,
|
||||||
|
|
||||||
//! Pseudo-font loaded from textures for buttons, icons, etc.
|
//! Pseudo-font loaded from textures for buttons, icons, etc.
|
||||||
FONT_BUTTON = 0x03,
|
FONT_BUTTON = 0x03,
|
||||||
|
|
Loading…
Reference in New Issue