Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Print Preview, Zoom and font size?

Print Preview, Zoom and font size?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paul Barvinko
    wrote on last edited by
    #1

    Hello everybody! I hope that someone can help me with the strange problem that I have. I am printing the text on the page using DrawText function. The text is big enough so it may go across several pages. And the strange thing is that when I do Zoom in the Print Preview, size of the font changes so the boundary box of the resulting text is different for different zooms! And on the page itself it looks like different portion of the text is displayed per page for every zoom coefficient. I wonder if someone knows what is the catch here? Thanks in advance.

    H 1 Reply Last reply
    0
    • P Paul Barvinko

      Hello everybody! I hope that someone can help me with the strange problem that I have. I am printing the text on the page using DrawText function. The text is big enough so it may go across several pages. And the strange thing is that when I do Zoom in the Print Preview, size of the font changes so the boundary box of the resulting text is different for different zooms! And on the page itself it looks like different portion of the text is displayed per page for every zoom coefficient. I wonder if someone knows what is the catch here? Thanks in advance.

      H Offline
      H Offline
      HP
      wrote on last edited by
      #2

      Hi, try using CFont::CreatePointFont(...) for initalising the font. HTH Holger Persch

      P 1 Reply Last reply
      0
      • H HP

        Hi, try using CFont::CreatePointFont(...) for initalising the font. HTH Holger Persch

        P Offline
        P Offline
        Paul Barvinko
        wrote on last edited by
        #3

        Hello! Thanks for your suggestion. Unfortunately it will not work, because this behavior (as I found out later) is caused by bug (feature?!) in CPreviewDC implementation of the DrawText routine that I am using to output text. It does not take into account m_hAttribDC and uses only m_hDC for drawing - as a result for different zoom levels there are fonts of different height, selected into m_hDC -> size of the bounding box for DrawText veries. I do not know yet how to overcome this bug, but for sure this is not that easy...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups