diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index cd7a667525..bb735f176b 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -92031,14 +92031,15 @@ float CustomTypeface::getStringWidth (const String& text) while (! t.isEmpty()) { - const GlyphInfo* const glyph = findGlyphSubstituting (t.getAndAdvance()); + const juce_wchar c = t.getAndAdvance(); + const GlyphInfo* const glyph = findGlyphSubstituting (c); if (glyph == 0 && ! isFallbackFont) { const Typeface::Ptr fallbackTypeface (Typeface::getFallbackTypeface()); if (fallbackTypeface != 0) - x += fallbackTypeface->getStringWidth (String::charToString (*t)); + x += fallbackTypeface->getStringWidth (String::charToString (c)); } if (glyph != 0) diff --git a/src/gui/graphics/fonts/juce_Typeface.cpp b/src/gui/graphics/fonts/juce_Typeface.cpp index 24afbb3f43..3f5a61a065 100644 --- a/src/gui/graphics/fonts/juce_Typeface.cpp +++ b/src/gui/graphics/fonts/juce_Typeface.cpp @@ -337,14 +337,15 @@ float CustomTypeface::getStringWidth (const String& text) while (! t.isEmpty()) { - const GlyphInfo* const glyph = findGlyphSubstituting (t.getAndAdvance()); + const juce_wchar c = t.getAndAdvance(); + const GlyphInfo* const glyph = findGlyphSubstituting (c); if (glyph == 0 && ! isFallbackFont) { const Typeface::Ptr fallbackTypeface (Typeface::getFallbackTypeface()); if (fallbackTypeface != 0) - x += fallbackTypeface->getStringWidth (String::charToString (*t)); + x += fallbackTypeface->getStringWidth (String::charToString (c)); } if (glyph != 0)