graphicore / librebarcode

Libre Barcode: barcode fonts for various barcode standards.
https://graphicore.github.io/librebarcode
SIL Open Font License 1.1
422 stars 25 forks source link

Ability to Render Text on Barcode without space when using switch codes #63

Open dagreatbrendino opened 5 months ago

dagreatbrendino commented 5 months ago

Hi, I am not sure if this is already available, but it would be nice to have the ability to have the display text below the barcode be rendered as a single continuous string rather than separated by a space when using a switch code. This is particularly useful when rendering a barcode that represents a number that has an odd number of characters, since this requires switching code types.

Basically, instead of rendering this Screenshot 2024-03-28 at 1 07 57 PM

Render this Screenshot 2024-03-28 at 1 12 45 PM

graphicore commented 5 months ago

Thanks @dagreatbrendino for the suggestion. I don't think however this possible with current opentype features positioning. It may, but then it likely is a good amount of work to figure out how to do it and rather complex. I currently don't have resources for this. There's a future proposal for WASM-based shaping in Open Type, which would make this feasible, but that will take some time if it ever comes to be. For now, the quickest solution will be to center a separate run of numbers under a barcode without numbers.