No, not conflicting...
Fred has clearly stated how to get the 5.71 behavior back, which seems to be what you want.
Sure it uses GetStockObject(), that's probably how PB has done it for 15+ years. GetStockObject() is still there, still available to you, even if Microsoft advises a newer method.
Font Problem with 5.72
-
- Addict
- Posts: 4527
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Font Problem with 5.72
Of course such a change that affects most of our GUI programs on Windows has to be documented in the Help, in the "History" section as well as in the "Migrating from an old version of PureBasic" section.infratec wrote:Such a change can be done from 5.xx to 6.xx but not from 5.71 to 5.72 and with no 'official' information about this. (my opinion)
Last edited by Little John on Tue Apr 07, 2020 6:23 am, edited 1 time in total.
Re: Font Problem with 5.72
Hi Bernd
Run the next snippet using PB 5.71 to get the default font name and size then use it with PB 5.72 as you did
Run the next snippet using PB 5.71 to get the default font name and size then use it with PB 5.72 as you did
Code: Select all
fID = GetGadgetFont(#PB_Default)
fnt.LOGFONT
GetObject_(fID,SizeOf(fnt),@fnt)
fname$ = PeekS(@fnt\lfFaceName)
fsize = Int(Round((-fnt\lfHeight * 72 / GetDeviceCaps_(GetDC_(0),#LOGPIXELSY)),1))
Debug fname$
Debug fsize
Egypt my love
Re: Font Problem with 5.72
@Rashad
I didn't know that "MS Shell Dlg" is a font.
Strange is that
Results in the same result as
I didn't know that "MS Shell Dlg" is a font.
Strange is that
Code: Select all
LoadFont(#PB_Any, "MS Shell Dlg", 9)
Code: Select all
LoadFont(#PB_Any, "Microsoft Sans Serif", 8)
Re: Font Problem with 5.72
I am glad it helps
At least you do not have to do trial and test to get the proper font size
Beside you do not have to mess with Windows NONCLIENTMETRICS
Be safe
At least you do not have to do trial and test to get the proper font size
Beside you do not have to mess with Windows NONCLIENTMETRICS
Be safe
Egypt my love
Re: Font Problem with 5.72
from Windows SDK 7:infratec wrote:I didn't know that "MS Shell Dlg" is a font.
Font Mapping on Windows 2000, Windows XP, Windows Server 2003, Windows Vista and Windows 7
Both logical fonts map to Unicode-based TrueType fonts. MS Shell Dlg uses Microsoft Sans Serif (distinct from MS Sans Serif) if the install language is not Japanese. MS Shell Dlg maps to MS UI Gothic if the install language is Japanese.
On Windows XP MUI systems, MS Shell Dlg maps to MS UI Gothic only when the system locale and UI language are set to Japanese. Otherwise, MS Shell Dlg maps to Microsoft Sans Serif.
On Windows Vista and Windows 7, MS Shell Dlg maps to MS UI Gothic if the machine default UI language is set to Japanese (regardless of the install language). MS Shell Dlg maps to Microsoft Sans Serif if the machine default UI language is set to a language other than Japanese.
MS Shell Dlg 2 simply uses the Tahoma font regardless of language. The main advantage of Tahoma over Microsoft Sans Serif is that Tahoma has a native bold font face. Its main disadvantage is that older operating systems might not have it installed, and might substitute a less attractive font.
Characters that are not implemented in Tahoma or Microsoft Sans Serif are available through font linking.
Applications can use either Microsoft Sans Serif or Tahoma explicitly, and save the level of indirection involved in using MS Shell Dlg or MS Shell Dlg 2. Because of font linking, specifying Microsoft Sans Serif or Tahoma provides appropriate glyphs for all languages.
Re: Font Problem with 5.72
Yes, PB was using GetStockObject() to get the default font which wasn't compatiable with DPI and deprecated by MS. That was it was changed, I agree should be officially documented as it slightly modify the requiered gadget size.