You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix issues with High DPI support on Windows (#358).
Both main process and subprocesses are now set to be DPI aware
when cef.DpiAware.EnableHighDpiSupport function is called.
- Update docs/MigrationGuide.md document.
- Update examples/wxpython.py
- Add DpiAware.EnableHighDpiSupport function.
- Deprecate DpiAware.SetProcessDpiAware function.
- Deprecate ApplicationSettings.auto_zooming "system_dpi" value
Copy file name to clipboardExpand all lines: api/ApplicationSettings.md
+6-3
Original file line number
Diff line number
Diff line change
@@ -84,14 +84,17 @@ all processes.
84
84
### auto_zooming
85
85
86
86
(string)
87
-
Windows only. Perform automatic zooming of browser contents. Example values for auto_zooming (numeric value means a zoom level):
87
+
Windows only. Perform automatic zooming of browser contents. Example
88
+
values for auto_zooming (numeric value means a zoom level):
88
89
89
-
* "system_dpi" - use system DPI settings, see the [DpiAware](DpiAware.md) wiki page for more details.
90
+
* "" - default is empty string
90
91
* "0.0" (96 DPI)
91
92
* "1.0" (120 DPI)
92
93
* "2.0" (144 DPI)
93
94
* "-1.0" (72 DPI)
94
-
* "" - if cefpython detects that application is DPI aware it will automatically set `auto_zooming` to "system_dpi". If you do not wish such behavior set `auto_zooming` to an empty string. See the [DpiAware](DpiAware.md) wiki page for more details on that.
95
+
* "system_dpi" - Deprecated. Use system DPI settings. This value is
96
+
deprecated, as it is no more required to set auto_zooming to this
97
+
value after High DPI support was enabled.
95
98
96
99
Example values that can be set in Win7 DPI settings (Control Panel Appearance and Personalization Display):
Copy file name to clipboardExpand all lines: api/DpiAware.md
+24-9
Original file line number
Diff line number
Diff line change
@@ -12,23 +12,19 @@ Table of contents:
12
12
*[Introduction](#introduction)
13
13
*[Static methods](#static-methods)
14
14
*[CalculateWindowSize](#calculatewindowsize)
15
+
*[EnableHighDpiSupport](#enablehighdpisupport)
15
16
*[GetSystemDpi](#getsystemdpi)
16
17
*[IsProcessDpiAware](#isprocessdpiaware)
17
18
*[SetProcessDpiAware](#setprocessdpiaware)
18
19
19
20
20
-
## Introduction
21
-
22
-
By default if DPI awareness is not enabled in application, then OS performs display scaling. That causes text to look fuzzy on high DPI displays. The solution is to enable DPI awareness and use the ApplicationSettings.`auto_zooming` option. High DPI support is available only on Windows.
23
-
24
-
Enabling High DPI support in app can be done by embedding a DPI awareness xml manifest in executable (see [Issue #112](../issues/112) comment #2), or by calling the `DpiAware.SetProcessDpiAware` method. Embedding xml manifest is the most reliable method. There is also an another way by writing registry key, but we won't discuss this method here.
25
-
26
-
The downside of calling `SetProcessDpiAware` is that scrollbar in CEF browser is very small. This is because DPI awareness was set too late, after executable and the CEF dll was loaded. To fix that embed DPI awareness xml manifest in the .exe file.
27
21
28
-
Additionally you have to set the ApplicationSettings.`auto_zomming` option to "system_dpi". This will cause browser content to be zoomed automatically using system DPI settings. On Win7 these can be set in: Control Panel > Appearance and Personalization > Display.
22
+
## Introduction
29
23
30
-
When cefpyhon detects that application is DPI aware, it will automatically set ApplicationSettings."auto_zooming" to "system_dpi". User can manually enable DPI awareness in application by going to .exe properties > Compatibility tab > and checking the box labeled "Disable display scaling on high DPI settings". If you wish to not enable auto zooming in such case then set "auto_zooming" to an empty string.
24
+
By default if DPI awareness is not enabled in application, then OS performs display scaling. That causes text to look blurry on high DPI displays. To resolve this you have to
25
+
call `cef.DpiAware.EnableHighDpiSupport` method. High DPI support is available only on Windows.
31
26
27
+
Enabling High DPI support in app can be done by embedding a DPI awareness xml manifest in both main executable and subprocess executable (see [Issue #112](../issues/112) comment #2), or by calling the `cef.DpiAware.EnableHighDpiSupport` method.
32
28
33
29
## Static methods
34
30
@@ -49,6 +45,21 @@ Calculation for DPI < 96 is not yet supported. Use
49
45
the `GetSystemDpi` method for that.
50
46
51
47
48
+
### EnableHighDpiSupport
49
+
50
+
|||
51
+
| --- | --- |
52
+
|__Return__| void |
53
+
54
+
Calling this function will set current process and subprocesses
55
+
to be DPI aware.
56
+
57
+
Description from upstream CEF:
58
+
> Call during process startup to enable High-DPI support on Windows 7 or newer.
59
+
> Older versions of Windows should be left DPI-unaware because they do not
60
+
> support DirectWrite and GDI fonts are kerned very badly.
61
+
62
+
52
63
### GetSystemDpi
53
64
54
65
|||
@@ -90,4 +101,8 @@ On Win8 this will return True if DPI awareness is set to either "System DPI awar
90
101
| --- | --- |
91
102
|__Return__| void |
92
103
104
+
Calling this method is deprecated, call instead `EnableHighDpiSupport()`.
105
+
See [Issue #358](../../../issues/358) for how the behavior changed in
106
+
latest CEF. This method now internally calls `EnableHighDpiSupport()`.
107
+
93
108
Enables DPI awareness for the running process. Embedding a DPI manifest in .exe is the prefered way, as it gives more reliable results, otherwise some display bugs may appear (discussed in the "Introduction" section on this page).
0 commit comments