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 To...@TIMETOACT.DE on 2007/07/13 10:36:50 UTC

How to set the default-font to arial

Hello,

is there any way to set the default-font, which is used as fallback when 
an unknown font was used, to arial?

I'm running FOP 0.20.5 with jvm 1.3.

The message I receive is:

[ERROR] unknown font Arial,normal,normal so defaulted font to any

Kind regards and thanks

Tobias

Re: How to set the default-font to arial

Posted by To...@TIMETOACT.DE.
Hello,

thanks for the answer! I'm generating the font-family dynamicly. The user 
chooses a font in lotus notes and that will be used in the transformation. 
But I think I will check the font before I use it in the translation like 
this:

        <xsl:if test="./font/@name">
                <xsl:variable name="fontname"><xsl:value-of select=
"./font/@name"/></xsl:variable>
                <xsl:variable name="loweredfontname" select=
"translate($fontname,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"
/>
                <xsl:if test="$loweredfontname = 'courier' or 
$loweredfontname = 'serif' or $loweredfontname = 'helvetica'">
                        <xsl:attribute name="font-family">
                                <xsl:value-of select="./font/@name"/>
                        </xsl:attribute> 
                </xsl:if>
        </xsl:if>

Then there are no problems anylonger, even if the default font is 
hardwired to helv or times. Additinaly to this codesnippet I'm going to 
set the default font in the root to "sans-serif".

Thanks a lot!

Tobias


"J.Pietschmann" <j3...@yahoo.de> wrote on 13.07.2007 23:01:55:

> Tobias.Soloschenko@TIMETOACT.DE wrote:
> > is there any way to set the default-font, which is used as fallback 
when 
> > an unknown font was used, to arial?
> 
> The default font is more or less hardwired to one of the built in
> fonts, either Helvetica, Times Roman or Courier. Furthermore:
> 
> > The message I receive is:
> > 
> > [ERROR] unknown font Arial,normal,normal so defaulted font to any
> 
> Either there is no entry in the config file defining the location
> for the files for the Arial font, or the entry has syntax errors,
> perhaps it was written for another FOP release.
> In either case, because FOP can't find the required data, there is
> no point in interpreting "any" as "Arial"...
> Just providing a correct configuration should fix the problem. Did
> you read http://xmlgraphics.apache.org/fop/0.20.5/fonts.html ?
> 
> J.Pietschmann
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 

Re: How to set the default-font to arial

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Tobias.Soloschenko@TIMETOACT.DE wrote:
> is there any way to set the default-font, which is used as fallback when 
> an unknown font was used, to arial?

The default font is more or less hardwired to one of the built in
fonts, either Helvetica, Times Roman or Courier. Furthermore:

> The message I receive is:
> 
> [ERROR] unknown font Arial,normal,normal so defaulted font to any

Either there is no entry in the config file defining the location
for the files for the Arial font, or the entry has syntax errors,
perhaps it was written for another FOP release.
In either case, because FOP can't find the required data, there is
no point in interpreting "any" as "Arial"...
Just providing a correct configuration should fix the problem. Did
you read http://xmlgraphics.apache.org/fop/0.20.5/fonts.html ?

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org