Skip to content
Merged
Show file tree
Hide file tree
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 @@ -5015,8 +5015,7 @@ private class SetFontOperation extends Operation {
private final Font font;

SetFontOperation(Font font) {
this.font = new Font(font.getDevice(), font.getFontData());
registerForDisposal(this.font);
this.font = font != null ? SWTFontProvider.getFont(font.getDevice(), font.getFontData()[0], data.nativeZoom) : null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,9 @@ public void test_setClippingLorg_eclipse_swt_graphics_Rectangle() {

@Test
public void test_setFontLorg_eclipse_swt_graphics_Font() {
gc.setFont(null);
assertEquals(shell.getDisplay().getSystemFont(), gc.getFont());

gc.setFont(shell.getDisplay().getSystemFont());
Font font = gc.getFont();
assertEquals(shell.getDisplay().getSystemFont(), font);
Expand Down
Loading