G’day
I recently loaded PAC Project 10.3 onto a new development laptop that came bundled with Windows 11. Spent most of the week coding in PAC Control with no issues whatsoever. Finally went to start on some PAC Display tasks and found the following annoying display glitch with the Edit Graphic Dynamic Attributes dialog box:
Firstly noted the font looked a bit suss but then noticed the Tag selection box (and the little question mark button used to open it) had been pushed into unreachable territory off the right edge of the fixed-size dialog box. Didn’t find any useful solutions on the web so I ran DisplayC.pro.exe through a .exe resource decompiler to look for clues on what was messing things up.
Solution 1: Resize the Graphic Dynamic Attributes dialog box and recompile DisplayC.pro.exe: Not ideal but this at least gained some space and allowed me to get at the tag selection window. Added 100px width to the main DialogEx Box object so it was 568px(W) wide instead of 468px(W). Then added 100px to the embedded Dialog Box that holds the various attributes that can be edited taking it from 122px(W) to 222px(W). Perhaps enabling resize on this dialog box would be an easy fix in the next version of PAC Config.
Then looking closer at the fonts and styles it looks like the main GraphicDynamicAttributesDlg object uses DS_SHELLFONT style with the standard “MS Shell Dlg” logical-font which Windows 11 has assigned to “Microsoft Sans Serif” in the Windows Registry. This font displays correctly in all areas outside the green box shown below:
The area inside the green box is the embedded Button Control containing each of the editable controls for the individual attributes in the dropdown lists on the left. Looking further through each of these resource files, each of their respective Dialog Boxes are set to style DS_SETFONT with font either set to “Helv” or “MS Sans Serif”. All of these items do not display correctly and have the dodgy font that pushes everything outside the window.
Solution 2: Edit the Operating System Logical Font allocations in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes holds the following assignments by default on this Windows 11 build:
“Helv” = “MS Sans Serif” … [doesn’t display correctly]
“MS Shell Dlg” = “Microsoft Sans Serif” … [does display correctly]
Simply change the value assigned to the “Helv” registry entry to be “Microsoft Sans Serif” instead of “MS Sans Serif”, reboot and all is well and the fonts are displayed correctly throughout the whole GraphicDynamicAttribute popup. MS Sans Serif seems to be the problem.
Before Registry Change:
After Registry Change:
I don’t know enough about Windows API programming so I may be talking complete BS but I am guessing that it is some legacy thing from old versions of Windows and early Factory Floor etc where MS Sans Serif is bitmap based and Microsoft Sans Serif is a scalable true type. Also not sure why this was never an issue on my other Windows 10 machines either as the registry entries are the same. Could this be a strange setting that has only emerged in Windows 11 because I have my Windows language set to English (Australia) instead of English (US) and Windows 11 is handling unicode fonts differently?
Anyone got any better solutions to this? If not, is this something that the team at Opto have encountered during Windows 11 testing?
Edit: I have also tried PAC Project Professional 10.4 and the most recent 10.5 builds and they give the same results. Preference to stay with 10.3 for now as it is tried and true with currently deployed assets.
Cheers
Sean