CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2004
    Posts
    44

    Normal vs. Large size fonts problem

    I have developed an video application that has a video region as well as static text around the video region. I developed this on my laptop with the Display screen resolution set to 1920x1200 with Large size fonts (set in the Advanced section). I just changed the Display font size from Large size (DPI 120) to Normal size (DPI 96) and now the layout of all my static text is all screwed up.

    My first question is how do I determine at runtime whether the Display is set for Large or Normal sizie fonts?

    What is the prefered methof to deal with this? Should I first check the font size and then pick the resource that lays out my static text accordingly?

    Thanks in advance for any help.

    -Andres

  2. #2
    Join Date
    May 2004
    Location
    Michigan, United States
    Posts
    457

    Re: Normal vs. Large size fonts problem

    I think you can use the SystemParametersInfo() function with the SPI_GETNONCLIENTMETRICS flag. This should fill a NONCLIENTMETRICS structure that contains LOGFONTS for the current system fonts.
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  3. #3
    Join Date
    Jul 2004
    Posts
    44

    Re: Normal vs. Large size fonts problem

    Thank you for your reply. I will try that.

    What is the preferable way to deal with this? Should I layout a totally different resource for each font size?

    Thanks,

    -Andres

  4. #4
    Join Date
    May 2005
    Posts
    4,954

    Re: Normal vs. Large size fonts problem

    I think you can use the SystemParametersInfo() function with the SPI_GETNONCLIENTMETRICS flag. This should fill a NONCLIENTMETRICS structure that contains LOGFONTS for the current system fonts.
    well this will work but it will change the font in all the system applictions i am not sure u will want it.

    other way you can try is create CFont object in your app with fixed size and set it to all the controls you are having in the dialogs with the SetFont ( ) api.

    if i helped dont forget to rate :-)
    Cheers

  5. #5
    Join Date
    Jul 2004
    Posts
    44

    Re: Normal vs. Large size fonts problem

    Quote Originally Posted by golanshahar
    if i helped dont forget to rate :-)
    Cheers
    Please excuse my ignorance, but I do not know what this means. Do I "rate" responses?

    I appreciate your response and your suggestion (to use a fixed font) is good. You have helped me--thank you. Where do I rate this response?

    -Andres

  6. #6
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Normal vs. Large size fonts problem

    At the top-right corner of every post in a thread, you will see a link "Rate this post" . Click on it to "approve" or "disapprove" a post.

  7. #7
    Join Date
    May 2004
    Location
    Michigan, United States
    Posts
    457

    Re: Normal vs. Large size fonts problem

    Quote Originally Posted by golanshahar
    well this will work but it will change the font in all the system applictions i am not sure u will want it.

    Cheers
    I wasn't suggesting that he change the system font -- only inquire, then set his program's accordingly.
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

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

Featured