Browse Source

Custom typeface fix.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
819e8c441a
2 changed files with 6 additions and 4 deletions
  1. +3
    -2
      juce_amalgamated.cpp
  2. +3
    -2
      src/gui/graphics/fonts/juce_Typeface.cpp

+ 3
- 2
juce_amalgamated.cpp View File

@@ -92031,14 +92031,15 @@ float CustomTypeface::getStringWidth (const String& text)


while (! t.isEmpty()) 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) if (glyph == 0 && ! isFallbackFont)
{ {
const Typeface::Ptr fallbackTypeface (Typeface::getFallbackTypeface()); const Typeface::Ptr fallbackTypeface (Typeface::getFallbackTypeface());


if (fallbackTypeface != 0) if (fallbackTypeface != 0)
x += fallbackTypeface->getStringWidth (String::charToString (*t));
x += fallbackTypeface->getStringWidth (String::charToString (c));
} }


if (glyph != 0) if (glyph != 0)


+ 3
- 2
src/gui/graphics/fonts/juce_Typeface.cpp View File

@@ -337,14 +337,15 @@ float CustomTypeface::getStringWidth (const String& text)
while (! t.isEmpty()) 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) if (glyph == 0 && ! isFallbackFont)
{ {
const Typeface::Ptr fallbackTypeface (Typeface::getFallbackTypeface()); const Typeface::Ptr fallbackTypeface (Typeface::getFallbackTypeface());
if (fallbackTypeface != 0) if (fallbackTypeface != 0)
x += fallbackTypeface->getStringWidth (String::charToString (*t));
x += fallbackTypeface->getStringWidth (String::charToString (c));
} }
if (glyph != 0) if (glyph != 0)


Loading…
Cancel
Save