因此,我尝试通过绘制BufferedImage中的Graphics2D对象,然后使用ImageIO.write()将其写入文件来创建用于通用目的的标签。不幸的是,我遇到了一个问题,我无法弄清楚如何使字体的质量不被模糊和#39; (我无法想到英文中的单词,边缘有点切割或锯齿状,有点表示我认为渲染分辨率低)。有没有办法设置它,以便字体呈现在某个DPI /质量/分辨率?
/**
*
* @param data Array of Strings passed into label, where data[0] is the string to be barcoded
* @param titles Array of Strings passed into label parallel to data array, containing appropriate titles
* @throws IOException If
* @throws WriterException
*/
public static File createSeedBag(String[] titles,String[] data, Font[] fonts) throws IOException, WriterException{
/**
* TODO: Array of Fonts to customize Font
* Size customization
*/
BufferedImage theLabel;
BufferedImage theBarcode;
Graphics2D theGraphics;
File imageFile,
theFile;<