Search code examples
c++windowsmacosuser-interfacejuce

GUI loading issue on Windows compare to OsX


I use Juce C++ 4.0.2 to build an audio plugin with a relatively heavy GUI. It takes 5s to load the GUI on a DAW like reaper on OsX, but it takes 10 times more on Windows using the same DAW.

I eventually figure out that is it due to the Typeface::createSystemTypefaceFor function that takes 100ms on Windows. It was an issue on my side because I used it many times.

Does anyone face the same issue?


Solution

  • Typeface::createSystemTypefaceFor is not designed to be called frequently; you should call it once for each typeface ideally and cache the results. Calling it frequently will cause a performance hit which varies depending on platform, as you are experiencing.