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 Gregory Buchenberger <gr...@eightfoldconsulting.com> on 2009/12/22 20:10:35 UTC

Font substitution

Hello,

I am attempting to substitute Ghost Script fonts for the Base 14
fonts. My configuration file has the following section:

<substitutions>
    <substitution>
        <from font-family="Times"/>
        <to font-family="Nimbus Roman No9 L"/>
    </substitution>
    <substitution>
        <from font-family="Times" font-style="italic"/>
        <to font-family="Nimbus Roman No9 L" font-style="italic"/>
    </substitution>
    <substitution>
        <from font-family="Helvetica"/>
        <to font-family="Nimbus Sans L"/>
    </substitution>
    <substitution>
        <from font-family="Courier"/>
        <to font-family="Nimbus Mono L"/>
    </substitution>
    <substitution>
        <from font-family="Symbol"/>
        <to font-family="Standard Symbols L"/>
    </substitution>
    <substitution>
        <from font-family="ZapfDingbats"/>
        <to font-family="Dingbats"/>
    </substitution>
</substitutions>

The gsfonts are registering OK. Where I've used an explicit font it
gets embedded. Yet when FOP has to make a choice it still uses
Helvetica and doesn't embed the Nimbus font in it's place. What am I
missing in the configuration? Also, when I run FOP it always reports:

WARNING: Font "Symbol,normal,700" not found. Substituting with
"Symbol,normal,400".
Dec 22, 2009 12:00:29 PM org.apache.fop.events.LoggingEventListener processEvent
WARNING: Font "ZapfDingbats,normal,700" not found. Substituting with
"ZapfDingbats,normal,400".

What are those fonts generally used for? Where might FOP need them?
Thanks ahead and Merry Christmas to you all.

Best Regards,

Gregory Buchenberger
Eightfold Consulting
www.eightfoldconsulting.com

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


Re: Font substitution

Posted by Gregory Buchenberger <gr...@eightfoldconsulting.com>.
Hi,

In regards to Chris's comment:

" Are you sure you have specified the font family for the entire document?
If you forget to specify the font-family then it defaults to
"sans-serif,Symbol,ZapfDingbats" By default sans-serif maps to
Helvetica, so that may be how it ends being used in your case."

You are correct. I was missing an explicit font-style attribute in my
headers and footers. The style was bold, so it was choosing Helvetica
and giving me an error about Symbol and ZapfDingbats due to the
font-style="bold" attribute. As you pointed out in the bug which
states:

"When the font-family property hasn't been specified in the FO file, it defaults
to "sans-serif,Symbol,ZapfDingbats". But the latter two aren't available in a
bold variant. When a block of text can be rendered using the sans-serif family
only, warnings are still issued about unavailable Symbol bold and ZapfDingbats
bold. This is likely to puzzle users.

Strangely enough, no warning is issued when font-weight is set to normal and
font-style to italic, although Symbol and ZapfDingbats aren't available in
italic version either."

Calling the fonts explicitly works. But I still am not able to make a
font substitution. If I explicitly or implicitly choose font-family
"Helvetica", I don't get "Nimbus Sans L" as I've set in the
configuration. Am I misunderstanding font substitution? You help is
greatly appreciated.


Kind Regards,

Gregory Buchenberger
www.eightfoldconsulting.com



On Wed, Dec 23, 2009 at 2:38 AM, Pascal Sancho <pa...@takoma.fr> wrote:
> Hi,
>
> Both Symbol and ZapfDingbats are available only in regular form: neither
> italic, nor bold.
> Fallback to "normal, 400" is an expected behaviour.
>
> If you don't want to see such Warning in log, I see 3 tips:
>
> 1/ Explicitely set both font-style and font-weight properties to "normal"
> when such fonts are used.
>
> 2/ add bold, italic and bold+italic triplets in your config file, using the
> same font file as regular font:
> <font kerning="yes" embed-url="my_font_file">
>  <font-triplet name="MyFont" style="normal" weight="400"/>
>  <font-triplet name="MyFont" style="italic" weight="400"/>
>  <font-triplet name="MyFont" style="normal" weight="700"/>
>  <font-triplet name="MyFont" style="italic" weight="700"/>
> </font>
>
> 3/ not tried: play with font-substitution
>
> <substitution>
>  <from font-family="theirFont" font-style="italic"/>
>  <to font-family="MyFont" font-style="normal"/>
> </substitution>
>
> <substitution>
>  <from font-family="theirFont" font-weight="bold"/>
>  <to font-family="MyFont" font-weight="normal"/>
> </substitution>
>
> <substitution>
>  <from font-family="theirFont" font-style="italic" font-weight="bold"/>
>  <to font-family="MyFont" font-style="normal" font-weight="normal"/>
> </substitution>
>
> HTH,
> Pascal
>
> Chris Bowditch a écrit :
>>
>> Gregory Buchenberger wrote:
>>
>>>
>>> Hello,
>>>
>>
>> Hi,
>> <snip/>
>>
>>>
>>> The gsfonts are registering OK. Where I've used an explicit font it
>>> gets embedded. Yet when FOP has to make a choice it still uses
>>> Helvetica and doesn't embed the Nimbus font in it's place. What am I
>>> missing in the configuration? Also, when I run FOP it always reports:
>>>
>>
>> Are you sure you have specified the font family for the entire document?
>> If you forget to specify the font-family then it defaults to
>> "sans-serif,Symbol,ZapfDingbats" By default sans-serif maps to
>> Helvetica, so that may be how it ends being used in your case.
>>
>>>
>>> WARNING: Font "Symbol,normal,700" not found. Substituting with
>>> "Symbol,normal,400".
>>> Dec 22, 2009 12:00:29 PM org.apache.fop.events.LoggingEventListener
>>> processEvent
>>> WARNING: Font "ZapfDingbats,normal,700" not found. Substituting with
>>> "ZapfDingbats,normal,400".
>>>
>>
>> These warnings are actually a known bug, see:
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=47279. However, this
>> does suggest there are some parts of your XSL-FO for which no font has
>> been specified.
>>
>>>
>>> What are those fonts generally used for? Where might FOP need them?
>>> Thanks ahead and Merry Christmas to you all.
>>>
>>
>> Thanks,
>> Chris
>>
>>>
>>> Best Regards,
>>> Gregory Buchenberger
>
>
> ---------------------------------------------------------------------
> 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: Font substitution

Posted by Pascal Sancho <pa...@takoma.fr>.
Hi,

Both Symbol and ZapfDingbats are available only in regular form: neither 
italic, nor bold.
Fallback to "normal, 400" is an expected behaviour.

If you don't want to see such Warning in log, I see 3 tips:

1/ Explicitely set both font-style and font-weight properties to 
"normal" when such fonts are used.

2/ add bold, italic and bold+italic triplets in your config file, using 
the same font file as regular font:
<font kerning="yes" embed-url="my_font_file">
  <font-triplet name="MyFont" style="normal" weight="400"/>
  <font-triplet name="MyFont" style="italic" weight="400"/>
  <font-triplet name="MyFont" style="normal" weight="700"/>
  <font-triplet name="MyFont" style="italic" weight="700"/>
</font>

3/ not tried: play with font-substitution

<substitution>
  <from font-family="theirFont" font-style="italic"/>
  <to font-family="MyFont" font-style="normal"/>
</substitution>

<substitution>
  <from font-family="theirFont" font-weight="bold"/>
  <to font-family="MyFont" font-weight="normal"/>
</substitution>

<substitution>
  <from font-family="theirFont" font-style="italic" font-weight="bold"/>
  <to font-family="MyFont" font-style="normal" font-weight="normal"/>
</substitution>

HTH,
Pascal

Chris Bowditch a écrit :
> Gregory Buchenberger wrote:
>   
>> Hello,
>>     
>
> Hi,
> <snip/>
>   
>> The gsfonts are registering OK. Where I've used an explicit font it
>> gets embedded. Yet when FOP has to make a choice it still uses
>> Helvetica and doesn't embed the Nimbus font in it's place. What am I
>> missing in the configuration? Also, when I run FOP it always reports:
>>     
>
> Are you sure you have specified the font family for the entire document?
> If you forget to specify the font-family then it defaults to
> "sans-serif,Symbol,ZapfDingbats" By default sans-serif maps to
> Helvetica, so that may be how it ends being used in your case.
>   
>> WARNING: Font "Symbol,normal,700" not found. Substituting with
>> "Symbol,normal,400".
>> Dec 22, 2009 12:00:29 PM org.apache.fop.events.LoggingEventListener processEvent
>> WARNING: Font "ZapfDingbats,normal,700" not found. Substituting with
>> "ZapfDingbats,normal,400".
>>     
>
> These warnings are actually a known bug, see:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=47279. However, this
> does suggest there are some parts of your XSL-FO for which no font has
> been specified.
>   
>> What are those fonts generally used for? Where might FOP need them?
>> Thanks ahead and Merry Christmas to you all.
>>     
> Thanks,
> Chris
>   
>> Best Regards,
>> Gregory Buchenberger


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


Re: Font substitution

Posted by Chris Bowditch <bo...@hotmail.com>.
Gregory Buchenberger wrote:
> Hello,

Hi,

<snip/>

> The gsfonts are registering OK. Where I've used an explicit font it
> gets embedded. Yet when FOP has to make a choice it still uses
> Helvetica and doesn't embed the Nimbus font in it's place. What am I
> missing in the configuration? Also, when I run FOP it always reports:

Are you sure you have specified the font family for the entire document? 
If you forget to specify the font-family then it defaults to 
"sans-serif,Symbol,ZapfDingbats" By default sans-serif maps to 
Helvetica, so that may be how it ends being used in your case.

> 
> WARNING: Font "Symbol,normal,700" not found. Substituting with
> "Symbol,normal,400".
> Dec 22, 2009 12:00:29 PM org.apache.fop.events.LoggingEventListener processEvent
> WARNING: Font "ZapfDingbats,normal,700" not found. Substituting with
> "ZapfDingbats,normal,400".

These warnings are actually a known bug, see: 
https://issues.apache.org/bugzilla/show_bug.cgi?id=47279. However, this 
does suggest there are some parts of your XSL-FO for which no font has 
been specified.

> 
> What are those fonts generally used for? Where might FOP need them?
> Thanks ahead and Merry Christmas to you all.

Thanks,

Chris

> 
> Best Regards,
> 
> Gregory Buchenberger
> Eightfold Consulting
> www.eightfoldconsulting.com
> 
> ---------------------------------------------------------------------
> 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