Font not compatible with the new TextLayout?


#1

Hello Jules,

I have recently made the transition to Juce 2 and I’m having repeated crashes in the CoreText functions that are called by TextLayout::createLayout(). All worked well using Juce version 1.x.

This happens when I use a font called “Euterpe” for some very simple tooltips showing musical symbols. No problem with tooltips using the default font.

If I force the TextLayout::createLayout() function to use createStandardLayout() instead of createNativeLayout() all works properly (I guess this is equivalent to Juce 1.x).

Do you have any suggestions?


#2

There’s really not much point in saying something has crashed without posting a stack trace…


#3

Actually it is not a real crash, I apologize for the incorrect use of the expression. The execution remains locked in a kind of infinite loop in CoreText.
This is a partial stack trace showing the point around which blocking takes place.
I guess it’s due to a peculiarity of the font “Euterpe”.

juce::TooltipWindow::timerCallback()
 juce::TooltipWindow::showFor(juce::String const&)
  MdLookAndFeel::getTooltipSize(juce::String const&, int&, int&)
   layoutTooltipText(juce::String const&)
    juce::TextLayout::createLayout(juce::AttributedString const&, float)
     juce::TextLayout::createNativeLayout(juce::AttributedString const&)
      juce::CoreTextTypeLayout::createLayout(juce::TextLayout&, juce::AttributedString const&)
       CTFramesetterCreateWithAttributedString
        TFramesetterAttrString::TFramesetterAttrString(__CFAttributedString const*)
         TTypesetterAttrString::Initialize(__CFAttributedString const*)
          TGlyphEncoder::EncodeChars(CFRange, TAttributes const&, TGlyphList<TDeletedGlyphIndex>&, TGlyphEncoder::Fallbacks)
           TGlyphEncoder::RunUnicodeEncoder(CTRun*, adopted_t const&, __CTFont const*, CFRange, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const*)
            TGlyphEncoder::RunUnicodeEncoderRecursively(CTRun*, adopted_t const&, __CTFont const*, CFRange, TGlyphList<TDeletedGlyphIndex>&, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const*, TGlyphEncoder::ClusterMatching, bool)
             TGlyphEncoder::AppendUnmappedCharRun(CTRun*, __CTFont const*, CFRange, CFRange, TGlyphList<TDeletedGlyphIndex>&, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const&, TGlyphEncoder::ClusterMatching)
              TGlyphEncoder::RunUnicodeEncoderRecursively(CTRun*, adopted_t const&, __CTFont const*, CFRange, TGlyphList<TDeletedGlyphIndex>&, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const*, TGlyphEncoder::ClusterMatching, bool)
               TRun::GetNextUnmappedCharRange(long) const
                TStorageRange::GetNextUnmappedGlyphRange(long) const