PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Font DPI  (Read 1061 times)

James Fuller

  • Senior Member
  • ***
  • Posts: 281
  • FF3 User
Font DPI
« on: June 21, 2016, 11:44:56 AM »

Jose,
  How does one create a dpi aware font?
The 3rd parameter of AfxCreateFont defaults to 96 according to the help file.
How do I create a font compatible with the actual dpi setting of the host.
I could not find a AfxGetDPI function which appears to be what I need???

James
Logged

James Fuller

  • Senior Member
  • ***
  • Posts: 281
  • FF3 User
Re: Font DPI
« Reply #1 on: June 21, 2016, 11:51:31 AM »

Duh...
I really should wait a bit before posting questions I am working on :) !!
James

Code: [Select]
Dim As CWindow pWindow
Dim As HFONT hInfoFont = AfxCreateFont("Tahoma",12,pWindow.DPI)
Logged

Josť Roca

  • Moderator
  • Guru Member
  • *****
  • Posts: 3171
Re: Font DPI
« Reply #2 on: June 21, 2016, 12:06:15 PM »

You can also use

Dim As HFONT hInfoFont = pWindow.CreateFont("Tahoma",12)

Josť Roca

  • Moderator
  • Guru Member
  • *****
  • Posts: 3171
Re: Font DPI
« Reply #3 on: June 21, 2016, 12:12:07 PM »

> I could not find a AfxGetDPI function which appears to be what I need???

If you aren't using CWindow, you can use AfxLogPixelsX and or AfxLogPixelsY.