PlanetSquires Forums

Support Forums => José Roca Software => Topic started by: James Fuller on June 21, 2016, 12:14:56 PM

Title: Font DPI
Post by: James Fuller on June 21, 2016, 12:14:56 PM
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
Title: Re: Font DPI
Post by: James Fuller on June 21, 2016, 12:21:31 PM
Duh...
I really should wait a bit before posting questions I am working on :) !!
James


Dim As CWindow pWindow
Dim As HFONT hInfoFont = AfxCreateFont("Tahoma",12,pWindow.DPI)

Title: Re: Font DPI
Post by: José Roca on June 21, 2016, 12:36:15 PM
You can also use

Dim As HFONT hInfoFont = pWindow.CreateFont("Tahoma",12)
Title: Re: Font DPI
Post by: José Roca on June 21, 2016, 12:42: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.