Stumped with font extension for PDF export

0

Have been able to create a font extension jar file, but no matter what I do I cannot get the PDF export to use the fonts.

More specifically, when I add the font manually into Window|Preferences within JSS everything works.  If I then export as library, remove the font from the Window|Preferences, and then add the jar to the build path I am able to see the correct font in the properties font selection and in the generated java report -- but will get an error during PDF export that the font cant be found.

I've then hand edited my jar to match exactly the tags and patterns that are in the stock 6.10 DejaVu font extension jar and get the same results.

tests with the included example jrxml

    - if only the SansSerif and DejaVu items are used (items using the font extension suppressed) the PDF works find

    - if any items using the font extensions are included/enabled the PDF export will error out

I've also tried manually using <tff> and <pdf> sub-tags within the jar's xml file without any more success.

I'm 100% sure that the extension jar is being used/included as the PDF generation provides the path I specified in the jar's xml (the relative path within the jar) of the font file in the error message.

FYI: devel/Jss on Windows 10, deploy/jasperLib on Ubuntu 16

jasperreports_extension.properties:

net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.registry.factory.simple.font.families=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.adlFonts=fonts/adlFonts.xml


fonts/adlFonts.xml:

<?xml version="1.0" encoding="UTF-8"?>

<fontFamilies>

    <fontFamily name="IBM_Plex_Sans">
        <normal>fonts/IBM_Plex_Sans/IBMPlexSans-Regular.ttf</normal>
        <bold>fonts/IBM_Plex_Sans/IBMPlexSans-SemiBold.ttf</bold>
        <italic>fonts/IBM_Plex_Sans/IBMPlexSans-Italic.ttf</italic>
        <boldItalic>fonts/IBM_Plex_Sans/IBMPlexSans-SemiBoldItalic.ttf</boldItalic>
        <pdfEncoding>Identity-H</pdfEncoding>
        <pdfEmbedded>true</pdfEmbedded>
        <exportFonts>
            <export key="net.sf.jasperreports.html">'IBM_Plex_Sans', Arial, Helvetica, sans-serif</export>
        </exportFonts>
    </fontFamily>

    <fontFamily name="IBM_Plex_Sans_Condensed">
        <normal>fonts/IBM_Plex_Sans_Condensed/IBMPlexSansCondensed-Regular.ttf</normal>
        <bold>fonts/IBM_Plex_Sans_Condensed/IBMPlexSansCondensed-SemiBold.ttf</bold>
        <italic>fonts/IBM_Plex_Sans_Condensed/IBMPlexSansCondensed-Italic.ttf</italic>
        <boldItalic>fonts/IBM_Plex_Sans_Condensed/IBMPlexSansCondensed-SemiBoldItalic.ttf</boldItalic>
        <pdfEncoding>Identity-H</pdfEncoding>
        <pdfEmbedded>true</pdfEmbedded>
        <exportFonts>
            <export key="net.sf.jasperreports.html">'IBM_Plex_Sans_Condensed', Arial, Helvetica, sans-serif</export>
        </exportFonts>
    </fontFamily>

    <fontFamily name="Open_Sans">
        <normal>fonts/Open_Sans/OpenSans-Regular.ttf</normal>
        <bold>fonts/Open_Sans/OpenSans-SemiBold.ttf</bold>
        <italic>fonts/Open_Sans/OpenSans-Italic.ttf</italic>
        <boldItalic>fonts/Open_Sans/OpenSans-SemiBoldItalic.ttf</boldItalic>
        <pdfEncoding>Identity-H</pdfEncoding>
        <pdfEmbedded>true</pdfEmbedded>
        <exportFonts>
            <export key="net.sf.jasperreports.html">'Open_Sans', Arial, Helvetica, sans-serif</export>
        </exportFonts>
    </fontFamily>

    <fontFamily name="Open_Sans_Condensed">
        <normal>fonts/Open_Sans_Condensed/OpenSansCondensed-Light.ttf</normal>
        <bold>fonts/Open_Sans_Condensed/OpenSansCondensed-Bold.ttf</bold>
        <italic>fonts/Open_Sans_Condensed/OpenSansCondensed-LightItalic.ttf</italic>
        <pdfEncoding>Identity-H</pdfEncoding>
        <pdfEmbedded>true</pdfEmbedded>
        <exportFonts>
            <export key="net.sf.jasperreports.html">'Open_Sans_Condensed', Arial, Helvetica, sans-serif</export>
        </exportFonts>
    </fontFamily>

    <!--
        Mapping Java logical fonts, for the sake of HTML export only.
    -->
    
    <fontFamily name="SansSerif">
        <exportFonts>
            <export key="net.sf.jasperreports.html">'DejaVu Sans', Arial, Helvetica, sans-serif</export>
        </exportFonts>
    </fontFamily>
    <fontFamily name="Serif">
        <exportFonts>
            <export key="net.sf.jasperreports.html">'DejaVu Serif', 'Times New Roman', Times, serif</export>
        </exportFonts>
    </fontFamily>
    <fontFamily name="Monospaced">
        <exportFonts>
            <export key="net.sf.jasperreports.html">'DejaVu Sans Mono', 'Courier New', Courier, monospace</export>
        </exportFonts>
    </fontFamily>

</fontFamilies>

Attachments: 
tim.mothery's picture
Joined: Jun 3 2017 - 10:19pm
Last seen: 4 days 23 hours ago

0 Answers:

No answers yet
Feedback
randomness