I use:
I need to handle special characters that are unicode higher than u0100. The target font I should use is Arial. Since I cannot expect Arial to be present on the target platform (like Linux), I embedded Arial.ttf in my jar. My actual configuration file is as follows:
<fop ...> <base>./</base> <font-base>./</font-base> <renderers> <renderer mime="application/pdf"> <fonts> <font kerning="yes" embed-url="arial.ttf" encoding-mode="auto"> <font-triplet name="Arial" style="normal" weight="normal"/> <font-triplet name="ArialMT" style="normal" weight="normal"/> </font> </fonts> <auto-detect/> </renderer> ... </fop>
By doing this this way, I get an error loading my configuration file in fop:
org.apache.fop.apps.FOPException: Failed to resolve font with embed-url 'arial.ttf'
The only way I managed to get it to work so far is to hardcode the path to the folder in the configuration file:
<font kerning="yes" embed-url="C:/myapp/arial.ttf" encoding-mode="auto"> <font-triplet name="Arial" style="normal" weight="normal"/> <font-triplet name="ArialMT" style="normal" weight="normal"/> </font>
But obviously this cannot be a solution!
Using the "directory" tag, which works on Windows, just because you have Arial. But, as mentioned above, it should also work on Linux, Mac, etc.
The auto-detect tag did not work (not even on Windows) - and is not a solution, since I cannot expect the target platform with Arial installed.
Any suggestions to solve this problem?
source share