Steps to reproduce: run the command below under X and in terminal:
java -jar barbecue-1.5-alpha3.jar -e code128 -b "0941919600001012004000001" -o test.png
Under X I have a text under barcode, in terminal mode - no. I've tried both 1.1 and 1.5-alpha3 versions.
Logged In: YES
user_id=156581
Originator: NO
What JVM are you using? Which version? Which OS? Which OS version?
Logged In: YES
user_id=1016645
Originator: YES
JVM version: Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
OS: ASPLinux 11 (Fedora 4 based)
uname: Linux ws196.ltsp 2.6.18-1.2239.0.112aspsmp #1 SMP Tue Nov 14 21:02:14 EET 2006 i686 i686 i386 GNU/Linux
X Windows rpm: xorg-x11-6.9.0-1.112.12asp
Logged In: YES
user_id=156581
Originator: NO
add this to your command line: -Djava.awt.headless=true
Logged In: YES
user_id=1016645
Originator: YES
With -Djava.awt.headless=true option both in terminal and in X there is no text under barcode.
Logged In: YES
user_id=2092665
Originator: NO
I have the same trouble.
Looking at the code, the main problems is in the Barcode.java and SizingOutput.java classes.
The SizingOutput class gives the height calculation for the text: it does a hard assumption "if the font or fontmetrics are null returns 0 as text height".
The Barcode class demand it's own size (all the Jcomponent size methods) to the "getActualSize()" method, which is a proxy to "calculateSize()".
This last method is the problem, because it instantiate the SizingOutput class directly and these 2 methods are private, so i cannot override them to use another class to calculate Sizing.
This is also the point where the "headless" property goes in action.
I suggest to modify the "getActualSize()" and "calculateSize()" methods so they will get the "sizer class" from outside (maybe a public property, mantaining a default if not set), and to make them protected instead of private in order to make different calculation types.
Same problem here. Java 1.6 on Ubuntu 10.10