Jump to content
Changes to the Jaspersoft community edition download ×

Font name and encoding


2005 IR Help

Recommended Posts

By: bertram gong - bertram2001

Font name and encoding

2001-12-11 18:00

Hi Teodor,

You have made a great report tool.

I find another problem in source code is that Font.name is fiexed as "HELVETICA", but someone maybe use jasper report in other double byte characterset,so I suggest to handle the character set like the following:

1.add a attribute "Encoding" in

example:<jasperReport/>

2.add code in JRPrinterPDF :

BaseFont bfChinese1 =

BaseFont.createFont(Font.Name, Encoding, false);

font =

new Font(

bfChinese1,

jrFont.getSize(),

((jrFont.isBold())?Font.BOLD:0) + ((jrFont.isItalic())?Font.ITALIC:0) + ((jrFont.isUnderline())?Font.UNDERLINE:0) + ((jrFont.isStrikeThrough())?Font.STRIKETHRU:0),

text.getForecolor() );

 

 

 

 

 

By: Teodor Danciu - teodord

RE: Font name and encoding

2001-12-11 23:32

 

Hi, Bertram,

 

Thank you for your appreciation and for your help.

 

The font problem is a little tricky and

I have postponed it for some time.

Now I think I have to solve it once and for all.

 

The truth is I don't have so much experience

working with Asian fonts and I have to study

the problem a little.

 

Thank you for pointing me in the right direction.

 

The problem is that there are two places

to deal with the font problem in JasperReports:

in the JRPrinter and in the JRPrinterPDF.

 

If I will have troubles dealing with this

problem, I think I will ask for your help.

 

Thanks a lot!

Teodor

 

 

 

By: bertram gong - bertram2001

RE: Font name and encoding

2001-12-12 16:53

Hi, Teodor

 

I would like to contribute my experience on character set to the jasper report project,

 

Bertram

 

 

By: Ilievski Bozidar - bobi1978

RE: to bertram2001

2001-12-20 13:26

Hi.

I need Cyrillic characters in my report.

So as you say above I have to make some

changes into JRPrinterPDF file:

 

BaseFont myFont =

BaseFont.createFont(Font.Name,Encoding,false);

 

Is this enough?

 

Because Font.Name and Encoding are Strings,

can you give me exact examples for them???

 

 

 

 

By: bertram gong - bertram2001

RE: to bobi1978

2001-12-22 04:23

Hi,

 

Adob company define their own font name and encoding for each characterset, You can lookup the "Font.Name" and "Encoding" mapping information in Adob website for Cyrillic characterset.

 

 

Bertram

 

 

By: bertram gong - bertram2001

RE: to bertram2001

2001-12-22 04:23

Hi,

 

Adob company define their own font name and encoding for each characterset, You can lookup the "Font.Name" and "Encoding" mapping information in Adob website for Cyrillic characterset.

 

 

Bertram

 

 

By: Paulo Soares - psoares33

RE: to bertram2001

2001-12-22 10:03

Fonts and encodings don't work that way in iText.

The encoding must be one supported by java. In the cyrillic case it would be "Cp1251". The font should contain the required chars; no problem here, arial, times new roman and courier new have the needed glyphs.

For Asian fonts there are two ways of doing things: use the Adobe Asian font pack or embedd the font using the encoding "Identity-H". See the tutorial examples in http://www.lowagie.com/iText.

Link to comment
Share on other sites

  • 5 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...