@@ -67,7 +67,7 @@ public final class Font extends Resource {
67
67
*/
68
68
Font (Device device ) {
69
69
super (device );
70
- this .zoom = extractZoom ( this . device );
70
+ this .zoom = DPIUtil . getNativeDeviceZoom ( );
71
71
this .fontHeight = 0 ;
72
72
}
73
73
@@ -100,7 +100,7 @@ private Font(Device device, long handle, int zoom) {
100
100
*/
101
101
public Font (Device device , FontData fd ) {
102
102
super (device );
103
- this .zoom = extractZoom ( this . device );
103
+ this .zoom = DPIUtil . getNativeDeviceZoom ( );
104
104
init (fd );
105
105
this .fontHeight = fd .height ;
106
106
init ();
@@ -146,7 +146,7 @@ public Font(Device device, FontData[] fds) {
146
146
for (FontData fd : fds ) {
147
147
if (fd == null ) SWT .error (SWT .ERROR_INVALID_ARGUMENT );
148
148
}
149
- this .zoom = extractZoom ( this . device );
149
+ this .zoom = DPIUtil . getNativeDeviceZoom ( );
150
150
FontData fd = fds [0 ];
151
151
init (fds [0 ]);
152
152
this .fontHeight = fd .height ;
@@ -180,7 +180,7 @@ public Font(Device device, FontData[] fds) {
180
180
public Font (Device device , String name , int height , int style ) {
181
181
super (device );
182
182
if (name == null ) SWT .error (SWT .ERROR_NULL_ARGUMENT );
183
- this .zoom = extractZoom ( this . device );
183
+ this .zoom = DPIUtil . getNativeDeviceZoom ( );
184
184
init (new FontData (name , height , style ));
185
185
this .fontHeight = height ;
186
186
init ();
@@ -189,7 +189,7 @@ public Font(Device device, String name, int height, int style) {
189
189
/*public*/ Font (Device device , String name , float height , int style ) {
190
190
super (device );
191
191
if (name == null ) SWT .error (SWT .ERROR_NULL_ARGUMENT );
192
- this .zoom = extractZoom ( this . device );
192
+ this .zoom = DPIUtil . getNativeDeviceZoom ( );
193
193
init (new FontData (name , height , style ));
194
194
this .fontHeight = height ;
195
195
init ();
@@ -294,13 +294,6 @@ public String toString () {
294
294
return "Font {" + handle + "}" ;
295
295
}
296
296
297
- private static int extractZoom (Device device ) {
298
- if (device == null ) {
299
- return DPIUtil .getNativeDeviceZoom ();
300
- }
301
- return device .getDeviceZoom ();
302
- }
303
-
304
297
/**
305
298
* Invokes platform specific functionality to allocate a new font.
306
299
* <p>
@@ -318,7 +311,7 @@ private static int extractZoom(Device device) {
318
311
* @noreference This method is not intended to be referenced by clients.
319
312
*/
320
313
public static Font win32_new (Device device , long handle ) {
321
- int zoom = extractZoom ( device );
314
+ int zoom = DPIUtil . getNativeDeviceZoom ( );
322
315
return win32_new (device , handle , zoom );
323
316
}
324
317
0 commit comments