Width of Barcode Display
AndyM48 opened this issue · 4 comments
I have some more questions concerning the principal screen showing the chosen card and barcode. The screen is very nicely presented in two parts: above is the image of the card, and below is the barcode, in a box which is the same width as the card above.
It happens that I only have two types of barcode to display, EAN 13 (13 characters) and Code 128 (19 characters).
So I wonder:
Why is the longer Code 128 code shown in a space which is narrower than the shorter EAN 13 code?
Why is the long, Code 128, number truncated to 17 characters on the display? If I tap the truncated code it is displayed in full in a new window, but in a smaller typeface. Why is it not displayed in full in the principal screen, in a size to fit the space available?
From the top of my head, the basic logic is as follows:
- Draw the barcode text in a big font, using ellipsis if it's too long
- Ask the zxing library to generate the best-fit barcode for the remaining space
So in general zxing should decide how to best use the space and in general it uses it quite well (there are a few tweaks in Catima to override some behaviour).
Based on that info, we get the following question:
Why is the longer Code 128 code shown in a space which is narrower than the shorter EAN 13 code?
Because zxing considers this the most optimal use of the space based on some internal settings. If this is correct, well, we'd need to discuss some actual examples and look at the specs (several barcode formats have specs about how much spacing there needs to be around it and if you manually tweak that you risk breaking some scanners).
Why is the long, Code 128, number truncated to 17 characters on the display? If I tap the truncated code it is displayed in full in a new window, but in a smaller typeface. Why is it not displayed in full in the principal screen, in a size to fit the space available?
It's truncated to 17 characters because more than 17 apparently doesn't fit in the font size. It used to scale automatically based on content size (6e526de) but it seems that was lost in the UI redesign last year (b48de92). Automatically scaling the font size might be worth trying to bring back within a certain range, but we'd have to see how complex it is and if it doesn't act weird with anything else (especially after #1894 got merged)
Thanks for the reply.
I see that you use zxing, which does not seem to be developed any more. It might also explain the slightly unusual layout of the EAN 13 image.
The truncated text is not really a problem, just a bit strange :)
zxing is still being developed
Very good.
I was confused by Project in Maintenance Mode Only
at https://github.com/zxing/zxing