mirror of https://github.com/axmolengine/axmol.git
Merge pull request #15690 from halx99/patch-2
change if (fontName.c_str()) to if(!fontName.empty())
This commit is contained in:
commit
16a1605927
|
@ -99,7 +99,7 @@ public:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool setFont(const char * pFontName = nullptr, int nSize = 0)
|
bool setFont(const char * pFontName = "", int nSize = 0)
|
||||||
{
|
{
|
||||||
bool bRet = false;
|
bool bRet = false;
|
||||||
do
|
do
|
||||||
|
@ -110,7 +110,7 @@ public:
|
||||||
LOGFONTA tNewFont = {0};
|
LOGFONTA tNewFont = {0};
|
||||||
LOGFONTA tOldFont = {0};
|
LOGFONTA tOldFont = {0};
|
||||||
GetObjectA(hDefFont, sizeof(tNewFont), &tNewFont);
|
GetObjectA(hDefFont, sizeof(tNewFont), &tNewFont);
|
||||||
if (fontName.c_str())
|
if (!fontName.empty())
|
||||||
{
|
{
|
||||||
// create font from ttf file
|
// create font from ttf file
|
||||||
if (FileUtils::getInstance()->getFileExtension(fontName) == ".ttf")
|
if (FileUtils::getInstance()->getFileExtension(fontName) == ".ttf")
|
||||||
|
|
Loading…
Reference in New Issue