Ming Yu wrote:
Thanks for the reply. Here is the strange thing.

When I put the order as font="16pt bold arial", the FO engine gives this 
warning:
WARNING: Font 'bold arial,normal,400' not found. Substituting with 
'any,normal,400'.

When I put the order as font="bold 16pt arial" , the FO engine gives the SEVERE 
error:
SEVERE: Ignoring property: font="bold 16pt arial" (No conversion defined bold; 
property:'font')

Even when I use individual tag as font-size="16pt" font-weight="bold" 
font-family="Arial", FO engine also gives this warning:
WARNING: Font 'Arial,normal,700' not found. Substituting with 'any,normal,700'.

At least with this warning FOP is looking for the Font you have requested. With previous warnings FOP is not parsing the shorthand property correctly.


According to Apache's documentation, I need to generate the arial.xml file 
myself like this:

The documentation is either wrong or you are looking at an older version of the documentation. In 0.95 and higher it is not necessary to generate a metrics file to use a custom font. You simply need to register the Font with FOP by adding a line similar to below in fop.xconf file in the section for the Renderer you are using:

<font kerning="yes"
      embed-url="file:///C:/windows/fonts/arial.ttf">
     <font-triplet name="Arial" style="normal" weight="normal"/>
  </font>




java -cp 
build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
          org.apache.fop.fonts.apps.TTFReader [options]
          C:\myfonts\cmr10.ttf ttfcm.xml

I tried to run it but I got errors.

Do you know how I can get the arial.xml file?

Thanks a lot!

HTH,

Chris


Ming



----- Original Message ----
From: Andreas Delmelle <[email protected]>
To: [email protected]
Sent: Friday, August 14, 2009 3:18:03 PM
Subject: Re: font configuration

On 14 Aug 2009, at 20:43, Ming Yu wrote:


Thanks a lot for the reply. I checked my version and found out that it's 0.94. 
So, I upgraded to 0.95. Now the SEVERE error changes to a warning:

WARNING: Font 'bold Arial,normal,400' not found. Substituting with 
'any,normal,400'.


Strange... seems like the font-family is parsed as 'bold Arial'. This may need 
to be looked into closer. Are you sure this is nowhere specified as such in the 
FO?

A value like 'font="16pt bold Arial"' could lead to the above result.
The right order is style/weight/variant, then size, then font-family, and 
font-family names with spaces are supported, so formally there is nothing wrong 
with that value for the shorthand, even though the order is mixed up.


Should I install the font myself somewhere? I'm using Eclipse as my IDE.

I also have another question regarding empty table-cell. The following lines:

<fo:table-cell></fo:table-cell>
<fo:table-cell border-right=".6pt solid black"></fo:table-cell>
<fo:table-cell border-right=".6pt solid black" border-bottom=".6pt solid 
black"/>

will produce the following error:

fo:table-cell is missing child elements.
Required Content Model: marker* (%block;)+

How can I allow empty cells?


You can turn off strict validation(*), but that is not recommended, since it 
will skip a lot of other validation rules as well, which could lead to 
unpredictable results and makes your FO less portable to other implementations.

Better would be to make sure that each cell always contains an empty fo:block.


(*) http://xmlgraphics.apache.org/fop/0.95/configuration.html


HTH!


Andreas



Andreas Delmelle
mailto:andreas.delmelle.AT.telenet.be
jabber: [email protected]
skype: adlm0608

---


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]







---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to