Greetings. First of all, thanks for this great library! I am using it and found some features that I would have a use for.
One of them is processing tildes: If you generate a barcode with the message "H~101llo world", the tilde and the following three digits are replaced with their ascii code, resulting in "Hello world".
I have already implemented this feature as it's not a lot of work to do and applied the following changes to the source:
- Added the variable protected boolean processTilde with the default value false, as well as a getter and a setter.
- Added in
public void startBarcode(String msg, String formattedMsg)
formattedMsg = MessagePatternUtil.processTilde(formattedMsg);
at the beginning.
MessagePatternUtil.java (Thought it wouldn't be bad to put it here)
- Added the method public static String processTilde( String msg ). (See attachement)
And when already talking about this I've got a question:
In DefaultCanvasLogicHandler - startBarcode(String,String) you make:
BarcodeDimension dim = bcBean.calcDimensions(msg);
x = getStartX();
Shouldn't this actually be done with the formatted message (this.formattedMsg)?
Have a nice day,