I am having a strange issue with Arial font when the size is set to 10 or 12.
If the code text is more than 9 characters the last character does not show in the displayed text.
So the value 12312312345 will display 1231231234 but the bar code is encoded with the full text.
If I set the font size to any other value it displays correctly.
I am applying the license we purchased so it is not an evaluation issue.
Here is my code:
Font font = new Font("Arial", Font.PLAIN, 12);
BarCodeBuilder builder = new BarCodeBuilder();
builder.setSymbologyType(Symbology.Code128);
builder.setCodeText("12312312345");
builder.setCodeLocation(CodeLocation.Below);
builder.getCaptionAbove().setTextAlign(StringAlignment.Center);
builder.setCodeTextFont(font);
builder.getCaptionBelow().setVisible(true);
FileOutputStream fos = new FileOutputStream(new File("c:/testCodes//testDisplay.png"));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
builder.save(baos, BarCodeImageFormat.Png);
baos.writeTo(fos);
I also tried setting the font by using builder.getCaptionBelow().setFont(font) but that ignores the font all together.
This is a common font setting that will be used in our application so this issue will need to be resolved.
We are using the Java Bar code library.
Thank you
Fred