how to change the font-family in XSLT file

prashant fusate
Greenhorn
Posts: 16
I have created xml to pdf using xslt now I have problem of changing the font of generated pdf file.

How can I change the font of generated pdf file.

How can I specify the font-family in xslt file so that generated pdf file will be in that specified font.

Paul Sturrock
Bartender
Posts: 10336
This is nothing to do with XSLT per-say. Consult the documentation for whatever API you use to create your PDF.

Paul Clapham
Sheriff
Posts: 21416
33
If you are asking about XSL-FO, I just searched the web and found out that the <fo:block> element can have a font-family attribute.

prashant fusate
Greenhorn
Posts: 16
Dear Paul Clapham

But when I used font-family="arial" at that time it does not make any sence.
because arial is not a standerd font for FOP.So how can I used my winodows font to genrate the output PDF file

Thank you

Ulf Dittmer
Rancher
Posts: 42968
73
Is the problem this? You may need to keep a font configuration file.

prashant fusate
Greenhorn
Posts: 16
Hi,

Thanks for the document,
But my problem is something different I want to register windows font with FOP.

To do that I have genrated respective xml files(arial.xml,arialdb.xml ) by using windows arial.ttf file

java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;
lib\xercesImpl.jar;lib\xalan.jar

and specified genrated xml file in configuration file(i.e userconfig.xml ) to register the windows font in FOP.

by doing all this thing also I am not get output pdf with arial font

Could you please suggest what is wrong I am doing here.

Ulf Dittmer
Rancher
Posts: 42968
73
I am not get output pdf with arial font

What does this mean? Are there exceptions during PDF generation? Does the text not show up in the PDF? Does it appear in some other font? When viewing the font, are all desired fonts accessible?

prashant fusate
Greenhorn
Posts: 16
Hi

Yes I getting the are as follows
unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any
[ERROR] unknown font Arial,normal,normal so defaulted font to any

i.e it is not registered with fop

how can i solve this issue?\

Thank you very much.