You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Andreas L. Delmelle" <an...@telenet.be> on 2011/07/01 00:12:42 UTC
Re: fop not handling svn rotated text on linux
On 30 Jun 2011, at 23:47, Rob Sargent wrote:
> The news about the mac is reassuring, thanks.
>
> So far I've swapped out the alias for Numbus Sans L for FreeSans in
> /etc/fonts/conf.avail/30-metric-aliases.conf: fonts-config; fc-cache;
> placed the following in my fop config xml
> <font kerning="yes" embed-url="FreeSans.ttf">
> <font-triplet name="Helvetica" style="normal"
> weight="normal"/>
> </font>
Wait a second...
Did you also configure FOP to locate the "FreeSans.ttf" file?
See: http://xmlgraphics.apache.org/fop/1.0/fonts.html#basics, and beyond
If FOP is not specifically told to look elsewhere, and it would not find that TTF in the working directory, then as a result, it would still fall back to the default sans-serif and use the inappropriate metrics.
Regards,
Andreas
---
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by Rob Sargent <rs...@xmission.com>.
I've now copied all the FreeSans files into the distribution (an eclipse
plugin based setup) and expressly call for FreeSans in the svg file.
The result is much the same as from relying on auto-detect: Just a
different spacing problem from that which we get when we call for
Helvetica: The J and o are too widely spaced; the i and the n are touching.
Just a reminder: the svg files look fine (and indistinguishable) with
either "FreeSans" or "Helvetica". It's just the pdf that is problematic.
On 06/30/2011 04:12 PM, Andreas L. Delmelle wrote:
> On 30 Jun 2011, at 23:47, Rob Sargent wrote:
>
>> The news about the mac is reassuring, thanks.
>>
>> So far I've swapped out the alias for Numbus Sans L for FreeSans in
>> /etc/fonts/conf.avail/30-metric-aliases.conf: fonts-config; fc-cache;
>> placed the following in my fop config xml
>> <font kerning="yes" embed-url="FreeSans.ttf">
>> <font-triplet name="Helvetica" style="normal"
>> weight="normal"/>
>> </font>
> Wait a second...
> Did you also configure FOP to locate the "FreeSans.ttf" file?
> See: http://xmlgraphics.apache.org/fop/1.0/fonts.html#basics, and beyond
>
> If FOP is not specifically told to look elsewhere, and it would not find that TTF in the working directory, then as a result, it would still fall back to the default sans-serif and use the inappropriate metrics.
>
>
> Regards,
>
> Andreas
> ---
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by "Andreas L. Delmelle" <an...@telenet.be>.
On 07 Jul 2011, at 21:07, Rob Sargent wrote:
Hi Rob
> I can't seem to get my logger setup properly. I have these in my
> original log4j.properties file
>
> log4j.logger.org.apache.fop=ERROR
> log4j.logger.org.apache.xmlgraphics=ERROR
>
> I've changed them both to DEBUG, but only the xmlgraphics gets any noisier?
(Slightly off-topic for fop-users@, but anyway, if it's still relevant...)
The most likely explanation would be a class-loading context difference. Is it conceivable in your setup that the FOP classes are loaded in another context than XGC?
If so, then FOP may be using a different log config, simply because it finds another log4j.properties somewhere on the classpath (i.e. the context ClassLoader does not see the same resource that is used for configuring the XGC logger).
HTH!
Regards
Andreas
---
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by Rob Sargent <rs...@xmission.com>.
We're beating each other up. I've moved forward to 1.0 for this problem.
I can't seem to get my logger setup properly. I have these in my
original log4j.properties file
log4j.logger.org.apache.fop=ERROR
log4j.logger.org.apache.xmlgraphics=ERROR
I've changed them both to DEBUG, but only the xmlgraphics gets any noisier?
On 07/07/2011 12:55 PM, Andreas L. Delmelle wrote:
> On 07 Jul 2011, at 20:01, Rob Sargent wrote:
>
> Hi Rob
>
>> First off, thanks for your persistence in this matter.
> No problem.
>
>> I do not see the 'DEBUB - FontInfo ... replacing ...' line (nor the
>> others you mention) but this is likely a symptom of the setting of my
>> log level. Let me try to address that first.
> Or... Oh boy, how could I miss that?! I had to go back a step and look at the very first words of the initial post. You said you were using 0.95, and font-substitution was not yet implemented then.
>
> Apologies for the confusion if that is the reason it is missing from the log.
>
> In that case, the only resort may indeed be to register explicit triplets per renderer, mapping the Helvetica family to the appropriate TTF files. Should be possible with 0.95, I believe, since it is actually required for PDF/A which was already in that release.
>
> The key then remains to find out _exactly_ which font is selected on your system to substitute Helvetica. As I hinted, it should be one with a narrower 'J', which explains the visual effect.
>
>
> Regards
>
> Andreas
> ---
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by "Andreas L. Delmelle" <an...@telenet.be>.
On 07 Jul 2011, at 20:01, Rob Sargent wrote:
Hi Rob
> First off, thanks for your persistence in this matter.
No problem.
> I do not see the 'DEBUB - FontInfo ... replacing ...' line (nor the
> others you mention) but this is likely a symptom of the setting of my
> log level. Let me try to address that first.
Or... Oh boy, how could I miss that?! I had to go back a step and look at the very first words of the initial post. You said you were using 0.95, and font-substitution was not yet implemented then.
Apologies for the confusion if that is the reason it is missing from the log.
In that case, the only resort may indeed be to register explicit triplets per renderer, mapping the Helvetica family to the appropriate TTF files. Should be possible with 0.95, I believe, since it is actually required for PDF/A which was already in that release.
The key then remains to find out _exactly_ which font is selected on your system to substitute Helvetica. As I hinted, it should be one with a narrower 'J', which explains the visual effect.
Regards
Andreas
---
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by Rob Sargent <rs...@xmission.com>.
Andreas,
First off, thanks for your persistence in this matter.
I do not see the 'DEBUB - FontInfo ... replacing ...' line (nor the
others you mention) but this is likely a symptom of the setting of my
log level. Let me try to address that first.
I'm perhaps erroneously confident in my fop set since I am getting other
locally defined fonts in other parts of our system.
rjs
On 07/07/2011 11:45 AM, Andreas L. Delmelle wrote:
> On 07 Jul 2011, at 19:07, Rob Sargent wrote:
>
> Hi Rob
>
>> My mistake. A rash assumption that the example was simply glossing over the renderer specific stuff. (Seemed reasonable to me that one might want different fonts in different renderers)
>>
>> I now have the following (partial) config. file and am still not getting a clean "Joint".
> <snip />
>
> OK, that looks good.
>
>> and I have confirmed that the font files are in my distribution.
>>
>> The only message I get from the FOP run is:
>> [Fop100Stage] [Print Preview Thread] [2011-07-07 10:58:27,161] DEBUG - Looking for hyph jar: <longpath>/fop/fop100/fop/lib/fop-hyph.jar!/hyph/
>>
>> [FOP] [Print Preview Thread] [2011-07-07 10:58:27,161] DEBUG - target-resolution set to: 72.0dpi (px2mm=0.35277778)
>>
>> where the first message confirms for me that I'm getting the correct fop version.
> Provided that this is the config file that is used, you should then see, a bit further down, something like
>
> ...
> DEBUG - FontInfo - Helvetica,normal,400: Replacing Helvetica (priority=0) by FreeSans (priority=0)
> ...
>
> Do you see a reference like that? If yes, do you also see the "FreeSans" font being registered a bit higher up? If not, that could mean either of:
> - a different config is actually used at runtime
> - the FreeSans font failed to load properly
> - the FreeSans font is still not the one that Java AWT falls back on for Helvetica, so the metrics still don't match
>
> As for the latter, the key is that via the config you _can_ make FOP follow suit, but you really need to make sure that it _is_ the FreeSans font that is used by Batik.
> Does that font have a narrower 'J' glyph than standard Helvetica? It doesn't seem so, from what I can tell...
>
>
> Regards
>
> Andreas
> ---
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by "Andreas L. Delmelle" <an...@telenet.be>.
On 07 Jul 2011, at 19:07, Rob Sargent wrote:
Hi Rob
> My mistake. A rash assumption that the example was simply glossing over the renderer specific stuff. (Seemed reasonable to me that one might want different fonts in different renderers)
>
> I now have the following (partial) config. file and am still not getting a clean "Joint".
<snip />
OK, that looks good.
> and I have confirmed that the font files are in my distribution.
>
> The only message I get from the FOP run is:
> [Fop100Stage] [Print Preview Thread] [2011-07-07 10:58:27,161] DEBUG - Looking for hyph jar: <longpath>/fop/fop100/fop/lib/fop-hyph.jar!/hyph/
>
> [FOP] [Print Preview Thread] [2011-07-07 10:58:27,161] DEBUG - target-resolution set to: 72.0dpi (px2mm=0.35277778)
>
> where the first message confirms for me that I'm getting the correct fop version.
Provided that this is the config file that is used, you should then see, a bit further down, something like
...
DEBUG - FontInfo - Helvetica,normal,400: Replacing Helvetica (priority=0) by FreeSans (priority=0)
...
Do you see a reference like that? If yes, do you also see the "FreeSans" font being registered a bit higher up? If not, that could mean either of:
- a different config is actually used at runtime
- the FreeSans font failed to load properly
- the FreeSans font is still not the one that Java AWT falls back on for Helvetica, so the metrics still don't match
As for the latter, the key is that via the config you _can_ make FOP follow suit, but you really need to make sure that it _is_ the FreeSans font that is used by Batik.
Does that font have a narrower 'J' glyph than standard Helvetica? It doesn't seem so, from what I can tell...
Regards
Andreas
---
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by Rob Sargent <rs...@xmission.com>.
My mistake. A rash assumption that the example was simply glossing over
the renderer specific stuff. (Seemed reasonable to me that one might
want different fonts in different renderers)
I now have the following (partial) config. file and am still not getting
a clean "Joint".
<fop version="1.0">
<!-- Base URL for resolving relative URLs -->
<base>.</base>
<font-base>.</font-base>
<fonts>
<substitutions>
<substitution>
<from font-family="Helvetica" font-weight="normal"
font-style="normal"/>
<to font-family="FreeSans" font-weight="normal"
font-style="normal"/>
</substitution>
<substitution>
<from font-family="Helvetica" font-weight="bold"
font-style="normal"/>
<to font-family="FreeSans" font-weight="bold"
font-style="normal"/>
</substitution>
</substitutions>
</fonts>
<!-- Default page-height and page-width, in case value is specified
as auto -->
<default-page-settings height="11in" width="8.26in"/>
<!-- Information for specific renderers -->
<!-- Uses renderer mime type for renderers -->
<renderers>
<renderer mime="application/pdf">
<filterList>
<!-- provides compression using zlib flate (default is
on) -->
<value>flate</value>
</filterList>
<fonts>
<font kerning="yes" embed-url="FreeSans.ttf">
<font-triplet name="FreeSans" style="normal"
weight="normal"/>
</font>
<font kerning="yes" embed-url="FreeSansBold.ttf">
<font-triplet name="FreeSans" style="normal"
weight="bold"/>
</font>
and I have confirmed that the font files are in my distribution.
The only message I get from the FOP run is:
[Fop100Stage] [Print Preview Thread] [2011-07-07 10:58:27,161] DEBUG
- Looking for hyph jar:
<longpath>/fop/fop100/fop/lib/fop-hyph.jar!/hyph/
[FOP] [Print Preview Thread] [2011-07-07 10:58:27,161] DEBUG -
target-resolution set to: 72.0dpi (px2mm=0.35277778)
where the first message confirms for me that I'm getting the correct fop
version.
Sorry to be so obtuse on this but I just can't seem to make this behave
nicely.
On 07/07/2011 09:37 AM, Andreas L. Delmelle wrote:
> On 07 Jul 2011, at 16:36, Rob Sargent wrote:
>
> Hi Rob
>
> <snip />
>> Unfortunately I've had no luck with a substitution block in my fop
>> config file _comme ca_:
>>
>> <renderers>
>> <renderer mime="application/pdf">
>> <filterList>
>> <!-- provides compression using zlib flate (default is
>> on) -->
>> <value>flate</value>
>> </filterList>
>>
>> <fonts>
>> <substitution>
> Sorry if I did not make that clearer, but this is the wrong place. The substitutions block is applies to all renderers and should go into a fonts element that is a direct child of the root of the config file. See also the example on the page (link sent earlier).
>
>
> HTH!
>
> Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
Re: fop not handling svn rotated text on linux
Posted by "Andreas L. Delmelle" <an...@telenet.be>.
On 07 Jul 2011, at 16:36, Rob Sargent wrote:
Hi Rob
<snip />
> Unfortunately I've had no luck with a substitution block in my fop
> config file _comme ca_:
>
> <renderers>
> <renderer mime="application/pdf">
> <filterList>
> <!-- provides compression using zlib flate (default is
> on) -->
> <value>flate</value>
> </filterList>
>
> <fonts>
> <substitution>
Sorry if I did not make that clearer, but this is the wrong place. The substitutions block is applies to all renderers and should go into a fonts element that is a direct child of the root of the config file. See also the example on the page (link sent earlier).
HTH!
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by Rob Sargent <rs...@xmission.com>.
I have to drop this for a bit: We've just release new software and we
all know how much fun that is...
Unfortunately I've had no luck with a substitution block in my fop
config file _comme ca_:
<renderers>
<renderer mime="application/pdf">
<filterList>
<!-- provides compression using zlib flate (default is
on) -->
<value>flate</value>
</filterList>
<fonts>
<substitution>
<substitution>
<from font-family="Helvetica"
font-weight="normal" font-style="normal"/>
<to font-family="FreeSans" font-weight="normal"
font-style="normal"/>
</substitution>
<substitution>
<from font-family="Helvetica" font-weight="bold"
font-style="normal"/>
<to font-family="FreeSans" font-weight="bold"
font-style="normal"/>
</substitution>
</substitution>
where my svg file calls for Helvetica and I have placed the
FreeSans*.ttf and corresponding xml files (self generated locally using
org.apache.fop.fonts.apps.TTFReader) in my listed fonts and in the jar.
I'll try to pick this up again when thing settle down here,
rjs
On 07/04/2011 04:44 PM, Rob Sargent wrote:
>
>
> Andreas L. Delmelle wrote:
>> On 01 Jul 2011, at 18:20, Rob Sargent wrote:
>>
>> Hi Rob
>>
>> <snip />
>>
>>> I'm coming to the conclusion that to guarantee all platforms use the
>>> same font I must include it in the distribution of the client. As I've
>>> said, we're already including non-standard fonts (e.g. Optima), but my
>>> naive assumption that, since it's part and parcel of PDF, simply naming
>>> Helvetica was enough is clearly wrong.
>>>
>>
>> Given the fact that (a substitute for) Helvetica may not be available
>> (or just is slightly different) on the client... It is not entirely
>> true that it's "part and parcel" of PDF. The PDF Specification states
>> only that viewer applications can assume the Base14 fonts to always
>> be available, so as not to force said viewers to include them in the
>> application package.
>> Not necessarily naive, but you're just bitten by the fact that, at
>> the end of the day, there simply is no such thing as true
>> platform-independency, especially where it concerns interoperability
>> between two basically separate Java apps. Some things depend on the
>> implementation of the Java runtime and the actual configuration of
>> the OS it runs on.
>>
>> Assuming that you know which font is actually selected by the JVM/OS,
>> then you could try creating a substitution mapping in FOP's config,
>> like:
>>
>> <substitution>
>> <from font-family="Helvetica" />
>> <to font-family="..."/>
>> </substitution>
>>
>>
> This give me some hope, thanks.
>> see: http://xmlgraphics.apache.org/fop/1.0/fonts.html#substitution
>>
>> That will force FOP to use the metrics for that font, rather than the
>> default Base14 Helvetica (also for your FO, so there will be
>> consistency, if that is what you are looking for). Incidentally,
>> trying to use literal "SansSerif" in SVG triggered the same issue on
>> OS X. The reason is that, for the Apple JVM "SansSerif" is an alias
>> for "Lucida Grande".
>> I can confirm that I see change when adding a mapping such as above,
>> however, the appropriate font-file cannot be parsed by FOP currently...
>> Still, you might be able to resolve it this way on your end.
>>
>>
>>> Now can I just use the truetype
>>> arial which _is_ on my box (but does not rectify the current situation)
>>> and would presumably be what the pc users are getting. Or am I better
>>> off getting a commercial truetype Helvetica?
>>>
>>
>> That depends on what you want to do with it. Keep in mind that buying
>> the Helvetica font would only grant you personal use. It comes
>> pre-installed on most common systems, but that license does not
>> permit the user-developers to just include it in their own projects.
>> That is very likely precisely the reason why it is left out of Linux,
>> as a matter of principle.
>> What when you happen to run into a colleague that has the same issue?
>> He/she should then have to buy it as well. If the vendor gets wind of
>> you redistributing the font in your own software, or just copying it
>> to multiple clients within your organization, he may not like it, and
>> force you to pay more. There is a reason FOP can only redistribute
>> the *metrics* for the Base14 fonts, not the fonts themselves.
>> Since you're already including other fonts, in case you have not done
>> so yet, be sure to check for those as well whether or not you are
>> permitted to include them.
>>
>>
>>
>> Regards,
>>
>> Andreas
>> ---
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by Rob Sargent <rs...@xmission.com>.
Andreas L. Delmelle wrote:
> On 01 Jul 2011, at 18:20, Rob Sargent wrote:
>
> Hi Rob
>
> <snip />
>
>> I'm coming to the conclusion that to guarantee all platforms use the
>> same font I must include it in the distribution of the client. As I've
>> said, we're already including non-standard fonts (e.g. Optima), but my
>> naive assumption that, since it's part and parcel of PDF, simply naming
>> Helvetica was enough is clearly wrong.
>>
>
> Given the fact that (a substitute for) Helvetica may not be available (or just is slightly different) on the client... It is not entirely true that it's "part and parcel" of PDF. The PDF Specification states only that viewer applications can assume the Base14 fonts to always be available, so as not to force said viewers to include them in the application package.
> Not necessarily naive, but you're just bitten by the fact that, at the end of the day, there simply is no such thing as true platform-independency, especially where it concerns interoperability between two basically separate Java apps. Some things depend on the implementation of the Java runtime and the actual configuration of the OS it runs on.
>
> Assuming that you know which font is actually selected by the JVM/OS, then you could try creating a substitution mapping in FOP's config, like:
>
> <substitution>
> <from font-family="Helvetica" />
> <to font-family="..."/>
> </substitution>
>
>
This give me some hope, thanks.
> see: http://xmlgraphics.apache.org/fop/1.0/fonts.html#substitution
>
> That will force FOP to use the metrics for that font, rather than the default Base14 Helvetica (also for your FO, so there will be consistency, if that is what you are looking for).
> Incidentally, trying to use literal "SansSerif" in SVG triggered the same issue on OS X. The reason is that, for the Apple JVM "SansSerif" is an alias for "Lucida Grande".
> I can confirm that I see change when adding a mapping such as above, however, the appropriate font-file cannot be parsed by FOP currently...
> Still, you might be able to resolve it this way on your end.
>
>
>> Now can I just use the truetype
>> arial which _is_ on my box (but does not rectify the current situation)
>> and would presumably be what the pc users are getting. Or am I better
>> off getting a commercial truetype Helvetica?
>>
>
> That depends on what you want to do with it. Keep in mind that buying the Helvetica font would only grant you personal use. It comes pre-installed on most common systems, but that license does not permit the user-developers to just include it in their own projects. That is very likely precisely the reason why it is left out of Linux, as a matter of principle.
> What when you happen to run into a colleague that has the same issue? He/she should then have to buy it as well. If the vendor gets wind of you redistributing the font in your own software, or just copying it to multiple clients within your organization, he may not like it, and force you to pay more. There is a reason FOP can only redistribute the *metrics* for the Base14 fonts, not the fonts themselves.
> Since you're already including other fonts, in case you have not done so yet, be sure to check for those as well whether or not you are permitted to include them.
>
>
>
> Regards,
>
> Andreas
> ---
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by "Andreas L. Delmelle" <an...@telenet.be>.
On 01 Jul 2011, at 18:20, Rob Sargent wrote:
Hi Rob
<snip />
> I'm coming to the conclusion that to guarantee all platforms use the
> same font I must include it in the distribution of the client. As I've
> said, we're already including non-standard fonts (e.g. Optima), but my
> naive assumption that, since it's part and parcel of PDF, simply naming
> Helvetica was enough is clearly wrong.
Given the fact that (a substitute for) Helvetica may not be available (or just is slightly different) on the client... It is not entirely true that it's "part and parcel" of PDF. The PDF Specification states only that viewer applications can assume the Base14 fonts to always be available, so as not to force said viewers to include them in the application package.
Not necessarily naive, but you're just bitten by the fact that, at the end of the day, there simply is no such thing as true platform-independency, especially where it concerns interoperability between two basically separate Java apps. Some things depend on the implementation of the Java runtime and the actual configuration of the OS it runs on.
Assuming that you know which font is actually selected by the JVM/OS, then you could try creating a substitution mapping in FOP's config, like:
<substitution>
<from font-family="Helvetica" />
<to font-family="..."/>
</substitution>
see: http://xmlgraphics.apache.org/fop/1.0/fonts.html#substitution
That will force FOP to use the metrics for that font, rather than the default Base14 Helvetica (also for your FO, so there will be consistency, if that is what you are looking for).
Incidentally, trying to use literal "SansSerif" in SVG triggered the same issue on OS X. The reason is that, for the Apple JVM "SansSerif" is an alias for "Lucida Grande".
I can confirm that I see change when adding a mapping such as above, however, the appropriate font-file cannot be parsed by FOP currently...
Still, you might be able to resolve it this way on your end.
> Now can I just use the truetype
> arial which _is_ on my box (but does not rectify the current situation)
> and would presumably be what the pc users are getting. Or am I better
> off getting a commercial truetype Helvetica?
That depends on what you want to do with it. Keep in mind that buying the Helvetica font would only grant you personal use. It comes pre-installed on most common systems, but that license does not permit the user-developers to just include it in their own projects. That is very likely precisely the reason why it is left out of Linux, as a matter of principle.
What when you happen to run into a colleague that has the same issue? He/she should then have to buy it as well. If the vendor gets wind of you redistributing the font in your own software, or just copying it to multiple clients within your organization, he may not like it, and force you to pay more. There is a reason FOP can only redistribute the *metrics* for the Base14 fonts, not the fonts themselves.
Since you're already including other fonts, in case you have not done so yet, be sure to check for those as well whether or not you are permitted to include them.
Regards,
Andreas
---
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by Rob Sargent <rs...@xmission.com>.
I need to get this reply off, but I also need to double check my setup
as I'm switching back and forth from 0.95 to 1.0 on this and the odds
that I've confused things are approaching 1 :(
I'm coming to the conclusion that to guarantee all platforms use the
same font I must include it in the distribution of the client. As I've
said, we're already including non-standard fonts (e.g. Optima), but my
naive assumption that, since it's part and parcel of PDF, simply naming
Helvetica was enough is clearly wrong. Now can I just use the truetype
arial which _is_ on my box (but does not rectify the current situation)
and would presumably be what the pc users are getting. Or am I better
off getting a commercial truetype Helvetica?
On 06/30/2011 05:16 PM, Andreas L. Delmelle wrote:
> On 01 Jul 2011, at 00:25, Rob Sargent wrote:
>
>> Even with auto-detect on?
> In that case, the answer to my question would be: "Yes, FOP is configured to look elsewhere."
>
> Still, it just occurred to me that the font definition you added, would only influence the specifications of "font" and "font-family" in the FO, or "Helvetica" specs passed by Batik to FOP. The latter is precisely what does *not* happen, and causes the issue. Batik asks Java for "Helvetica" but gets something different. This font, however, is apparently not known to FOP. At least, not by that name...
>
> So, first thing to do, is to find out exactly which font Java AWT *does* give to Batik for "Helvetica". Then we have to find out why FOP doesn't recognize it.
>
> Concerning the observation that it renders correctly if you use a 'wrong' font-family specification: that might be a worthwhile option to explore. Which exact font does Batik revert to in that case...?
> BTW: What exactly does that stack trace point to that you mentioned?
>
>
> Regards
>
> Andreas
> ---
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
Re: fop not handling svn rotated text on linux
Posted by "Andreas L. Delmelle" <an...@telenet.be>.
On 01 Jul 2011, at 00:25, Rob Sargent wrote:
> Even with auto-detect on?
In that case, the answer to my question would be: "Yes, FOP is configured to look elsewhere."
Still, it just occurred to me that the font definition you added, would only influence the specifications of "font" and "font-family" in the FO, or "Helvetica" specs passed by Batik to FOP. The latter is precisely what does *not* happen, and causes the issue. Batik asks Java for "Helvetica" but gets something different. This font, however, is apparently not known to FOP. At least, not by that name...
So, first thing to do, is to find out exactly which font Java AWT *does* give to Batik for "Helvetica". Then we have to find out why FOP doesn't recognize it.
Concerning the observation that it renders correctly if you use a 'wrong' font-family specification: that might be a worthwhile option to explore. Which exact font does Batik revert to in that case...?
BTW: What exactly does that stack trace point to that you mentioned?
Regards
Andreas
---
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by Rob Sargent <rs...@xmission.com>.
Even with auto-detect on?
Wait a second...
> Did you also configure FOP to locate the "FreeSans.ttf" file?
> See: http://xmlgraphics.apache.org/fop/1.0/fonts.html#basics, and beyond
>
> If FOP is not specifically told to look elsewhere, and it would not find that TTF in the working directory, then as a result, it would still fall back to the default sans-serif and use the inappropriate metrics.
>
>
> Regards,
>
> Andreas
> ---
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Posted by "Andreas L. Delmelle" <an...@telenet.be>.
On 01 Jul 2011, at 00:12, Andreas L. Delmelle wrote:
> <snip />
> Did you also configure FOP to locate the "FreeSans.ttf" file?
> See: http://xmlgraphics.apache.org/fop/1.0/fonts.html#basics, and beyond
Just noticed that it is not explicitly mentioned, but if you have a large number of fonts installed with the OS, you will probably want to avoid using auto-detection, as that can get quite costly. For a quick test, it may suffice to check whether the issue would be resolved, though...
Regards
Andreas
---
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org