-none- 2007-09-04 - By Paulo Soares
Back Use the full width forms starting at \uff01.
Paulo
> -- --Original Message-- -- > From: itext-questions-bounces@(protected) > [mailto:itext-questions-bounces@(protected)] On > Behalf Of m_squall-m > Sent: Tuesday, September 04, 2007 3:05 AM > To: itext-questions@(protected) > Subject: [iText-questions] Justification/Character width size > > > Hello, > > With Courier font i can get the text alignment properly. For > example i can > fix one line with 12 characters and it was align perfectly. > > But if i use other font (in my case ST-Song) it will not > align correctly. > Spaces will take less space and each character have it's own > width size. > > How can i set ST-Song font behave the same like Courier in > term of character > width size. > > I can set the character width using below code for Courier but not for > ST-Song > > //Working > Font FontCourier = new Font(Font.COURIER); > FontCourier.setSize(12f); > BaseFont bfChinese = BaseFont.createFont(BaseFont.COURIER, > BaseFont.CP1252, > BaseFont.EMBEDDED); > > int[] widths = bfChinese.getWidths(); > for (int k = 0; k < widths.length; ++k) { > if (widths[k] != 0) > widths[k] = 1000; > } > bfChinese.setForceWidthsOutput(true); > Font FontChinese = new Font(bfChinese, 12, Font.NORMAL); > > //NOT WORKING > BaseFont bfChinese = BaseFont.createFont("STSongStd-Light", > "UniGB-UCS2-H", > BaseFont.NOT_EMBEDDED); > > int[] widths = bfChinese.getWidths(); > for (int k = 0; k < widths.length; ++k) { > if (widths[k] != 0) > widths[k] = 1000000; > } > bfChinese.setForceWidthsOutput(true); > Font FontChinese = new Font(bfChinese, 12, Font.NORMAL); > > Thank you. > > Regards, > Squall
Aviso Legal: Esta mensagem ? destinada exclusivamente ao destinat?rio. Pode conter informa? ?o confidencial ou legalmente protegida. A incorrecta transmiss?o desta mensagem n?o significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. ? proibido a qualquer pessoa que n?o o destinat?rio de usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|