Qt C++ Is there a way to get a list of all available system languages, including substitutes?

73 Views Asked by At

So, there is a QFontDatabase::families() method which returns a QStringList of all available font families probably by looking it up at local registry, such as HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts. Currently I'm trying to make a combobox which includes not only all available system font families, but their substitutes as well, such as Arial Baltic, Arial Greek, etc.

At first I thought that a simple nested loop of iterating over each font family and running it throught QFont::substitutes() or QFont::substitutions() method, and then looping through returned QStringLists and pushing back these families into a separate container would work, but these methods just return an empty QStringList every time, even though I can clearly see that in my registry, a bunch of font substitutions do in fact exist.

Sadly, I couldn't find any relevant information nor examples on these methods on Internet, so my current theory is QFont does not dirrectly load system font substitutions but instead only works with the ones that you insert by yourself, using QFont::insertSubstitutions

I know that I could've used WINAPI's EnumFontFamilies method and that it does in fact provide me with what I'm looking for, but saldy, that would limit my current implementation to windows only

0

There are 0 best solutions below