[iText-questions] Font size and width between characters
Hi all, I have 2 questions. Is there a way to convert the font size in mm to pt. I have a pdf file that has font size of 2.55mm and I need to know the equivalent in the pt system. Also, i am using the futura font and one of the requirements is that for a particular heading at the top of the page there is to be a greater space between each character. Is there a way I can stretch out a word by setting the distance between each character in that word? Thank you David - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
Re: [iText-questions] Font size and width between characters
if you assume a dpi value for your document eg 72 dpi you can calculate your font pt size, you would get 7.23pt As for tracking, if you place text in a template you can set template.setCharacterSpace(x) This shows you how to use a template http://www.nabble.com/Rotate-a-PDFContentByte-Rectangle--tf3237657.html http://www.nabble.com/Rotate-a-PDFContentByte-Rectangle--tf3237657.html adding this code after template.fill() shows you how to use text: FontFactory.registerDirectories(); Font f = FontFactory.getFont(Verdana, BaseFont.CP1252, BaseFont.EMBEDDED, 12f, Font.NORMAL); template.beginText(); template.setColorFill(Color.BLACK); template.setCharacterSpacing(15f); template.setFontAndSize(f.getBaseFont(), f.size()); template.showTextAligned(PdfContentByte.ALIGN_LEFT, Hello world, 50, 50, 0); template.endText(); david allen wrote: Hi all, I have 2 questions. Is there a way to convert the font size in mm to pt. I have a pdf file that has font size of 2.55mm and I need to know the equivalent in the pt system. Also, i am using the futura font and one of the requirements is that for a particular heading at the top of the page there is to be a greater space between each character. Is there a way I can stretch out a word by setting the distance between each character in that word? Thank you David - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/ -- View this message in context: http://www.nabble.com/Font-size-and-width-between-characters-tf3267478.html#a9085919 Sent from the iText - General mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
Re: [iText-questions] Font size and width between characters
With just slightly more detail: there are 72 points per inch and 25.4 mm per inch. So, each mm = 2.83 points and your 2.55mm is 7.23 pt as porcupine points out. ---Mister Bean porcupine wrote: if you assume a dpi value for your document eg 72 dpi you can calculate your font pt size, you would get 7.23pt As for tracking, if you place text in a template you can set template.setCharacterSpace(x) This shows you how to use a template http://www.nabble.com/Rotate-a-PDFContentByte-Rectangle--tf3237657.html http://www.nabble.com/Rotate-a-PDFContentByte-Rectangle--tf3237657.html adding this code after template.fill() shows you how to use text: FontFactory.registerDirectories(); Font f = FontFactory.getFont(Verdana, BaseFont.CP1252, BaseFont.EMBEDDED, 12f, Font.NORMAL); template.beginText(); template.setColorFill(Color.BLACK); template.setCharacterSpacing(15f); template.setFontAndSize(f.getBaseFont(), f.size()); template.showTextAligned(PdfContentByte.ALIGN_LEFT, Hello world, 50, 50, 0); template.endText(); david allen wrote: Hi all, I have 2 questions. Is there a way to convert the font size in mm to pt. I have a pdf file that has font size of 2.55mm and I need to know the equivalent in the pt system. Also, i am using the futura font and one of the requirements is that for a particular heading at the top of the page there is to be a greater space between each character. Is there a way I can stretch out a word by setting the distance between each character in that word? Thank you David - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/ -- View this message in context: http://www.nabble.com/Font-size-and-width-between-characters-tf3267478.html#a9086099 Sent from the iText - General mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/