Honza Hejzl
2017-03-01 11:56:02 UTC
Hi all,
I have done several tests but I am still struggling with basic
configuration of FOP.
As Adam mentioned here
<http://apache-fop.1065347.n5.nabble.com/font-base-is-ignored-in-2-1-td43690.html>
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
I have done several tests but I am still struggling with basic
configuration of FOP.
As Adam mentioned here
<http://apache-fop.1065347.n5.nabble.com/font-base-is-ignored-in-2-1-td43690.html>
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