Hi, I am having a problem when using FOP with an Arabic font (Hasubi, https://github.com/eliheuer/hasubi-mono) and the following string: لأ
Input XML: <?xml version="1.0" encoding="UTF-8"?> <string>لأ</string> Stylesheet: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:output method="xml" indent="yes" encoding="UTF-8"/> <xsl:template match="/"> <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" margin="1cm"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4"> <fo:flow flow-name="xsl-region-body"> <xsl:apply-templates select="string"/> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <xsl:template match="string"> <fo:block font-family="CustomFont" font-size="10pt"> <xsl:value-of select="."/> </fo:block> </xsl:template> </xsl:stylesheet> Custom font Hasubi is defined in my fop.xconf: <?xml version="1.0"?> <fop version="1.0"> <strict-configuration>true</strict-configuration> <strict-validation>false</strict-validation> <base>.</base> <renderers> <renderer mime="application/pdf"> <fonts> <font kerning="yes" embed-url="file:///C:/Temp/Hasubi-Mono.ttf"> <font-triplet name="CustomFont" style="normal" weight="normal"/> </font> </fonts> </renderer> </renderers> </fop> I have tested with OpenJDK 17 and FOP 2.11 on windows starting via commandline: fop-2.11\fop\fop.bat -c fop.xconf -xml input.xml -xsl stylesheet.xsl -pdf out.pdf Resulting in the following stacktrace: Aug. 21, 2025 10:11:31 AM org.apache.fop.apps.FOUserAgent processEvent INFORMATION: Rendered page #1. Exception in thread "main" java.lang.StackOverflowError at java.base/java.util.HashMap.putVal(HashMap.java:627) at java.base/java.util.HashMap.put(HashMap.java:610) at java.base/java.util.HashSet.add(HashSet.java:221) at org.apache.fop.fonts.truetype.GlyfTable.retrieveComposedGlyphs(GlyfTable.java:225) at org.apache.fop.fonts.truetype.GlyfTable.scanGlyphsRecursively(GlyfTable.java:158) at org.apache.fop.fonts.truetype.GlyfTable.scanGlyphsRecursively(GlyfTable.java:160) at org.apache.fop.fonts.truetype.GlyfTable.scanGlyphsRecursively(GlyfTable.java:160) at org.apache.fop.fonts.truetype.GlyfTable.scanGlyphsRecursively(GlyfTable.java:160) at org.apache.fop.fonts.truetype.GlyfTable.scanGlyphsRecursively(GlyfTable.java:160) at org.apache.fop.fonts.truetype.GlyfTable.scanGlyphsRecursively(GlyfTable.java:160) at org.apache.fop.fonts.truetype.GlyfTable.scanGlyphsRecursively(GlyfTable.java:160) at org.apache.fop.fonts.truetype.GlyfTable.scanGlyphsRecursively(GlyfTable.java:160) (and so on) So, the question: Is this a FOP issue (stack overflow should be detected/avoided) or is the font simply broken in some way? – Testing with other fonts (e.g. Cascadia Mono or Noto Sans Arabic) works without issues. Thanks, Tim Weller