Apache FOP fonts configuration

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Apache FOP fonts configuration

Welblaud
Hi all,

I have done several tests but I am still struggling with basic configuration of FOP.

As Adam mentioned here it seems FOP somehow ignores <font-base/> and even <base/> if the config is provided to FOP dynamically from XQuery.

If I use FOP 2.1 on command line, everything works, no matter if I use full path to a filesystem or some url (e.g. to a rest point of an eXist app). Hence I guess this problem lies somewhere between eXist and FOP.

It is possible to use workaround and load fronts from the filesystem directly with @embed-url:
<font kerning="yes" embed-url="file://full-path-to-fonts-in-expathrepo/libertine/font.ttf" embedding-mode="subset">

If I try to use <font-base/> with exactly the same path, it does not work:
<font-base>/home/user/eXist-db/webapp/.../</font-base>
and
<font kerning="yes" embed-url="font.ttf" embedding-mode="subset">
it throws URI scheme is not "file" error.

If I use:
<font-base>/home/user/eXist-db/webapp/.../</font-base>
and
<font kerning="yes" embed-url="file:font.ttf" embedding-mode="subset">
it throws URI is not hierarchical error (logically).

This means it is not possible to use the elegant <font-base/> for resolving font uris at all.

The next thing is <base/>, which is successfully ignored by FOP. The workaround is for me pushing the resource URL to XSL and there to resolve paths directly (not elegant, working).

And the last thing is it is not possible to use font loading with @embed-url:
<font kerning="yes" embed-url="file://full-path-to-fonts-in-expathrepo/libertine/font.ttf" embedding-mode="subset">

When I try to load the font with a dynamic config from a simple XQuery placed outside of an app collection, FOP ignores the setting and uses generic fonts. This is most confusing.

I thought the problem was eXist loaded TTF fonts as of application/xml mime-type but even after solving this it does not work.

I solved that with workarounds mentioned above but it would be great to track the issue and solve it in general.

Greetings from Prague, Honza


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Apache FOP fonts configuration

Welblaud
I am sorry I didn’t specified the eXist version, it is 3.0 stable.

Best, Honza
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Apache FOP fonts configuration

Welblaud
And thanks to Joe I am adding OS info.

Tests with eXist 3.0 stable are done on Ubuntu 12.04 LTS, tests with FOP 2.1 are done on Ubuntu 16.04 LTS. I am doing that because in 12.04 version it is not easy to upgrade to FOP 2.1. Later I want to migrate eXist there too.

Best, Honza
Loading...