Using org.jfree.chart.StandardChartTheme
offers some consistency in using font's. Just create your Font
, specify the desired font(s) in a ChartTheme
, and ask ChartFactory
to apply the new theme for you when creating new charts. Do something like this (untested) fragment:
Font font = Font.createFont(Font.TRUETYPE_FONT, new File("geogtqrg.ttf"));
StandardChartTheme chartTheme = new StandardChartTheme("GeoTheme");
chartTheme.setExtraLargeFont(font.deriveFont(24f));
chartTheme.setLargeFont(font.deriveFont(16f));
chartTheme.setRegularFont(font.deriveFont(12f));
chartTheme.setSmallFont(font.deriveFont(10f));
ChartFactory.setChartTheme(chartTheme);