-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for rendering top bar/bearer bars #199
base: master
Are you sure you want to change the base?
Conversation
@@ -38,8 +37,11 @@ public static SKImage Label_ITF14(Barcode barcode, SKBitmap img) | |||
pen.ColorF = barcode.ForeColor; | |||
pen.StrokeWidth = (float)img.Height / 16; | |||
|
|||
canvas.DrawLine(new SKPoint(0, backY - pen.StrokeWidth / 2f), | |||
new SKPoint(img.Width, backY - pen.StrokeWidth / 2f), pen); //bottom | |||
if (barcode.BearerBarsMode != BearerBarsMode.Disabled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these bearer bars only apply to ITF-14 barcodes I would expect them to be configured only for that type somehow. As if you configure them for other types they wont apply.
frames/bearers are used as part of the spec or allowed for several types of barcode. Some recommend them and none actively forbid them (though some do mention it should always be wider than the widest bar distance). And they're even used in several 2D barcodes (Beetag, Color Code, Cronto Visual, HCCB) and allowed around many others. The only thing I can't confirm being widely used or allowed is the horizontal top bar, but I can imagine that being a useful way to delineate the area a scanner actually looks at. In effect we've seen shipping labels with horizontal lines on them be less prone to scanning the wrong code if several are in the frame. |
Top/Bottom bars are not for scanning - they're used during printing on thermal printers. If after printing the bar is not continous that means that the print head has some dirt on and needs to be cleaned or it has some dead dots and needs to be replaced. We use it extensively in food industry as it provides a quick check for the staff if the print head is ok. That also means they're useful on almost any 1D code. |
This PR adds support for including top bar when rendering barcodes and configurable bearer bar mode for ITF-14.
Top-bar off (default)
Top bar enabled
ITF-14 Bearer mode: frame (default)
ITF-14 Bearer mode: bearer bars
ITF-14 Bearer mode: disabled