Assert deep inside createFromSVG

Hit the following assert in juce_SimpleShapedText.cpp:
// It this is hit, the typeface can’t display one or more characters.
// This normally shouldn’t happen if font fallback is enabled, unless the String contains
// control characters that JUCE doesn’t know how to handle appropriately.
jassert (unknownGlyph == infos.end());

Font used is “Bitstream Charter (Bold)”

Call stack:
libc.so.6!__GI_kill() (syscall-template.S:120)
juce::lowLevelShape(const juce::String & string, juce::Range range, const juce::Font & font, juce::TextScript script, const juce::String & language, uint8_t embeddingLevel) (/home/john/JUCE/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp:497)
juce::ConsumableGlyphs::reshape(juce::ConsumableGlyphs * const this) (/home/john/JUCE/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp:808)
juce::ConsumableGlyphs::ConsumableGlyphs(juce::ConsumableGlyphs * const this, const juce::String & stringIn, juce::Range rangeIn, juce::ShapingParams params) (/home/john/JUCE/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp:693)
operator()(const struct {…} * const __closure, const juce::BidiParagraph & bidiParagraph, juce::Range range, const juce::ShapingParams & shapingParams) (/home/john/JUCE/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp:1060)
operator()(const struct {…} * const __closure, const juce::BidiParagraph & bidiParagraph) (/home/john/JUCE/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp:1316)
juce::BidiAlgorithm::forEachParagraph<juce::SimpleShapedText::shape(const juce::String&, const juce::ShapedTextOptions&)::<lambda(const juce::BidiParagraph&)> >(struct {…} &&, std::optionaljuce::TextDirection) const(const juce::BidiAlgorithm * const this, struct {…} && callback, std::optionaljuce::TextDirection dir) (/home/john/JUCE/modules/juce_graphics/unicode/juce_UnicodeBidi.cpp:200)
juce::SimpleShapedText::shape(juce::SimpleShapedText * const this, const juce::String & data, const juce::ShapedTextOptions & options) (/home/john/JUCE/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp:1291)
juce::SimpleShapedText::SimpleShapedText(juce::SimpleShapedText * const this, const juce::String * data, const juce::ShapedTextOptions & options) (/home/john/JUCE/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp:303)
juce::ShapedText::Impl::Impl(juce::ShapedText::Impl * const this, juce::String textIn, juce::ShapedText::Options optionsIn) (/home/john/JUCE/modules/juce_graphics/fonts/juce_ShapedText.cpp:109)
std::_Construct<juce::ShapedText::Impl, juce::String, juce::ShapedTextOptions>(juce::ShapedText::Impl * __p) (/usr/include/c++/12/bits/stl_construct.h:119)
std::allocator_traits<std::allocator >::construct<juce::ShapedText::Impl, juce::String, juce::ShapedTextOptions>(juce::ShapedText::Impl * __p) (/usr/include/c++/12/bits/alloc_traits.h:635)
std::_Sp_counted_ptr_inplace<juce::ShapedText::Impl, std::allocator, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<juce::String, juce::ShapedTextOptions>(std::_Sp_counted_ptr_inplace<juce::ShapedText::Impl, std::allocator, (__gnu_cxx::_Lock_policy)2> * const this, std::allocator __a) (/usr/include/c++/12/bits/shared_ptr_base.h:604)
std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<juce::ShapedText::Impl, std::allocator, juce::String, juce::ShapedTextOptions>(std::__shared_count<(__gnu_cxx::_Lock_policy)2> * const this, juce::ShapedText::Impl *& __p, std::_Sp_alloc_shared_tag<std::allocator > __a) (/usr/include/c++/12/bits/shared_ptr_base.h:971)
std::__shared_ptr<juce::ShapedText::Impl, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator, juce::String, juce::ShapedTextOptions>(std::__shared_ptr<juce::ShapedText::Impl, (__gnu_cxx::_Lock_policy)2> * const this, std::_Sp_alloc_shared_tag<std::allocator > __tag) (/usr/include/c++/12/bits/shared_ptr_base.h:1712)
std::shared_ptrjuce::ShapedText::Impl::shared_ptr<std::allocator, juce::String, juce::ShapedTextOptions>(std::shared_ptrjuce::ShapedText::Impl * const this, std::_Sp_alloc_shared_tag<std::allocator > __tag) (/usr/include/c++/12/bits/shared_ptr.h:464)
std::make_shared<juce::ShapedText::Impl, juce::String, juce::ShapedTextOptions>() (/usr/include/c++/12/bits/shared_ptr.h:1010)
juce::ShapedText::ShapedText(juce::ShapedText * const this, juce::String text, juce::ShapedText::Options options) (/home/john/JUCE/modules/juce_graphics/fonts/juce_ShapedText.cpp:160)
juce::GlyphArrangement::addCurtailedLineOfText(juce::GlyphArrangement * const this, const juce::Font & font, const juce::String & text, float xOffset, float yOffset, float maxWidthPixels, bool useEllipsis) (/home/john/JUCE/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp:211)
juce::GlyphArrangement::addLineOfText(juce::GlyphArrangement * const this, const juce::Font & font, const juce::String & text, float xOffset, float yOffset) (/home/john/JUCE/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp:171)
juce::GlyphArrangement::getStringBounds(const juce::Font & font, juce::StringRef text) (/home/john/JUCE/modules/juce_graphics/fonts/juce_GlyphArrangement.h:322)
juce::GlyphArrangement::getStringWidth(const juce::Font & font, juce::StringRef text) (/home/john/JUCE/modules/juce_graphics/fonts/juce_GlyphArrangement.h:331)
juce::SVGState::parseText(const juce::SVGState * const this, const juce::SVGState::XmlPath & xml, bool shouldParseTransform, juce::AffineTransform * additonalTransform, juce::SVGState::StringLayoutState * parentLayoutState) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:1207)
juce::SVGState::parseText(const juce::SVGState * const this, const juce::SVGState::XmlPath & xml, bool shouldParseTransform, juce::AffineTransform * additonalTransform, juce::SVGState::StringLayoutState * parentLayoutState) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:1219)
juce::SVGState::parseSubElement(juce::SVGState * const this, const juce::SVGState::XmlPath & xml) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:503)
juce::SVGState::parseSubElements(juce::SVGState * const this, const juce::SVGState::XmlPath & xml, juce::DrawableComposite & parentDrawable, bool shouldParseClip) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:478)
juce::SVGState::parseGroupElement(juce::SVGState * const this, const juce::SVGState::XmlPath & xml, bool shouldParseTransform) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:550)
juce::SVGState::parseSubElement(juce::SVGState * const this, const juce::SVGState::XmlPath & xml) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:501)
juce::SVGState::parseSubElements(juce::SVGState * const this, const juce::SVGState::XmlPath & xml, juce::DrawableComposite & parentDrawable, bool shouldParseClip) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:478)
juce::SVGState::parseGroupElement(juce::SVGState * const this, const juce::SVGState::XmlPath & xml, bool shouldParseTransform) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:550)
juce::SVGState::parseGroupElement(juce::SVGState * const this, const juce::SVGState::XmlPath & xml, bool shouldParseTransform) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:545)
juce::SVGState::parseSubElement(juce::SVGState * const this, const juce::SVGState::XmlPath & xml) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:501)
juce::SVGState::parseSubElements(juce::SVGState * const this, const juce::SVGState::XmlPath & xml, juce::DrawableComposite & parentDrawable, bool shouldParseClip) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:478)
juce::SVGState::parseGroupElement(juce::SVGState * const this, const juce::SVGState::XmlPath & xml, bool shouldParseTransform) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:550)
juce::SVGState::parseGroupElement(juce::SVGState * const this, const juce::SVGState::XmlPath & xml, bool shouldParseTransform) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:545)
juce::SVGState::parseSubElement(juce::SVGState * const this, const juce::SVGState::XmlPath & xml) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:501)
juce::SVGState::parseSubElements(juce::SVGState * const this, const juce::SVGState::XmlPath & xml, juce::DrawableComposite & parentDrawable, bool shouldParseClip) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:478)
juce::SVGState::parseSVGElement(juce::SVGState * const this, const juce::SVGState::XmlPath & xml) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:205)
juce::Drawable::createFromSVG(const juce::XmlElement & svgDocument) (/home/john/JUCE/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:1884)

This is not urgent (as far as I am concerned) but thought it worth reporting.

(JUCE 8.0.4 on Debian)

It might be helpful to know the following:

  • Do you have fontconfig installed on your system and enabled in the JUCE project? Fontconfig is enabled by default.
  • Does the SVG include text? If so, what text? Does it include any unusual characters, emoji, etc?
  • If you comment out the assertion, rebuild, and run, do you see the expected result or does the text in the SVG render incorrectly?

fontconfig is installed and the latest version.
I tried earlier with JUCE_FONTCONFIG=0 (or whatever it’s called) to no avail.
Yes the SVG does contain text (very simple) “87654321” on an organ drawbar
If I comment out the assertion no text is displayed on my brown and black drawbars (so they are the culprits). The “white” drawbar" has text. The SVG contents are very different between these. No as far as I can see there are no unusual characters. I can look at this again tomorrow.
Thanks for your quick response BTW

Replacing the SVG stuff with the absence of text obviously fixes it for me (using a newly created SVG). It appears to be the following that causes the issue:

<tspan
             x="566.43365"
             y="231.07005"
             style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14px;line-height:125%;font-family:'Bitstream Charter';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1"
             id="tspan5239">8</tspan><tspan