locked
Accurately setting the font size RRS feed

  • Question

  • Hi,

    I have a Rich Text Box in a windows form and I set the font type and size by grabbing information from a database. This rtb eventually appears in a Crystal Report. I use various methods to make sure the comment in the rtb fits into the box on the Crystal Report when printed.

    I have noticed recently that it is not 100% accurate. I am not expecting it to be 100% but I need it as close as possible.

    One problem I am having is that if, for example, I set the Rich Text Box font type to Comic Sans and the font size to 8, the text is appearing slightly smaller in the Crystal Report. I have noticed that if I copy the text from the RTB into Word, Wordpad, etc, the copied text font size is 8.5, not 8. This accounts for the slight difference. This might seem a very small and trivial difference but it is important for my app.

    In fact, the Crystal Report displays text at 8.25 according to the properties (even though I also select 8?!).

    I need to use this level of font size accuracy in the Rich Text Box. If I set the font size to 8 I need to know that it IS 8 not 8.5. Does anyone have any idea how I could achieve this or perhaps why I may not be able to get this level of accuracy. Or maybe a way of at least making sure that the rtb and crystal are using the same font size - what ever that may be.

    This is really urgent so if you have any thoughts, please let me know!

    Thanks in advance.
    Thursday, April 20, 2006 8:04 PM

Answers

  • Hi,

    Since Crystal report as a third party product issue is supported by Business Objects.

    I suggest you post in the crystal report forum for further response.
    Here is the Forum you may have a try.
    http://support.businessobjects.com/forums/content.asp?fid=251&sk=5&
    http://support.businessobjects.com/

    As for the copy/paste issue between RTB and word, based on my test, I can reproduce the problem that copy the text into Word, the size will be 8.5.
    I think this is because of the algorithm mapping of the device size and the logical size.
    e.g.
    The points means the physical,device size, but how it mapping into the logical size(pixel) may depend on the concrete application. The RTF text is stored in RTF format, it has its own unit when storing in file. But the Word/RTB may have different handle algorithm.I highly suggest you can submit this feedback to our product feedback center:
    http://lab.msdn.microsoft.com/productfeedback/default.aspx

    But I think the difference should be little, so I just wonder why you use it in Crystal report will cause much difference.

    Any if you do care the little difference, I think you may try to contact MSPSS directly. So that our special GDI engineer will investigate the issue for you.
    http://support.microsoft.com

    BTW: AFAIK, the RTF format is not supported now.

    Best regards,
    Peter Huang

    Monday, April 24, 2006 7:47 AM
  • Word and Crystal Reports are aware of the default printer connected to your computer (Rich Text Box is not), so those programs choose a display font that will produce the specified (closest)size on printed paper. If you ask for 8, Crystal Reports will determine the printer corresponding size(depending on the printer precision which could be 7.5 or 8.5) then renders it back to the screen scaled to achive WYSIWYG which happens to be 8.25.

    You will need two font sizes. One for screen display and one for the printed document, So you will need to find the corresponding printer font size of 8 and that's the one that you have to pass to Crystal Reports to achive SOME level of fidelity. This is the biggest downside of non-vector based graphics.

    The answer to your question is no. You might be able to tweak your program to behave as expected, but once the same program is ran on a computer with a different kind of printer, it might behave a little different.

      

    Tuesday, April 25, 2006 9:22 PM

All replies

  • Hi,

    Since Crystal report as a third party product issue is supported by Business Objects.

    I suggest you post in the crystal report forum for further response.
    Here is the Forum you may have a try.
    http://support.businessobjects.com/forums/content.asp?fid=251&sk=5&
    http://support.businessobjects.com/

    As for the copy/paste issue between RTB and word, based on my test, I can reproduce the problem that copy the text into Word, the size will be 8.5.
    I think this is because of the algorithm mapping of the device size and the logical size.
    e.g.
    The points means the physical,device size, but how it mapping into the logical size(pixel) may depend on the concrete application. The RTF text is stored in RTF format, it has its own unit when storing in file. But the Word/RTB may have different handle algorithm.I highly suggest you can submit this feedback to our product feedback center:
    http://lab.msdn.microsoft.com/productfeedback/default.aspx

    But I think the difference should be little, so I just wonder why you use it in Crystal report will cause much difference.

    Any if you do care the little difference, I think you may try to contact MSPSS directly. So that our special GDI engineer will investigate the issue for you.
    http://support.microsoft.com

    BTW: AFAIK, the RTF format is not supported now.

    Best regards,
    Peter Huang

    Monday, April 24, 2006 7:47 AM
  • Word and Crystal Reports are aware of the default printer connected to your computer (Rich Text Box is not), so those programs choose a display font that will produce the specified (closest)size on printed paper. If you ask for 8, Crystal Reports will determine the printer corresponding size(depending on the printer precision which could be 7.5 or 8.5) then renders it back to the screen scaled to achive WYSIWYG which happens to be 8.25.

    You will need two font sizes. One for screen display and one for the printed document, So you will need to find the corresponding printer font size of 8 and that's the one that you have to pass to Crystal Reports to achive SOME level of fidelity. This is the biggest downside of non-vector based graphics.

    The answer to your question is no. You might be able to tweak your program to behave as expected, but once the same program is ran on a computer with a different kind of printer, it might behave a little different.

      

    Tuesday, April 25, 2006 9:22 PM
  • Thanks Peter and JRQ for advice.

    I will build some level of flexibility into the system to accomodate the minor differences.

    Cheers.
    Wednesday, April 26, 2006 9:52 AM