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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. font compatibility

font compatibility

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 Posters 0 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.
  • V Offline
    V Offline
    Vu Nguyen
    wrote on last edited by
    #1

    Hi all! I made an simple application on my computer which uses "small font"; When I bring this program to a computer that uses large font, some buttons are missing. and some buttons with long caption does not display the caption correctly. Is there a way to avoid this problem. I am thinking of choosing a font that is not true type, so it won't grow or shrink with windows, but not sure if it will work. Can we detect windows' font size and change dynamically? Thanks Vu vucsuf

    B 1 Reply Last reply
    0
    • V Vu Nguyen

      Hi all! I made an simple application on my computer which uses "small font"; When I bring this program to a computer that uses large font, some buttons are missing. and some buttons with long caption does not display the caption correctly. Is there a way to avoid this problem. I am thinking of choosing a font that is not true type, so it won't grow or shrink with windows, but not sure if it will work. Can we detect windows' font size and change dynamically? Thanks Vu vucsuf

      B Offline
      B Offline
      Bernhard
      wrote on last edited by
      #2

      this code can be used to detect the settings...

      CDC ScreenDC;
      ScreenDC.CreateIC(_T("DISPLAY"), NULL, NULL, NULL);
      const int x = ScreenDC.GetDeviceCaps(LOGPIXELSX);
      const int y = ScreenDC.GetDeviceCaps(LOGPIXELSY);

      if (x == 96 && y == 96)
      {
      //Small Font
      }
      else if (x == 120 && y == 120)
      {
      //Large Font
      }
      else
      {
      //Custom Font setting
      }

      the only real workaround for this problem is to use, depending on the small / large font setting, two different dialog templates.. YUCK... i don't know any better solution (other than banning the LARGE fonts).. so i would be pleased if anybody knew a better workaround.. Bernhard "The remarkable thing about my mother is that for thirty years she served us nothing but leftovers. The original meal has never been found." Calvin Trillin

      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