Results 1 to 6 of 6

Thread: Picture Box & fontsize

  1. #1
    Guest

    Angry


    I am using a picture box as a print preview window.
    Everything is working fine except for one annoying
    problem.

    When I set the font size as below:-

    picture1.fontsize = 8

    I then check the property to find that it has set it to 8.25
    I come across this with a number of sizes not just 8 (e.g: 16 gets set to 15.75).

    Anyone any ideas.

    SeanR

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    That's because the screen is handling pixels and not points. You can't actually never get an exact font size to appear on the screen. This is true for all applications. When you set a font size to 8 points in Word you will actually get about 8.25 on the screen, but it will be 8 when you print it.

  3. #3
    Guest

    Thumbs up

    Dear Joacim,

    Many thanks for your reply.

    Any ideas on how to handle a print preview if
    screen fonts can't be matched with printed ones?

    Thanks

    Sean

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    They will match.. or sort of. The difference is less then a half pixel.

  5. #5
    Guest
    Thanks Again Joacim

    My problem is that on a single page of a report I could have 60+ lines. so a 1/4 of a point adds up so the preview ends showing less lines (or possiably more) per page than then the actual printout.

    I think I can solve it by preprocessing the print out through a picture box and into a file. Then I can use
    the absolute x,y values to print the report.


    Sean

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    We're not talking about a 1/4 of a point but maybe 1/4 of a pixel. You have the same trouble when you try to size your picture box to the same size as the printed paper. The screen can't possibly light up one quarter of a pixel. Either the pixel is lit or it isn't. This has been a problem for 'layouters' for ever (or at least since the introduction of computers).

    I wouldn't worry about it much though. If it's just some text you're going to preview.
    When I look at the preview in Word I think it looks pretty near the finished printout. But as I meantion earlier Word as any other software has the same problem.

    Just try printing your preview and then print it to a hardcopy and compare it yourself. I'm pretty sure it will look allright.

    Best regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width