mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
DirectWrite: Return styles in the order reported by the system
This is more likely to place the regular/default style first in the list of styles.
This commit is contained in:
parent
14dc97a29e
commit
27d877c175
1 changed files with 9 additions and 3 deletions
|
|
@ -153,12 +153,18 @@ public:
|
||||||
if (FAILED (collection->GetFontFamily (fontIndex, fontFamily.resetAndGetPointerAddress())) || fontFamily == nullptr)
|
if (FAILED (collection->GetFontFamily (fontIndex, fontFamily.resetAndGetPointerAddress())) || fontFamily == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
std::set<String> results;
|
std::set<String> uniqueResults;
|
||||||
|
StringArray orderedResults;
|
||||||
|
|
||||||
for (const auto& font : getAllFontsInFamily (fontFamily))
|
for (const auto& font : getAllFontsInFamily (fontFamily))
|
||||||
results.insert (getFontFaceName (font));
|
{
|
||||||
|
const auto name = getFontFaceName (font);
|
||||||
|
|
||||||
return stringArrayFromRange (results);
|
if (uniqueResults.insert (name).second)
|
||||||
|
orderedResults.add (name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return orderedResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue