Hacker News new | past | comments | ask | show | jobs | submit login

Code 128 has a mode where it can encode 2 digits for every code. It's probably related to that somehow.



I just had a closer look and yes that's definitely the problem. Fonts require a 1:1 mapping between characters and outputs, there's no way to choose an output based on 2 consecutive digits so it needs to be mapped to an arbitrary character. If you scanned the resulting barcode I'm sure you'd see that it works just fine.


> Fonts require a 1:1 mapping between characters and outputs, there's no way to choose an output based on 2 consecutive digits

IIRC ligatures break this constraint - that's how coding fonts get fancy glyphs for "==", "===", "=>" and so on.


Good point, but that's probably too much work for a free font. Especially since you need to output a code to mode switch before you can use the 2-digit barcodes, the font won't have any way of knowing what mode you're in.


The free Fira Code [0] has them.

I don't have the knowledge to respond to your second point.

[0] https://github.com/tonsky/FiraCode




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: