| @@ -625,6 +625,10 @@ int Font::getStringWidth (const String& text) const | |||||
| float Font::getStringWidthFloat (const String& text) const | float Font::getStringWidthFloat (const String& text) const | ||||
| { | { | ||||
| // This call isn't thread-safe when there's a message thread running | |||||
| jassert (MessageManager::getInstanceWithoutCreating() == nullptr | |||||
| || MessageManager::getInstanceWithoutCreating()->currentThreadHasLockedMessageManager()); | |||||
| auto w = getTypeface()->getStringWidth (text); | auto w = getTypeface()->getStringWidth (text); | ||||
| if (font->kerning != 0.0f) | if (font->kerning != 0.0f) | ||||
| @@ -635,6 +639,10 @@ float Font::getStringWidthFloat (const String& text) const | |||||
| void Font::getGlyphPositions (const String& text, Array<int>& glyphs, Array<float>& xOffsets) const | void Font::getGlyphPositions (const String& text, Array<int>& glyphs, Array<float>& xOffsets) const | ||||
| { | { | ||||
| // This call isn't thread-safe when there's a message thread running | |||||
| jassert (MessageManager::getInstanceWithoutCreating() == nullptr | |||||
| || MessageManager::getInstanceWithoutCreating()->currentThreadHasLockedMessageManager()); | |||||
| getTypeface()->getGlyphPositions (text, glyphs, xOffsets); | getTypeface()->getGlyphPositions (text, glyphs, xOffsets); | ||||
| if (auto num = xOffsets.size()) | if (auto num = xOffsets.size()) | ||||