|
|
@ -102,7 +102,7 @@ public class BarcodeUtils { |
|
|
|
Graphics2D g = outImage.createGraphics(); |
|
|
|
g.drawImage(image, 0, 0, imageW, imageH, null); |
|
|
|
g.setColor(QRCOLOR); |
|
|
|
g.setFont(new Font("微软雅黑", Font.BOLD, FONTSIZE)); |
|
|
|
// g.setFont(new Font("微软雅黑", Font.BOLD, FONTSIZE));
|
|
|
|
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); |
|
|
|
g.setBackground(Color.white); |
|
|
|
// 获取文字数量 按照字节展示
|
|
|
@ -153,7 +153,7 @@ public class BarcodeUtils { |
|
|
|
|
|
|
|
|
|
|
|
private static String outStringByByte(String str, int len) throws IOException { |
|
|
|
byte[] btf = str.getBytes("gbk"); |
|
|
|
byte[] btf = str.getBytes("GBK"); |
|
|
|
int count = 0; |
|
|
|
|
|
|
|
for (int j = len - 1; j >= 0; j--) { |
|
|
@ -165,9 +165,9 @@ public class BarcodeUtils { |
|
|
|
} |
|
|
|
|
|
|
|
if (count % 2 == 0) { |
|
|
|
return new String(btf, 0, len, "gbk"); |
|
|
|
return new String(btf, 0, len, "GBK"); |
|
|
|
} else { |
|
|
|
return new String(btf, 0, len - 1, "gbk"); |
|
|
|
return new String(btf, 0, len - 1, "GBK"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|