mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Fonts (Linux): Return a null typeface when no default typefaces can be found
This commit is contained in:
parent
4d5636c66d
commit
7a1f397de6
1 changed files with 10 additions and 2 deletions
|
|
@ -143,7 +143,12 @@ private:
|
|||
if (name.containsIgnoreCase (choice))
|
||||
return name;
|
||||
|
||||
return names[0];
|
||||
for (auto& name : names)
|
||||
if (name.isNotEmpty())
|
||||
return name;
|
||||
|
||||
jassertfalse;
|
||||
return {};
|
||||
}
|
||||
|
||||
static String getDefaultSansSerifFontName()
|
||||
|
|
@ -200,8 +205,11 @@ Typeface::Ptr Font::Native::getDefaultPlatformTypefaceForFont (const Font& font)
|
|||
|
||||
const auto name = font.getTypefaceName();
|
||||
const auto realName = defaultInfo.getRealFontName (name);
|
||||
f.setTypefaceName (realName);
|
||||
|
||||
if (realName.isEmpty())
|
||||
return nullptr;
|
||||
|
||||
f.setTypefaceName (realName);
|
||||
return Typeface::createSystemTypefaceFor (f);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue