Seems like same issue, but it still happens.
My app and FontsDemo crash on my machine.
Maybe it happens only for my machine(mysterious enough, Windows sometimes badly treat font data), but those who use Font::findFonts() also suffer this problem, because it can be happen in the end-user machine.
What happened:
dwFont
in Font::findAllTypefaceStyles() is nullptr
although the program expects not to be. So read access violation happens at calling GetSimulations()
// Ignore any algorithmically generated bold and oblique styles..
if (dwFont->GetSimulations() == DWRITE_FONT_SIMULATIONS_NONE)
results.addIfNotAlreadyThere (getFontFaceName (dwFont));
My suggestion is, how about adding null check?
// Ignore any algorithmically generated bold and oblique styles..
if (dwFont != nullptr)
if (dwFont->GetSimulations() == DWRITE_FONT_SIMULATIONS_NONE)
results.addIfNotAlreadyThere (getFontFaceName (dwFont));
I don’t know why dwFont
suddenly becomes nullptr, but by adding null check, it works fine anyway.
(by the way, family
was “Cascadia Code”)