aspose file tools*
The moose likes XML and Related Technologies and the fly likes how to change the font-family in XSLT file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how to change the font-family in XSLT file" Watch "how to change the font-family in XSLT file" New topic
Author

how to change the font-family in XSLT file

prashant fusate
Greenhorn

Joined: Aug 24, 2005
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.


psfusate
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

This is nothing to do with XSLT per-say. Consult the documentation for whatever API you use to create your PDF.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

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

Joined: Aug 24, 2005
Posts: 16
Dear Paul Clapham
Thanks for your update.

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
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
Is the problem this? You may need to keep a font configuration file.
prashant fusate
Greenhorn

Joined: Aug 24, 2005
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
org.apache.fop.fonts.apps.TTFReader enc ansi D:\iBOLT2.5sp6b\projects\PDFArial\fop-config\font\ariali.ttf D:/iBOLT2.5sp6b/projects/PDFArial/fop-config\xml\ariali.xml

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
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
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

Joined: Aug 24, 2005
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to change the font-family in XSLT file