[
https://issues.apache.org/jira/browse/FOP-2967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17192257#comment-17192257
]
Jiri Ondrusek commented on FOP-2967:
------------------------------------
Hi [~ssteiner], may I ask you for help?
First of all I need to say, that I don't have a lot of experiences with FOP.
(Which is the reason I'm having troubles with 'basic' functionality)
I think that I understand what I'd like to achieve (to use custom fonts). But I
have several issues with it
* I'm not able to make FOP use my custom font during pdf generation. I'm using
downloaded distribution to be sure that it should work.
I used FreeMono.ttf from my notebook.
I generated metrics.xml by running
{quote}TTFReader FreeMono.ttf FreeMono.xml
{quote}
I created configuration file:
{quote}<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
<fonts>
<font
metrics-url="FreeMono.xml"
kerning="yes"
embed-url="FreeMono.ttf">
<font-triplet name="FreeMono" style="normal" weight="normal" />
</font>
</fonts>
</renderer>
</renderers>
</fop>
{quote}
My in.xml is:
{quote}<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="only">
<fo:region-body region-name="xsl-region-body" margin="0.7in" padding="0" />
<fo:region-before region-name="xsl-region-before" extent="0.7in" />
<fo:region-after region-name="xsl-region-after" extent="0.7in" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="only">
<fo:flow flow-name="xsl-region-body">
<fo:block>Fabcdef !</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
{quote}
Then I'm generating pdf with command
{quote}fop -c mycfg.xml in.xml -pdf out.pdf
{quote}
Pdf from result is using different font.
* Is it possible to define renderers for all types? Unfortunatelly quarkus
will use all type conversions, which means that I need to configure it for all
formats or use some kind of dependency with support to only several formats. Do
you thinkthat it is possible?
> Quarkus support of FOP
> ----------------------
>
> Key: FOP-2967
> URL: https://issues.apache.org/jira/browse/FOP-2967
> Project: FOP
> Issue Type: Improvement
> Reporter: Jiri Ondrusek
> Priority: Major
>
> I tried to create camel-quarkus extension for fop (see
> [https://github.com/apache/camel-quarkus/issues/1642])
> I was not able to finish it successfully as I was facing issues with fonts:
> {quote}Error: No instances of sun.nio.ch.FileChannelImpl are allowed in the
> image heap as this class should be initialized at image runtime. Object has
> been initialized without the native-image initialization instrumentation and
> the stack trace can't be tracked.
> Trace: Object was reached by
> reading field sun.font.TrueTypeFont$TTDisposerRecord.channel of
> constant sun.font.TrueTypeFont$TTDisposerRecord@2c7b7d19 reached by
> reading field java.util.Hashtable$Entry.value of
> constant java.util.Hashtable$Entry@66aeea4 reached by
> indexing into array
> constant java.util.Hashtable$Entry[]@7be2410f reached by
> reading field java.util.Hashtable.table of
> constant java.util.Hashtable@33cc3b6c reached by
> scanning method sun.java2d.Disposer.addObjectRecord(Disposer.java:250)
> {quote}
> I spent some time with debugging of the fop and I discovered that fonts are
> inseparable part of some rendering. Which makes it impossible to "avoid".
> I'm not sure how this could be solved. But it would be nice to have support
> for quarkus.
> (I can imagine that for example only some features could be supported in
> quarkus)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)