Java Mailing List Archive

http://www.java2.5341.com/

Home » fop-users-digest.xmlgraphics »

fop-users Digest 21 Dec 2012 08:38:00 -0000 Issue 2625

fop-users-digest-help

2012-12-21


Author LoginPost Reply

fop-users Digest 21 Dec 2012 08:38:00 -0000 Issue 2625

Topics (messages 36121 through 36133)

Re: page-position="only" in conditional-page-master-reference
 36121 by: franck FIMBEL
 36124 by: Alexios Giotis

Simple SVG path doesn't render at all with FOP 1.0
 36122 by: Abel Braaksma
 36123 by: Sergiu Dumitriu

How to find out why fop needs a certain font?
 36125 by: Alexey Neyman
 36126 by: Luis Bernardo
 36127 by: Stefan Hinz
 36128 by: Pascal Sancho
 36129 by: Stefan Hinz
 36130 by: Alexey Neyman
 36131 by: Luis Bernardo
 36132 by: Alexey Neyman
 36133 by: Mehdi Houshmand

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: fop-users@(protected)
To unsubscribe, e-mail: fop-users-digest-unsubscribe@(protected)
For additional commands, e-mail: fop-users-digest-help@(protected)

----------------------------------------------------------------------


Attachment: fop-users_36121.eml (zipped)
Hi, 

Looking at the source code, I could trace a possible cause for this bug.
In o.a.f..layoutmgr.PageProvider, in the method getPage
a test is done to verify if the page is the last one
 boolean isLastPage = (lastPageIndex >= 0) && (index == lastPageIndex);

In the case of the fo attached (onlypage.fo) this test returns false as lastPageIndex is still initialized to -1.

Further down the processing, in o.a.f.fo.pagination.ConditionalPageMasterReference isValid method
the test (pagePosition == EN_ONLY && (isFirstPage && isLastPage)) fails


I do not have enough experience with the fop source code to provide a possible patch, but hopefully this could help someone to do it for me.

Thanks in advance

Franck




On Tue, Oct 30, 2012 at 11:34 AM, franck FIMBEL <ffimbel@gmail.com> wrote:
Thanks

I filled the bug 

Bug 54074  page-position="only" in conditional-page-master-reference does not work


On Tue, Oct 30, 2012 at 10:18 AM, Pascal Sancho <psancho.asf@gmail.com> wrote:
Hi,

This should work.
Please, file in a new bug entry, attaching the material you gave here.

2012/10/29 franck FIMBEL <ffimbel@gmail.com>:
> Hi,
>
> I am trying to use the attribute page-position="only" in a
> conditional-page-master-reference in order to produce a different page
> header if the document has only one page (if I understood correctly, it
> applies if the page is the first and the last page of the document at the
> same time).
>
> <fo:page-sequence-master master-name="Section_1">
>       <fo:repeatable-page-master-alternatives>
>         <fo:conditional-page-master-reference master-reference="Single"
> page-position="only" />
>         <fo:conditional-page-master-reference master-reference="Multiple"
> />
>       </fo:repeatable-page-master-alternatives>
>     </fo:page-sequence-master>
>
> Unfortunately, using the attached fo and fop trunk, it does not work as
> expected.
> I get the header for multiple page even if I only have one page in the final
> output document.
>
> If I change the attribute to last, it works fine.
>  <fo:page-sequence-master master-name="Section_1">
>       <fo:repeatable-page-master-alternatives>
>         <fo:conditional-page-master-reference master-reference="Single"
> page-position="last" />
>         <fo:conditional-page-master-reference master-reference="Multiple"
> />
>       </fo:repeatable-page-master-alternatives>
>     </fo:page-sequence-master>
>
>
>
> Is there something wrong with the way I use this attribute.
>
> Thanks in advance for your help


--
pascal

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




--
Franck



--
Franck

Attachment: fop-users_36124.eml (zipped)
Hi Franck,

Since there is already a ticket for this, It would be better to add it as a comment. After the migration to Jira, the link is

https://issues.apache.org/jira/browse/FOP-2148

Alexis


On 19 Dec 2012, at 19:42, franck FIMBEL <ffimbel@(protected):

> Hi,
>
> Looking at the source code, I could trace a possible cause for this bug.
> In o.a.f..layoutmgr.PageProvider, in the method getPage
> a test is done to verify if the page is the last one
> boolean isLastPage = (lastPageIndex >= 0) && (index == lastPageIndex);
>
> In the case of the fo attached (onlypage.fo) this test returns false as lastPageIndex is still initialized to -1.
>
> Further down the processing, in o.a.f.fo.pagination.ConditionalPageMasterReference isValid method
> the test (pagePosition == EN_ONLY && (isFirstPage && isLastPage)) fails
>
>
> I do not have enough experience with the fop source code to provide a possible patch, but hopefully this could help someone to do it for me.
>
> Thanks in advance
>
> Franck
>
>
>
>
> On Tue, Oct 30, 2012 at 11:34 AM, franck FIMBEL <ffimbel@(protected):
> Thanks
>
> I filled the bug
>
> Bug 54074 page-position="only" in conditional-page-master-reference does not work
>
>
> On Tue, Oct 30, 2012 at 10:18 AM, Pascal Sancho <psancho.asf@(protected):
> Hi,
>
> This should work.
> Please, file in a new bug entry, attaching the material you gave here.
>
> 2012/10/29 franck FIMBEL <ffimbel@(protected)>:
> > Hi,
> >
> > I am trying to use the attribute page-position="only" in a
> > conditional-page-master-reference in order to produce a different page
> > header if the document has only one page (if I understood correctly, it
> > applies if the page is the first and the last page of the document at the
> > same time).
> >
> > <fo:page-sequence-master master-name="Section_1">
> >     <fo:repeatable-page-master-alternatives>
> >      <fo:conditional-page-master-reference master-reference="Single"
> > page-position="only" />
> >      <fo:conditional-page-master-reference master-reference="Multiple"
> > />
> >     </fo:repeatable-page-master-alternatives>
> >   </fo:page-sequence-master>
> >
> > Unfortunately, using the attached fo and fop trunk, it does not work as
> > expected.
> > I get the header for multiple page even if I only have one page in the final
> > output document.
> >
> > If I change the attribute to last, it works fine.
> > <fo:page-sequence-master master-name="Section_1">
> >     <fo:repeatable-page-master-alternatives>
> >      <fo:conditional-page-master-reference master-reference="Single"
> > page-position="last" />
> >      <fo:conditional-page-master-reference master-reference="Multiple"
> > />
> >     </fo:repeatable-page-master-alternatives>
> >   </fo:page-sequence-master>
> >
> >
> >
> > Is there something wrong with the way I use this attribute.
> >
> > Thanks in advance for your help
>
>
> --
> pascal
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> For additional commands, e-mail: fop-users-help@(protected)
>
>
>
>
> --
> Franck
>
>
>
> --
> Franck



Attachment: fop-users_36122.eml (zipped)
Hi List,

I'm trying to get an SVG logo on a page using fo:instream-foreign-object, but all I got was total nothingness. So I trimmed down the example and after some experimenting, I got it working with svg:rect, but as soon as a svg:path turned up, it didn't get rendered.

Does anybody know of this issue? Or am I simply missing something? I'm using FOP 1.0 with Batik 1.7.From a long time ago I remember I had something similar and that I needed to setup a viewport or coordinates translation or something, but I can't find the example I had back then.

This is a rectangle drawn by svg:path, which doesn't work:

   <svg xmlns="http://www.w3.org/2000/svg"
      width="40px" height="40px">
      <path style="stroke:black; stroke-width:2; fill:red"
         d="M 20 390 L 80 390 L 80 410 L 20 410 Z" />
   </svg>

Any help is appreciated,

Thanks,
Abel Braaksma

Attachment: fop-users_36123.eml (zipped)
On 12/19/2012 12:04 PM, Abel Braaksma wrote:
> Hi List,
>
> I'm trying to get an SVG logo on a pageusing fo:instream-foreign-object,
> but all I got was total nothingness. So I trimmed down the example and
> after some experimenting, I got it working with svg:rect, but as soon as
> a svg:path turned up, it didn't get rendered.
>
> Does anybody know of this issue? Or am I simply missing something? I'm
> using FOP 1.0 with Batik 1.7.From a long time ago I remember I had
> something similar and that I needed to setup a viewport or coordinates
> translation or something, but I can't find the example I had back then.
>
> This is a rectangle drawn by svg:path, which doesn't work:
>
>   <svg xmlns="http://www.w3.org/2000/svg"
>     width="40px" height="40px">
>     <path style="stroke:black; stroke-width:2; fill:red"
>       d="M 20 390 L 80 390 L 80 410 L 20 410 Z" />
>   </svg>
>
> Any helpis appreciated,
>
> Thanks,
> Abel Braaksma

The problem is in the SVG content. Since you specify a width and a
height, but not a viewbox, the path is drawn, but outside the visible
area. If you increase the height of the SVG to 500, you'll see the image
somewhere very low.

So, make sure you're drawing inside the area that's actually displayed.


Attachment: fop-users_36125.eml (zipped)
Hi all,

I see the following warning message reported by FOP:

$ fop -c fop.cfg -dpi 150 apiguide.fo apiguide.pdf
Dec 19, 2012 2:59:02 PM org.apache.fop.events.LoggingEventListener
processEvent
WARNING: Font "Serif,normal,400" not found. Substituting with
"any,normal,400".
...

However, apiguide.fo does not contain any references to 'serif' font:

$ grep -i serif apiguide.fo
$

Why does FOP need 'Serif' font? Is there some built-in expectation that
'Serif' font must be always available?

Regards,
Alexey.


Attachment: fop-users_36126.eml (zipped)

This is of no consequence although is it puzzling at first. If you
specify a global font-family in the fo root element I think the warning
goes away. I think what you are seeing has been discussed here:
http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-found-whereas-they-are-not-needed-td31330.html

On 12/19/12 11:05 PM, Alexey Neyman wrote:
> Hi all,
>
> I see the following warning message reported by FOP:
>
> $ fop -c fop.cfg -dpi 150 apiguide.fo apiguide.pdf
> Dec 19, 2012 2:59:02 PM org.apache.fop.events.LoggingEventListener
> processEvent
> WARNING: Font "Serif,normal,400" not found. Substituting with
> "any,normal,400".
> ...
>
> However, apiguide.fo does not contain any references to 'serif' font:
>
> $ grep -i serif apiguide.fo
> $
>
> Why does FOP need 'Serif' font? Is there some built-in expectation that
> 'Serif' font must be always available?
>
> Regards,
> Alexey.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> For additional commands, e-mail: fop-users-help@(protected)
>



Attachment: fop-users_36127.eml (zipped)
Hi Bernardo,

That's good advice, thanks! How would you specify a global font family
in the FO root element, though?

Cheers,

Stefan


On 20.12.2012 01:45, Luis Bernardo wrote:
>
> This is of no consequence although is it puzzling at first. If you
> specify a global font-family in the fo root element I think the warning
> goes away. I think what you are seeing has been discussed here:
> http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-found-whereas-they-are-not-needed-td31330.html
>
>
> On 12/19/12 11:05 PM, Alexey Neyman wrote:
>> Hi all,
>>
>> I see the following warning message reported by FOP:
>>
>> $ fop -c fop.cfg -dpi 150 apiguide.fo apiguide.pdf
>> Dec 19, 2012 2:59:02 PM org.apache.fop.events.LoggingEventListener
>> processEvent
>> WARNING: Font "Serif,normal,400" not found. Substituting with
>> "any,normal,400".
>> ...
>>
>> However, apiguide.fo does not contain any references to 'serif' font:
>>
>> $ grep -i serif apiguide.fo
>> $
>>
>> Why does FOP need 'Serif' font? Is there some built-in expectation that
>> 'Serif' font must be always available?
>>
>> Regards,
>> Alexey.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
>> For additional commands, e-mail: fop-users-help@(protected)
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> For additional commands, e-mail: fop-users-help@(protected)
>


--
Cheers,

Stefan Hinz <stefan.hinz@(protected)

Phone: +49-30-82702940, Fax: +49-30-82702941, http://dev.mysql.com/doc

ORACLE Deutschland B.V.& Co. KG
Registered Office: Riesstr. 25, 80992 Muenchen, Germany
Commercial Register: Local Court Of Munich, HRA 95603
Managing Director: Jürgen Kunz

General Partner: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Register Of Chamber Of Commerce: Midden-Niederlande, No. 30143697
Managing Directors: Alexander van der Ven, Astrid Kepper, Val Maher


Attachment: fop-users_36128.eml (zipped)
Hi,

simply using the font-family attribute on the fo:root element.

Note that all inherited properties can be set on fo:root element, so
you can set your own default properties there, including font-family.

2012/12/20 Stefan Hinz <stefan.hinz@(protected)>:
> Hi Bernardo,
>
> That's good advice, thanks! How would you specify a global font family in
> the FO root element, though?
>
> Cheers,
>
> Stefan
>
>
>
> On 20.12.2012 01:45, Luis Bernardo wrote:
>>
>>
>> This is of no consequence although is it puzzling at first. If you
>> specify a global font-family in the fo root element I think the warning
>> goes away. I think what you are seeing has been discussed here:
>>
>> http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-found-whereas-they-are-not-needed-td31330.html
>>
>>
>> On 12/19/12 11:05 PM, Alexey Neyman wrote:
>>>
>>> Hi all,
>>>
>>> I see the following warning message reported by FOP:
>>>
>>> $ fop -c fop.cfg -dpi 150 apiguide.fo apiguide.pdf
>>> Dec 19, 2012 2:59:02 PM org.apache.fop.events.LoggingEventListener
>>> processEvent
>>> WARNING: Font "Serif,normal,400" not found. Substituting with
>>> "any,normal,400".
>>> ...
>>>
>>> However, apiguide.fo does not contain any references to 'serif' font:
>>>
>>> $ grep -i serif apiguide.fo
>>> $
>>>
>>> Why does FOP need 'Serif' font? Is there some built-in expectation that
>>> 'Serif' font must be always available?
>>>
>>> Regards,
>>> Alexey.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
>>> For additional commands, e-mail: fop-users-help@(protected)
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
>> For additional commands, e-mail: fop-users-help@(protected)
>>
>
>
> --
> Cheers,
>
> Stefan Hinz <stefan.hinz@(protected)
>
> Phone: +49-30-82702940, Fax: +49-30-82702941, http://dev.mysql.com/doc
>
> ORACLE Deutschland B.V.& Co. KG
> Registered Office: Riesstr. 25, 80992 Muenchen, Germany
> Commercial Register: Local Court Of Munich, HRA 95603
> Managing Director: Jürgen Kunz
>
> General Partner: ORACLE Deutschland Verwaltung B.V.
> Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
> Register Of Chamber Of Commerce: Midden-Niederlande, No. 30143697
> Managing Directors: Alexander van der Ven, Astrid Kepper, Val Maher
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> For additional commands, e-mail: fop-users-help@(protected)
>



--
pascal


Attachment: fop-users_36129.eml (zipped)
Thanks, Pascal!

Cheers,

Stefan

On 20.12.2012 10:35, Pascal Sancho wrote:
> Hi,
>
> simply using the font-family attribute on the fo:root element.
>
> Note that all inherited properties can be set on fo:root element, so
> you can set your own default properties there, including font-family.
>
> 2012/12/20 Stefan Hinz <stefan.hinz@(protected)>:
>> Hi Bernardo,
>>
>> That's good advice, thanks! How would you specify a global font family in
>> the FO root element, though?
>>
>> Cheers,
>>
>> Stefan
>>
>>
>>
>> On 20.12.2012 01:45, Luis Bernardo wrote:
>>>
>>>
>>> This is of no consequence although is it puzzling at first. If you
>>> specify a global font-family in the fo root element I think the warning
>>> goes away. I think what you are seeing has been discussed here:
>>>
>>> http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-found-whereas-they-are-not-needed-td31330.html
>>>
>>>
>>> On 12/19/12 11:05 PM, Alexey Neyman wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I see the following warning message reported by FOP:
>>>>
>>>> $ fop -c fop.cfg -dpi 150 apiguide.fo apiguide.pdf
>>>> Dec 19, 2012 2:59:02 PM org.apache.fop.events.LoggingEventListener
>>>> processEvent
>>>> WARNING: Font "Serif,normal,400" not found. Substituting with
>>>> "any,normal,400".
>>>> ...
>>>>
>>>> However, apiguide.fo does not contain any references to 'serif' font:
>>>>
>>>> $ grep -i serif apiguide.fo
>>>> $
>>>>
>>>> Why does FOP need 'Serif' font? Is there some built-in expectation that
>>>> 'Serif' font must be always available?
>>>>
>>>> Regards,
>>>> Alexey.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
>>>> For additional commands, e-mail: fop-users-help@(protected)
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
>>> For additional commands, e-mail: fop-users-help@(protected)
>>>
>>
>>
>> --
>> Cheers,
>>
>> Stefan Hinz <stefan.hinz@(protected)
>>
>> Phone: +49-30-82702940, Fax: +49-30-82702941, http://dev.mysql.com/doc
>>
>> ORACLE Deutschland B.V.& Co. KG
>> Registered Office: Riesstr. 25, 80992 Muenchen, Germany
>> Commercial Register: Local Court Of Munich, HRA 95603
>> Managing Director: Jürgen Kunz
>>
>> General Partner: ORACLE Deutschland Verwaltung B.V.
>> Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
>> Register Of Chamber Of Commerce: Midden-Niederlande, No. 30143697
>> Managing Directors: Alexander van der Ven, Astrid Kepper, Val Maher
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
>> For additional commands, e-mail: fop-users-help@(protected)
>>
>
>
>


--
Cheers,

Stefan Hinz <stefan.hinz@(protected)

Phone: +49-30-82702940, Fax: +49-30-82702941, http://dev.mysql.com/doc

ORACLE Deutschland B.V.& Co. KG
Registered Office: Riesstr. 25, 80992 Muenchen, Germany
Commercial Register: Local Court Of Munich, HRA 95603
Managing Director: Jürgen Kunz

General Partner: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Register Of Chamber Of Commerce: Midden-Niederlande, No. 30143697
Managing Directors: Alexander van der Ven, Astrid Kepper, Val Maher


Attachment: fop-users_36130.eml (zipped)
Hi Luis,

No, it is not the case. In the FO I am using, fo:root has a font-family
specified, and that font family is described in the fop.cfg.

Actually, I traced this warning down to the watermark image specified for
the background. However, that SVG does not refer to 'Serif' font, either. Can
somebody please explain how does FOP treat the fonts in the included SVG
files?

I even tried to add a substitution from font-family="Serif" to font-
family="Times New Roman", it did not help either.

Here is the reduced FO file that exhibits the issue:

[[[
<?xml version="1.0"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Times New
Roman">
<fo:layout-master-set>
  <fo:simple-page-master master-name="draft">
   <fo:region-body background-image="url(draft.svg)"/>
  </fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="draft">
  <fo:flow flow-name="xsl-region-body">
   <fo:block/>
  </fo:flow>
</fo:page-sequence>
</fo:root>
]]]

And here is the draft.svg:

[[[
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="80 80 600 600"
  version="1.1" width="5in" height="5in">
<text font-weight="normal" xml:space="preserve"
  transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)"
  font-size="250px" y="640" x="-315" font-family="'Times New Roman'"
  fill="#f2f2f2">Draft</text>
</svg>
]]]

And fop.cfg:

[[[
<?xml version="1.0"?>
<fop version="1.0">
<renderers>
  <renderer mime="application/pdf">
   <fonts>
    <font kerning="yes" metrics-url="TimesNewRoman.metric" embed-
url="TimesNewRoman.ttf">
      <font-triplet name="Times New Roman" weight="normal"
style="normal"/>
    </font>
   </fonts>
  </renderer>
</renderers>
</fop>
]]]

Regards,
Alexey.

On Wednesday, December 19, 2012 04:45:31 pm Luis Bernardo wrote:
> This is of no consequence although is it puzzling at first. If you
> specify a global font-family in the fo root element I think the warning
> goes away. I think what you are seeing has been discussed here:
> http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-found-w
> hereas-they-are-not-needed-td31330.html
>
> On 12/19/12 11:05 PM, Alexey Neyman wrote:
> > Hi all,
> >
> > I see the following warning message reported by FOP:
> >
> > $ fop -c fop.cfg -dpi 150 apiguide.fo apiguide.pdf
> > Dec 19, 2012 2:59:02 PM org.apache.fop.events.LoggingEventListener
> > processEvent
> > WARNING: Font "Serif,normal,400" not found. Substituting with
> > "any,normal,400".
> > ...
> >
> > However, apiguide.fo does not contain any references to 'serif' font:
> >
> > $ grep -i serif apiguide.fo
> > $
> >
> > Why does FOP need 'Serif' font? Is there some built-in expectation that
> > 'Serif' font must be always available?
> >
> > Regards,
> > Alexey.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> > For additional commands, e-mail: fop-users-help@(protected)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> For additional commands, e-mail: fop-users-help@(protected)


Attachment: fop-users_36131.eml (zipped)



-------- Original Message --------
Subject: Re: How to find out why fop needs a certain font?
Date: Thu, 20 Dec 2012 23:32:04 +0000
From: Luis Bernardo <lmpmbernardo@gmail.com>
To: Alexey Neyman <stilor@att.net>


With SVG, fonts are more complicated. The font used in the SVG needs to 
be installed in the system and needs to be configured in fop.xconf too. 
The warning you got usually happens when the font is in the system but 
not configured in fop.xconf, which looking at your example does not seem 
to be the case...

If you want to get to the bottom of the matter please indicate what 
version of fop you are using and what OS. Also, the use of metrics-url 
is not needed anymore (and is not recommended) so you can remove that. I 
see you refer to the font file TimesNewRoman.ttf without specifying a 
font-base path (which only works if you have the file in the same 
directory you have your *.fo file). Is that font file an exact copy of 
the installed font in the system of the same name?

On 12/20/12 6:44 PM, Alexey Neyman wrote:
> Hi Luis,
>
> No, it is not the case. In the FO I am using, fo:root has a font-family
> specified, and that font family is described in the fop.cfg.
>
> Actually, I traced this warning down to the watermark image specified for
> the background. However, that SVG does not refer to 'Serif' font, either. Can
> somebody please explain how does FOP treat the fonts in the included SVG
> files?
>
> I even tried to add a substitution from font-family="Serif" to font-
> family="Times New Roman", it did not help either.
>
> Here is the reduced FO file that exhibits the issue:
>
> [[[
> <?xml version="1.0"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Times New
> Roman">
>    <fo:layout-master-set>
>      <fo:simple-page-master master-name="draft">
>        <fo:region-body background-image="url(draft.svg)"/>
>      </fo:simple-page-master>
>    </fo:layout-master-set>
>    <fo:page-sequence master-reference="draft">
>      <fo:flow flow-name="xsl-region-body">
>        <fo:block/>
>      </fo:flow>
>    </fo:page-sequence>
> </fo:root>
> ]]]
>
> And here is the draft.svg:
>
> [[[
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <svg xmlns="http://www.w3.org/2000/svg" viewBox="80 80 600 600"
>      version="1.1" width="5in" height="5in">
>    <text font-weight="normal" xml:space="preserve"
>      transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)"
>      font-size="250px" y="640" x="-315" font-family="'Times New Roman'"
>      fill="#f2f2f2">Draft</text>
> </svg>
> ]]]
>
> And fop.cfg:
>
> [[[
> <?xml version="1.0"?>
> <fop version="1.0">
>    <renderers>
>      <renderer mime="application/pdf">
>        <fonts>
>          <font kerning="yes" metrics-url="TimesNewRoman.metric" embed-
> url="TimesNewRoman.ttf">
>            <font-triplet name="Times New Roman" weight="normal"
> style="normal"/>
>          </font>
>        </fonts>
>      </renderer>
>    </renderers>
> </fop>
> ]]]
>
> Regards,
> Alexey.
>
> On Wednesday, December 19, 2012 04:45:31 pm Luis Bernardo wrote:
>> This is of no consequence although is it puzzling at first. If you
>> specify a global font-family in the fo root element I think the warning
>> goes away. I think what you are seeing has been discussed here:
>> http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-found-w
>> hereas-they-are-not-needed-td31330.html
>>
>> On 12/19/12 11:05 PM, Alexey Neyman wrote:
>>> Hi all,
>>>
>>> I see the following warning message reported by FOP:
>>>
>>> $ fop -c fop.cfg -dpi 150 apiguide.fo apiguide.pdf
>>> Dec 19, 2012 2:59:02 PM org.apache.fop.events.LoggingEventListener
>>> processEvent
>>> WARNING: Font "Serif,normal,400" not found. Substituting with
>>> "any,normal,400".
>>> ...
>>>
>>> However, apiguide.fo does not contain any references to 'serif' font:
>>>
>>> $ grep -i serif apiguide.fo
>>> $
>>>
>>> Why does FOP need 'Serif' font? Is there some built-in expectation that
>>> 'Serif' font must be always available?
>>>
>>> Regards,
>>> Alexey.
>>>
>>> ---------------------------------------------------------------------
>>> 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



Attachment: fop-users_36132.eml (zipped)
Yes, I want to understand how FOP treats the fonts in SVG (and, if you know
that, how fonts are selected in embedded MathML via JEuclid plugin - we use
that, too).

We've had some font discrepancies in the past depending on the fonts installed
on each developer's machine (in part, because some of the authors are on
Windows machines and some are on Linux - so they're likely to have different
fonts). Thus, we've decided to do away with using system fonts and use only
local fonts (i.e. fonts checked out from the repository along with the
document sources).

On Thursday, December 20, 2012 03:32:04 pm Luis Bernardo wrote:
> With SVG, fonts are more complicated. The font used in the SVG needs to
> be installed in the system and needs to be configured in fop.xconf too.
> The warning you got usually happens when the font is in the system but
> not configured in fop.xconf, which looking at your example does not seem
> to be the case...

Are you saying that the font used in SVG needs to be present both as a system
font, even if it is listed in fop.conf? What is FOP going to use then, system
font or local font?

If it is using system font, that's more than disturbing. As I mentioned, this
completely prevents setting up a controlled environment with known fonts.

> If you want to get to the bottom of the matter please indicate what
> version of fop you are using and what OS.

FOP 1.1, Linux (RedHat Enterprise, 6.2).

> Also, the use of metrics-url
> is not needed anymore (and is not recommended) so you can remove that.

I tried, it didn't have any effect on the warning.

> I see you refer to the font file TimesNewRoman.ttf without specifying a
> font-base path (which only works if you have the file in the same
> directory you have your *.fo file).

I made it so for this reduced test case. Originally, it was embed-
url="../fonts/TimesNewRoman.ttf" - as I mentioned above, we want to have a
controlled font environment.

> Is that font file an exact copy of
> the installed font in the system of the same name?

The machine does not have a 'Times New Roman' system font (it's a Linux
machine, it comes with a different set of system fonts by default).

But why would FOP need a system font if it has the required font specified in
the configuration file?

Another question is, would embedding fonts in SVGs prevent FOP from using
system fonts?

Regards,
Alexey.

>
> On 12/20/12 6:44 PM, Alexey Neyman wrote:
> > Hi Luis,
> >
> > No, it is not the case. In the FO I am using, fo:root has a font-family
> > specified, and that font family is described in the fop.cfg.
> >
> > Actually, I traced this warning down to the watermark image specified for
> > the background. However, that SVG does not refer to 'Serif' font, either.
> > Can somebody please explain how does FOP treat the fonts in the included
> > SVG files?
> >
> > I even tried to add a substitution from font-family="Serif" to font-
> > family="Times New Roman", it did not help either.
> >
> > Here is the reduced FO file that exhibits the issue:
> >
> > [[[
> > <?xml version="1.0"?>
> > <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Times
> > New Roman">
> >
> >   <fo:layout-master-set>
> >  
> >    <fo:simple-page-master master-name="draft">
> >    
> >     <fo:region-body background-image="url(draft.svg)"/>
> >    
> >    </fo:simple-page-master>
> >  
> >   </fo:layout-master-set>
> >   <fo:page-sequence master-reference="draft">
> >  
> >    <fo:flow flow-name="xsl-region-body">
> >    
> >     <fo:block/>
> >    
> >    </fo:flow>
> >  
> >   </fo:page-sequence>
> >
> > </fo:root>
> > ]]]
> >
> > And here is the draft.svg:
> >
> > [[[
> > <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> > <svg xmlns="http://www.w3.org/2000/svg" viewBox="80 80 600 600"
> >
> >    version="1.1" width="5in" height="5in">
> >  
> >   <text font-weight="normal" xml:space="preserve"
> >  
> >    transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)"
> >    font-size="250px" y="640" x="-315" font-family="'Times New Roman'"
> >    fill="#f2f2f2">Draft</text>
> >
> > </svg>
> > ]]]
> >
> > And fop.cfg:
> >
> > [[[
> > <?xml version="1.0"?>
> > <fop version="1.0">
> >
> >   <renderers>
> >  
> >    <renderer mime="application/pdf">
> >    
> >     <fonts>
> >    
> >       <font kerning="yes" metrics-url="TimesNewRoman.metric" embed-
> >
> > url="TimesNewRoman.ttf">
> >
> >        <font-triplet name="Times New Roman" weight="normal"
> >
> > style="normal"/>
> >
> >       </font>
> >    
> >     </fonts>
> >    
> >    </renderer>
> >  
> >   </renderers>
> >
> > </fop>
> > ]]]
> >
> > Regards,
> > Alexey.
> >
> > On Wednesday, December 19, 2012 04:45:31 pm Luis Bernardo wrote:
> >> This is of no consequence although is it puzzling at first. If you
> >> specify a global font-family in the fo root element I think the warning
> >> goes away. I think what you are seeing has been discussed here:
> >> http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-foun
> >> d-w hereas-they-are-not-needed-td31330.html
> >>
> >> On 12/19/12 11:05 PM, Alexey Neyman wrote:
> >>> Hi all,
> >>>
> >>> I see the following warning message reported by FOP:
> >>>
> >>> $ fop -c fop.cfg -dpi 150 apiguide.fo apiguide.pdf
> >>> Dec 19, 2012 2:59:02 PM org.apache.fop.events.LoggingEventListener
> >>> processEvent
> >>> WARNING: Font "Serif,normal,400" not found. Substituting with
> >>> "any,normal,400".
> >>> ...
> >>>
> >>> However, apiguide.fo does not contain any references to 'serif' font:
> >>>
> >>> $ grep -i serif apiguide.fo
> >>> $
> >>>
> >>> Why does FOP need 'Serif' font? Is there some built-in expectation that
> >>> 'Serif' font must be always available?
> >>>
> >>> Regards,
> >>> Alexey.
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> >>> For additional commands, e-mail: fop-users-help@(protected)
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> >> For additional commands, e-mail: fop-users-help@(protected)


Attachment: fop-users_36133.eml (zipped)

SVG fonts call the AWT font subsystem, which means that they use system fonts. Fixing that is an arduous and very time intensive task.

If you want to see what fonts are available to Batik, the SVG renderer you just need to list the fonts available to AWT. There are plently of emails on this subject in the archives if you want to learn more.

If you've still got questions, feel free to ask

Mehdi

On Dec 21, 2012 3:07 AM, "Alexey Neyman" <stilor@att.net> wrote:
Yes, I want to understand how FOP treats the fonts in SVG (and, if you know
that, how fonts are selected in embedded MathML via JEuclid plugin - we use
that, too).

We've had some font discrepancies in the past depending on the fonts installed
on each developer's machine (in part, because some of the authors are on
Windows machines and some are on Linux - so they're likely to have different
fonts). Thus, we've decided to do away with using system fonts and use only
local fonts (i.e. fonts checked out from the repository along with the
document sources).

On Thursday, December 20, 2012 03:32:04 pm Luis Bernardo wrote:
> With SVG, fonts are more complicated. The font used in the SVG needs to
> be installed in the system and needs to be configured in fop.xconf too.
> The warning you got usually happens when the font is in the system but
> not configured in fop.xconf, which looking at your example does not seem
> to be the case...

Are you saying that the font used in SVG needs to be present both as a system
font, even if it is listed in fop.conf? What is FOP going to use then, system
font or local font?

If it is using system font, that's more than disturbing. As I mentioned, this
completely prevents setting up a controlled environment with known fonts.

> If you want to get to the bottom of the matter please indicate what
> version of fop you are using and what OS.

FOP 1.1, Linux (RedHat Enterprise, 6.2).

> Also, the use of metrics-url
> is not needed anymore (and is not recommended) so you can remove that.

I tried, it didn't have any effect on the warning.

> I see you refer to the font file TimesNewRoman.ttf without specifying a
> font-base path (which only works if you have the file in the same
> directory you have your *.fo file).

I made it so for this reduced test case. Originally, it was embed-
url="../fonts/TimesNewRoman.ttf" - as I mentioned above, we want to have a
controlled font environment.

> Is that font file an exact copy of
> the installed font in the system of the same name?

The machine does not have a 'Times New Roman' system font (it's a Linux
machine, it comes with a different set of system fonts by default).

But why would FOP need a system font if it has the required font specified in
the configuration file?

Another question is, would embedding fonts in SVGs prevent FOP from using
system fonts?

Regards,
Alexey.

>
> On 12/20/12 6:44 PM, Alexey Neyman wrote:
> > Hi Luis,
> >
> > No, it is not the case. In the FO I am using, fo:root has a font-family
> > specified, and that font family is described in the fop.cfg.
> >
> > Actually, I traced this warning down to the watermark image specified for
> > the background. However, that SVG does not refer to 'Serif' font, either.
> > Can somebody please explain how does FOP treat the fonts in the included
> > SVG files?
> >
> > I even tried to add a substitution from font-family="Serif" to font-
> > family="Times New Roman", it did not help either.
> >
> > Here is the reduced FO file that exhibits the issue:
> >
> > [[[
> > <?xml version="1.0"?>
> > <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Times
> > New Roman">
> >
> >    <fo:layout-master-set>
> >
> >      <fo:simple-page-master master-name="draft">
> >
> >        <fo:region-body background-image="url(draft.svg)"/>
> >
> >      </fo:simple-page-master>
> >
> >    </fo:layout-master-set>
> >    <fo:page-sequence master-reference="draft">
> >
> >      <fo:flow flow-name="xsl-region-body">
> >
> >        <fo:block/>
> >
> >      </fo:flow>
> >
> >    </fo:page-sequence>
> >
> > </fo:root>
> > ]]]
> >
> > And here is the draft.svg:
> >
> > [[[
> > <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> > <svg xmlns="http://www.w3.org/2000/svg" viewBox="80 80 600 600"
> >
> >      version="1.1" width="5in" height="5in">
> >
> >    <text font-weight="normal" xml:space="preserve"
> >
> >      transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)"
> >      font-size="250px" y="640" x="-315" font-family="'Times New Roman'"
> >      fill="#f2f2f2">Draft</text>
> >
> > </svg>
> > ]]]
> >
> > And fop.cfg:
> >
> > [[[
> > <?xml version="1.0"?>
> > <fop version="1.0">
> >
> >    <renderers>
> >
> >      <renderer mime="application/pdf">
> >
> >        <fonts>
> >
> >          <font kerning="yes" metrics-url="TimesNewRoman.metric" embed-
> >
> > url="TimesNewRoman.ttf">
> >
> >            <font-triplet name="Times New Roman" weight="normal"
> >
> > style="normal"/>
> >
> >          </font>
> >
> >        </fonts>
> >
> >      </renderer>
> >
> >    </renderers>
> >
> > </fop>
> > ]]]
> >
> > Regards,
> > Alexey.
> >
> > On Wednesday, December 19, 2012 04:45:31 pm Luis Bernardo wrote:
> >> This is of no consequence although is it puzzling at first. If you
> >> specify a global font-family in the fo root element I think the warning
> >> goes away. I think what you are seeing has been discussed here:
> >> http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-foun
> >> d-w hereas-they-are-not-needed-td31330.html
> >>
> >> On 12/19/12 11:05 PM, Alexey Neyman wrote:
> >>> Hi all,
> >>>
> >>> I see the following warning message reported by FOP:
> >>>
> >>> $ fop -c fop.cfg -dpi 150 apiguide.fo apiguide.pdf
> >>> Dec 19, 2012 2:59:02 PM org.apache.fop.events.LoggingEventListener
> >>> processEvent
> >>> WARNING: Font "Serif,normal,400" not found. Substituting with
> >>> "any,normal,400".
> >>> ...
> >>>
> >>> However, apiguide.fo does not contain any references to 'serif' font:
> >>>
> >>> $ grep -i serif apiguide.fo
> >>> $
> >>>
> >>> Why does FOP need 'Serif' font? Is there some built-in expectation that
> >>> 'Serif' font must be always available?
> >>>
> >>> Regards,
> >>> Alexey.
> >>>
> >>> ---------------------------------------------------------------------
> >>> 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

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

©2008 java2.5341.com - Jax Systems, LLC, U.S.A.