diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Font.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Font.java index bfc17a166ed..731a16d7f48 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Font.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Font.java @@ -105,6 +105,7 @@ public Font(Device device, FontData fd) { this.zoom = DPIUtil.getNativeDeviceZoom(); this.fontData = new FontData(fd); this.fontHeight = fd.height; + this.handle = SWTFontProvider.getFontHandle(this, this.zoom); init(); } @@ -153,6 +154,7 @@ public Font(Device device, FontData[] fds) { FontData fd = fds[0]; this.fontData = new FontData(fd); this.fontHeight = fd.height; + this.handle = SWTFontProvider.getFontHandle(this, this.zoom); init(); } @@ -186,9 +188,15 @@ public Font(Device device, String name, int height, int style) { this.zoom = DPIUtil.getNativeDeviceZoom(); this.fontData = new FontData (name, height, style); this.fontHeight = height; + this.handle = SWTFontProvider.getFontHandle(this, this.zoom); init(); } +@Override +void init() { + super.init(); +} + @Override void destroy() { OS.DeleteObject(handle); @@ -402,9 +410,6 @@ public static Font win32_new(Device device, FontData fontData, int zoom) { * @since 3.126 */ public static Font win32_new(Font font, int targetZoom) { - if (targetZoom == font.zoom) { - return font; - } return SWTFontProvider.getFont(font.getDevice(), font.getFontData()[0], targetZoom); } }