jneug / typst-codetastic

Generate barcodes and 2d codes in Typst documents.
MIT License
14 stars 1 forks source link

Use of CeTZ vs using an external lib like Zint? #1

Open ramkumarkb opened 1 year ago

ramkumarkb commented 1 year ago

Hi,

First of all - thank you for the Barcode package - this is a feature that is requested by many others.

Please see my own discussions related to it here - https://github.com/typst/typst/discussions/1643

Barcode generation is a very important feature for batch usecases - where in one has to generate 100s of letters with a barcode on every page - that is read by an automatic enveloping machine.

Did you consider Zint - https://github.com/zint/zint ?

Or may be you can guide me on extending the package to add more types of barcodes - each barcode type will have its own typ file implementation? Can one look at the C code of Zint and re-create it in CeTZ - example -

https://github.com/zint/zint/blob/master/backend/gs1.c

Thank you again 🙏 !

jneug commented 1 year ago

Maybe I will add some more codes in the future, but the first updates will focus on speed improvements.

But I don't think this library will have a long life, since with the new plugin capabilities of Typst 0.8.0 someone probably will create a package that interfaces with an existing solution.

Enter-tainer commented 1 year ago

Hi, is it possible to use https://docs.rs/qrcode/latest/qrcode/struct.QrCode.html and https://github.com/buntine/barcoders and compile them to wasm to re-implement the core logic of this package? I'd like to offer help if this is desired.

jneug commented 1 year ago

To be frank, I have no idea how all this wasm stuff and the whole plugin system works.

But if you can provide a proof-of-concept I would certainly be willing to integrate it into the package. As stated above, I don't see a future with this package written in native Typst.

I would probably not be able to maintain it going forward, though.

Enter-tainer commented 1 year ago

okay i'll try to do it but maybe in a new package rather than pr it to here. But to be honest this package is really cool. I cannot even imagine scripting in typst can achieve such complicate tasks!

Enter-tainer commented 1 year ago

I just tried barcoders and it doesn't produce numbers under bar codes. So I think at least for barcodes, this package is still indispensable.

Enter-tainer commented 1 year ago

When generating svg, zint can only a) print to stdout b) print to a file. You cannot even get an SVG string! But I can verify that it do compiles to wasm32-wasi

Enter-tainer commented 12 months ago

https://github.com/typst/packages/tree/main/packages/preview/tiaoma/0.1.0 I've finish my work to compile zint to wasm. And it is publish in typst/packges as tiaoma