@@ -67,7 +67,7 @@ public final class Font extends Resource {
6767 */
6868Font (Device device ) {
6969 super (device );
70- this .zoom = extractZoom ( this . device );
70+ this .zoom = DPIUtil . getNativeDeviceZoom ( );
7171 this .fontHeight = 0 ;
7272}
7373
@@ -100,7 +100,7 @@ private Font(Device device, long handle, int zoom) {
100100 */
101101public Font (Device device , FontData fd ) {
102102 super (device );
103- this .zoom = extractZoom ( this . device );
103+ this .zoom = DPIUtil . getNativeDeviceZoom ( );
104104 init (fd );
105105 this .fontHeight = fd .height ;
106106 init ();
@@ -146,7 +146,7 @@ public Font(Device device, FontData[] fds) {
146146 for (FontData fd : fds ) {
147147 if (fd == null ) SWT .error (SWT .ERROR_INVALID_ARGUMENT );
148148 }
149- this .zoom = extractZoom ( this . device );
149+ this .zoom = DPIUtil . getNativeDeviceZoom ( );
150150 FontData fd = fds [0 ];
151151 init (fds [0 ]);
152152 this .fontHeight = fd .height ;
@@ -180,7 +180,7 @@ public Font(Device device, FontData[] fds) {
180180public Font (Device device , String name , int height , int style ) {
181181 super (device );
182182 if (name == null ) SWT .error (SWT .ERROR_NULL_ARGUMENT );
183- this .zoom = extractZoom ( this . device );
183+ this .zoom = DPIUtil . getNativeDeviceZoom ( );
184184 init (new FontData (name , height , style ));
185185 this .fontHeight = height ;
186186 init ();
@@ -189,7 +189,7 @@ public Font(Device device, String name, int height, int style) {
189189/*public*/ Font (Device device , String name , float height , int style ) {
190190 super (device );
191191 if (name == null ) SWT .error (SWT .ERROR_NULL_ARGUMENT );
192- this .zoom = extractZoom ( this . device );
192+ this .zoom = DPIUtil . getNativeDeviceZoom ( );
193193 init (new FontData (name , height , style ));
194194 this .fontHeight = height ;
195195 init ();
@@ -294,13 +294,6 @@ public String toString () {
294294 return "Font {" + handle + "}" ;
295295}
296296
297- private static int extractZoom (Device device ) {
298- if (device == null ) {
299- return DPIUtil .getNativeDeviceZoom ();
300- }
301- return device .getDeviceZoom ();
302- }
303-
304297/**
305298 * Invokes platform specific functionality to allocate a new font.
306299 * <p>
@@ -318,7 +311,7 @@ private static int extractZoom(Device device) {
318311 * @noreference This method is not intended to be referenced by clients.
319312 */
320313public static Font win32_new (Device device , long handle ) {
321- int zoom = extractZoom ( device );
314+ int zoom = DPIUtil . getNativeDeviceZoom ( );
322315 return win32_new (device , handle , zoom );
323316}
324317
0 commit comments