Skip to content

Commit e8d4fd5

Browse files
committed
use Font.deriveFont()
1 parent 3c7f365 commit e8d4fd5

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

visualvm/charts/src/org/graalvm/visualvm/charts/xy/SimpleXYChartUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,11 @@ public static String formatTime(long timestamp, long startTime, long endTime) {
569569
}
570570

571571
public static Font smallerFont(Font font) {
572-
return new Font(font.getName(), font.getStyle(), font.getSize() - 2);
572+
return font.deriveFont((float)font.getSize() - 2);
573573
}
574574

575575
public static Font boldFont(Font font) {
576-
return new Font(font.getName(), Font.BOLD, font.getSize());
576+
return font.deriveFont(Font.BOLD);
577577
}
578578

579579

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/charts/xy/ProfilerXYTooltipPainter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private void initComponents() {
239239

240240

241241
private static Font smallerFont(Font font) {
242-
return new Font(font.getName(), font.getStyle(), font.getSize() - 2);
242+
return font.deriveFont((float)font.getSize() - 2);
243243
}
244244

245245
}

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/components/table/LabelBracketTableCellRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public Dimension getPreferredSize() {
7272
};
7373

7474
Font f = label2.getFont();
75-
label2.setFont(new Font(f.getName(), f.getStyle(), f.getSize() - 1));
75+
label2.setFont(f.deriveFont((float)f.getSize() - 1));
7676

7777
setLayout(new BorderLayout());
7878

visualvm/libs.profiler/profiler.snaptracer/src/org/graalvm/visualvm/lib/profiler/snaptracer/impl/swing/LegendFont.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public LegendFont() {
4848

4949
private static Font baseFont() {
5050
Font font = new JLabel().getFont();
51-
return new Font(font.getName(), font.getStyle(), font.getSize() - 2);
51+
return font.deriveFont((float)font.getSize() - 2);
5252
}
5353

5454
}

0 commit comments

Comments
 (0)