Font size

Font size

Forum member · Jan 6, 2006
I'm writing 30 characters text using a 10pt. monospaced font (Courier) in a label. I expect that the length of this label should be 300 points in the finished document, but it only takes up about 180 points? What am I missing? Also, setting the Document .DefaultFont and .DefaultFontSize properties doesn't affect the font in my label (which is in a TextArea). I have to set those properties on the label itself.

Re: Font size

Support · Jan 6, 2006
The point size of a font actually corresponds to the height of that font. For any non fixed pitch fonts the width of each character is variable. The Courier font is a fixed pitch font and the width of each character always has a width of 60% the font point size. So in your case the with a 10pt font size the width of each character will be 6 points (since there are 72 points per inch this works out to 12 characters per inch). Further, 30 characters at a 10pt Courier font will actually be exactly 180 points. As for the DefaultFont and DefaultFontSize properties of Document we just did some testing on this and there does seem to be a bug not allowing these default values to propigate through. For now if you manually specify the "DPDF_Font_UseDefault" as the font type for your TextArea then this will force whatever Font you have specified on the DefaultFont property to be used (it should be doing this by default). As for the Font size you will just need to manually set this. I have forwarded this issue to the developers for there immediate attention and we will let you know as soon as a fix is available. Thanks, ceTe Software Support Team

Re: Font size

Forum member · Jan 7, 2006
Thank you for your prompt response. Are there any tips or tutorials available that can help me with layout? It's easy to generate pdfs with your product, but I am struggling with producing an attractive layout.

Re: Font size

Support · Jan 9, 2006
Hello, In order to help with proper layout of the page elements, you can use the LayoutGrid class. This class can be used to place a grid on the entire page. This grid is very helpful with the design and layout of the document. Following is the code snippet to add the Layout Grid to the page: <% ' Create a Document Dim MyDocument Set MyDocument = Server.CreateObject( "DynamicPDF.Document" ) ' Create a Page and add it to the document Dim MyPage Set MyPage = MyDocument.AddPage() Dim MyLayout Set MyLayout = MyPage.AddLayoutGrid( DPDF_GridType_Print ) ' Draw the PDF MyDocument.DrawToWeb Set MyPage = Nothing Set MyDocument = Nothing %> Thanks, ceTe Software Support Team