I have a very strange behavior. After CEF libraries are loaded, all the fonts in WHOLE application are decreased. It happened after I have migrated to the newest version of CEF (117.2.5) from version 96.
It is a Windows 32 bit application written and compiled with Delphi 2007. The application is complex, it has a lot of dynamically loaded libraries (BPLs).
The strangest thing is that this happens only on some machines (Win10 Enterprise N and Win10 Professional 64 bit). None of them has Delphi IDE installed, so I can't debug it.
The CEF is loaded with code, run with subprocesses:
sciezkaRoot := IncludeTrailingPathDelimiter(GetRootPath());
sciezkaBinariow := sciezkaRoot + CHROMIUM_FOLDER_BINARIOW;
sciezkaProcesu := sciezkaRoot + CHROMIUM_FOLDER_KOMUNIKACJA_MARKETINGOWA + CHROMIUM_PROCES_EXE;
try
if not FileExists(sciezkaProcesu) then
raise Exception.Create('Brak wymaganego pliku w lokalizacji:' + #13 + sciezkaProcesu);
uCEFApplication.GlobalCEFApp := TCefApplication.Create();
with uCEFApplication.GlobalCEFApp do
begin
ShowMessageDlg := False;
MissingBinariesException := True;
BackgroundColor := ColorToTCefColor(clBtnFace);
Cache := fKatalogCache;
EnablePrintPreview := False;
EnableGPU := False;
FrameworkDirPath := sciezkaBinariow;
ResourcesDirPath := sciezkaBinariow;
LocalesDirPath := sciezkaBinariow + 'locales';
LocalesRequired := 'pl';
Locale := 'pl';
SetCurrentDir := True;
BrowserSubprocessPath := sciezkaProcesu;
Result := StartMainProcess();
end;
except
on e: Exception do
begin
FreeAndNil(uCEFApplication.GlobalCEFApp);
Result := False;
end;
end;
It does not matter if I load any web page or not.
Any ideas what is happening and why?
CEF had some issues about this in recent versions because Chromium sets the Windows process DPI awareness if unset.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">unaware</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
SetProcessDpiAwareness()
with the value PROCESS_DPI_UNAWARE
(that is 0
) before loading the CEF.Read these issues for more information: