How to create barcodes using fonts with Rust?
Rust Programming Language
Rust is a programming language designed by Graydon Hoare at Mozilla Research for building reliable and efficient software. It has been the "most loved programming language" in the Stack Overflow Developer Survey for many years since 2016.
Command Line (CLI)
This tutorial illustrates how to compile a CLI (Command Line) tool that encodes input data and generates barcode characters that when applied with a barcode font provides you barcodes of the highest quality that meet the strictest requirements of the auto-id industry.
GitHub RepositoryPrerequisites
- Install Rust - https://www.rust-lang.org/tools/install
- Install Free Barcode Fonts (Windows / Mac / Linux)
cargo install barcode_command
2. Encode a Code 39 barcode with a check digit.
./barcode_command code39 "12345678" 1
3. Copy the output to Word, Pages, OpenOffice Writer or any other graphics application.
4. Select the output characters and apply the CCode39.ttf (ConnectCode39.ttf) barcode font. Set the font size to 24. You now have a barcode (sample Word document) that complies to the strictest requirements of the auto-id industry.
Command Line Documentation
Code 39./barcode_command code39 "12345678" 1
1 - Check Digit On
0 - Check Digit Off
Font Name - CCode39 (ConnectCode39.ttf)
Font Size - 24 (or above)
Industrial 2 of 5
./barcode_command industrial2of5 "12345678" 1
1 - Check Digit On
0 - Check Digit Off
Font Name - CCodeIND35 (ConnectCodeIndustrial2of5.ttf)
Font Size - 24 (or above)
POSTNET
./barcode_command postnet "12345678"
Font Name - CCodePostnet (ConnectCodePostnet.ttf)
Font Size - 9