我使用jfreechart为显示器生成一个拨号图像,上面有三种不同的字体.

不知道你正在寻找哪一个,所以我将概述每一个.只看我生成这个的代码(它是在groovy中)这里的每个程序:
使用main类JFreeChart的方法setTitle(java.awt.Font font)方法.可以在构造函数中调整字体大小.
// Set the title font to bold SansSerif size 12.
JFreeChart chart = new JFreeChart(myplot);
chart.setTitle(
new org.jfree.chart.title.TextTitle("The title",
new java.awt.Font("SansSerif", java.awt.Font.BOLD, 12)
);
);
Run Code Online (Sandbox Code Playgroud)
// Set the annotation font to bold Dialog size 8
DialTextAnnotation annotation = new DialTextAnnotation("My Annotation Text");
annotation.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 8));
// Add to the plot
myplot.addLayer(annotation);
Run Code Online (Sandbox Code Playgroud)
// Create the dial scale
StandardDialScale scale = new StandardDialScale(.......
// Set the dial font to plain dialog size 14
scale.setTickLabelFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 14));
Run Code Online (Sandbox Code Playgroud)