mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-06 04:00:08 +00:00
Linux Fonts: Replace font style if it does not exist for the requested font
This commit is contained in:
parent
f7e957a932
commit
3c08f8beda
1 changed files with 5 additions and 2 deletions
|
|
@ -211,10 +211,13 @@ Typeface::Ptr Font::getDefaultTypefaceForFont (const Font& font)
|
|||
|
||||
Font f (font);
|
||||
|
||||
const auto characteristics = defaultInfo.getRealFontCharacteristics (font.getTypefaceName());
|
||||
const auto name = font.getTypefaceName();
|
||||
const auto characteristics = defaultInfo.getRealFontCharacteristics (name);
|
||||
f.setTypefaceName (characteristics.name);
|
||||
|
||||
if (font.getTypefaceStyle() == Font::getDefaultStyle())
|
||||
const auto styles = findAllTypefaceStyles (name);
|
||||
|
||||
if (! styles.contains (font.getTypefaceStyle()))
|
||||
f.setTypefaceStyle (characteristics.style);
|
||||
|
||||
return Typeface::createSystemTypefaceFor (f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue