Special Charaters/Symbols

0

Hi, i've a problem with a template where i put a special symbols. The special symbol has a unicode \u2baf (https://www.htmlsymbols.xyz/unicode/U+2BAF). If i compile the report from jasper report there isn't problems, but when i compile and generate the pdf from java, i don't view the symbol.

I've try with below solution but it found only with ArabicText. 

 

<parameter name="SymbolText" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["\u2baf"]]></defaultValueExpression>
    </parameter>
    <parameter name="ArabicText" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["\u0627\u0646\u0646\u0649 \u0644\u0627 "+
         "\u0627\u0641\u0647\u0645 \u0627\u0644\u0644\u063A\u0629 "+
         "\u0627\u0644\u0639\u0631\u0628\u064A\u0629"]]></defaultValueExpression>
    </parameter>
    <title>
        <band height="782">
            <textField>
                <reportElement x="100" y="50" width="150" height="100" uuid="902c6744-d711-43e6-a605-da7c621bb222"/>
                <textElement>
                    <font fontName="Segoe UI Symbol" size="24"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{SymbolText}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="100" y="150" width="100" height="60" uuid="c73b34f7-f6e3-4ca7-9cf9-74f6facb5bde"/>
                <textElement>
                    <font fontName="DejaVu Sans" size="14"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{SymbolText}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="100" y="230" width="100" height="60" uuid="c73b34f7-f6e3-4ca7-9cf9-74f6facb5bde"/>
                <textElement>
                    <font fontName="DejaVu Sans" size="14"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{ArabicText}]]></textFieldExpression>
            </textField>
        </band>
    </title>

Please, help me to understand where i wrong.

Thank you

 

daniele.cherchi's picture
Joined: Jul 17 2019 - 7:31am
Last seen: 4 months 17 hours ago

1 Answer:

0

Try to set the PDF-Encoding to "IDENTITY-H" and be sure that you also have a FontExtension for your "Segoe UI Symbol" font with that encoding.

The "DejaVu Sans" FontExtension should already be in classpath for your application, if not then check that also.

hth + regards

C-Box

 

C-Box's picture
2157
Joined: Jul 19 2006 - 5:58pm
Last seen: 12 hours 42 min ago
Feedback