Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
Loading