### Install go-zpl Library Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Use 'go get' to install the go-zpl library for use in your Go projects. ```bash go get github.com/StirlingMarketingGroup/go-zpl ``` -------------------------------- ### Install go-zpl CLI Tool Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Install the zplrender CLI tool using 'go install' to render ZPL files from the command line. ```bash go install github.com/StirlingMarketingGroup/go-zpl/cmd/zplrender@latest ``` -------------------------------- ### Generated ZPL Output Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md The ZPL code generated by the Quick Start example, showing the structure for label start, printer settings, text, barcode, and QR code. ```text ^XA ^PW812 ^LL1218 ^FO50,50 ^A0N,30,30 ^FDHello, World!^FS ^FO50,150 ^BCN,100,Y,N,N,N^FD123456789^FS ^FO50,300 ^BQN,2,5^FDMA,https://example.com^FS ^XZ ``` -------------------------------- ### Quick Start: Create a ZPL Label Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Demonstrates creating a new ZPL label using the go-zpl library's builder pattern, setting DPI and size, and adding text, a Code 128 barcode, and a QR code. ```go package main import ( "fmt" "github.com/StirlingMarketingGroup/go-zpl" ) func main() { label := zpl.NewLabel(). SetDPI(zpl.DPI203). SetSize(4, 6, zpl.UnitInches). TextField(50, 50, zpl.Font0, 30, 30, "Hello, World!"). Code128(50, 150, "123456789", 100). QRCode(50, 300, "https://example.com", 5) fmt.Println(label) } ``` -------------------------------- ### Rust FFI Bindings for libzpl Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md Example of how to define and use Rust FFI bindings for the `zpl_render_png_simple` and `zpl_free` functions from libzpl. This code demonstrates calling the C functions from Rust and handling the returned data. ```rust #[link(name = "zpl")] extern "C" { fn zpl_render_png_simple( zpl_data: *const c_char, zpl_len: c_int, png_out: *mut *mut c_char, png_len: *mut c_int, ) -> c_int; fn zpl_free(ptr: *mut c_char); } pub fn render_zpl(zpl: &[u8]) -> Result, i32> { let mut png_ptr: *mut c_char = std::ptr::null_mut(); let mut png_len: c_int = 0; let result = unsafe { zpl_render_png_simple( zpl.as_ptr() as *const c_char, zpl.len() as c_int, &mut png_ptr, &mut png_len, ) }; if result != 0 { return Err(result); } let png_data = unsafe { let slice = std::slice::from_raw_parts(png_ptr as *const u8, png_len as usize); let owned = slice.to_vec(); zpl_free(png_ptr); owned }; Ok(png_data) } ``` -------------------------------- ### Quick Start: Render ZPL to PNG Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/rust/zpl-rs/README.md Render a basic ZPL string to PNG bytes and save it to a file. Uses default settings (203 DPI). ```rust use zpl_rs::render; fn main() { let zpl = r# ``` -------------------------------- ### C Example: Render ZPL to PNG and Save to File Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md A basic C program demonstrating how to use `zpl_render_png_simple` to convert ZPL data to a PNG image and save it to a file named `output.png`. It includes necessary headers and error checking. ```c #include "libzpl.h" #include #include int main() { const char* zpl = "^XA^FO50,50^A0N,30,30^FDHello!^FS^XZ"; char* png = NULL; int len = 0; if (zpl_render_png_simple((char*)zpl, strlen(zpl), &png, &len) == 0) { FILE* f = fopen("output.png", "wb"); fwrite(png, 1, len, f); fclose(f); zpl_free(png); } return 0; } ``` -------------------------------- ### Advanced Usage: Render ZPL with Options Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/rust/zpl-rs/README.md Render ZPL with custom options, such as DPI and image size. This example sets 300 DPI and a 4"x6" size. ```rust use zpl_rs::{render_with_options, RenderOptions, Dpi}; let zpl = "^XA^FO50,50^A0N,30,30^FDHello!^FS^XZ"; let options = RenderOptions::new() .dpi(Dpi::Dpi300) .size(1200, 1800); // 4" x 6" at 300 DPI let png_bytes = render_with_options(zpl, &options).expect("Failed to render"); ``` -------------------------------- ### API: Get ZPL as String Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Retrieve the generated ZPL code as a formatted string using the String() method. ```go // Get ZPL as string zplString := label.String() ``` -------------------------------- ### API: Get ZPL as Bytes Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Obtain the generated ZPL code as a byte slice using the Bytes() method. ```go // Get ZPL as bytes zplBytes := label.Bytes() ``` -------------------------------- ### CLI: Show All Options Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Display all available command-line options for the zplrender tool by running it with the '-help' flag. ```bash zplrender -help ``` -------------------------------- ### Open FontForge Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/testdata/FONTFORGE_QUICK_START.md Command to launch the FontForge application. ```bash fontforge ``` -------------------------------- ### Build libzpl for Current Platform Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md Use this command to build the libzpl shared library for the platform you are currently on. The output will be placed in the `../../dist/` directory. ```bash make ``` -------------------------------- ### Render ZPL to PNG Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Create a label object or parse one, then use the renderer to output the label as a PNG file. Requires the render sub-package. ```go import ( "os" "github.com/StirlingMarketingGroup/go-zpl" "github.com/StirlingMarketingGroup/go-zpl/render" ) // Create or parse a label label := zpl.NewLabel(). SetDPI(zpl.DPI203). SetSize(4, 6, zpl.UnitInches). TextField(50, 50, zpl.Font0, 30, 30, "Hello, World!"). QRCode(50, 100, "https://example.com", 5) // Create a renderer renderer := render.New(zpl.DPI203).WithSize(812, 1218) // Render to PNG file f, _ := os.Create("label.png") defer f.Close() renderer.RenderPNG(label, f) ``` -------------------------------- ### Build libzpl for Specific Platform Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md Build libzpl for a specific target operating system. The output file name will indicate the target platform, e.g., `libzpl-linux-amd64.so` or `libzpl.dylib`. ```bash make linux # libzpl-linux-amd64.so ``` ```bash make darwin # libzpl.dylib (universal binary) ``` ```bash make windows # libzpl.dll (requires mingw-w64) ``` -------------------------------- ### API: Low-Level Command Construction Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Construct ZPL commands directly using command objects for fine-grained control over label elements, including text orientation. ```go label.Add(zpl.NewFieldOrigin(100, 200)). Add(zpl.NewScalableFont(zpl.FontE, 50, 40).WithOrientation(zpl.OrientationRotated90)). Add(zpl.NewFieldData("Rotated Text")) ``` -------------------------------- ### Build libzpl for All Platforms Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md This command builds the libzpl shared library for all supported platforms. The compiled libraries will be located in the `../../dist/` directory. ```bash make all ``` -------------------------------- ### Convert and Trace Glyphs with Potrace Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/testdata/FONTFORGE_QUICK_START.md Convert individual PNG glyphs to PBM format and trace them into SVG files for FontForge import. ```bash # Convert to PBM (potrace input format) magick glyph_A.png -threshold 50% glyph_A.pbm # Trace to SVG potrace -s glyph_A.pbm -o glyph_A.svg # Import SVG into FontForge ``` -------------------------------- ### Build with Specific go-zpl Version Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/rust/zpl-rs/README.md Override the automatically downloaded go-zpl version by setting the LIBZPL_VERSION environment variable before building. ```bash LIBZPL_VERSION=0.2.0 cargo build ``` -------------------------------- ### CLI: Output as JPEG Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Change the output image format to JPEG using the '-format' flag with zplrender. ```bash zplrender -format jpeg label.zpl ``` -------------------------------- ### API: Create New Label with Builder Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Initialize a new ZPL label object using the builder pattern. Configure printer DPI and label dimensions. ```go // Create a new label with builder pattern label := zpl.NewLabel(). SetDPI(zpl.DPI203). // Set printer DPI (203, 300, or 600) SetSize(4, 6, zpl.UnitInches) // Set label size ``` -------------------------------- ### API: Marshal ZPL as Text Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Marshal the label object into ZPL text format, returning the ZPL string and any potential error. ```go // Marshal as text text, err := label.MarshalText() ``` -------------------------------- ### Parse ZPL strings Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Use Parse for single labels or ParseAll for multi-page ZPL content. Ensure the input string contains valid ZPL commands. ```go import "github.com/StirlingMarketingGroup/go-zpl" zplString := `^XA ^FO50,50^A0N,30,30^FDHello World^FS ^FO50,100^BQN,2,5^FDMA,https://example.com^FS ^XZ` label, err := zpl.Parse(zplString) if err != nil { log.Fatal(err) } // Work with the parsed label fmt.Printf("Label has %d commands\n", len(label.Commands())) // For multi-page ZPL (multiple ^XA...^XZ blocks), use ParseAll: labels, err := zpl.ParseAll(multiPageZPL) if err != nil { log.Fatal(err) } fmt.Printf("Parsed %d labels\n", len(labels)) ``` -------------------------------- ### API: Add Text Block with Wrapping Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a block of text that supports wrapping, alignment, and line limits. Useful for longer text content. ```go // Text block with wrapping label.TextBlock(x, y, zpl.Font0, height, width, blockWidth, maxLines, zpl.JustifyCenter, "Long text...") ``` -------------------------------- ### Print Glyph Sheets with ZPL Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/tools/README.md Use the `lp` command to print ZPL files containing boxed glyphs to a Zebra printer. Ensure the printer name is correctly specified. ```bash # Page 1: A-Z, a-z, 0-9, basic punctuation lp -d YOUR_ZEBRA_PRINTER -o raw testdata/font0_boxed_glyphs.zpl # Page 2: Additional ASCII characters lp -d YOUR_ZEBRA_PRINTER -o raw testdata/font0_boxed_glyphs_page2.zpl ``` -------------------------------- ### Configuration Types Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/rust/zpl-rs/README.md Types used to configure the rendering process, including DPI settings and dimensions. ```APIDOC ## Dpi ### Description Enum representing supported printer DPI settings. - **Dpi203** - **Dpi300** - **Dpi600** ## RenderOptions ### Description Struct for configuring rendering parameters. - **dpi** (Dpi) - Sets the output resolution. - **size** (width, height) - Sets the output image dimensions. ``` -------------------------------- ### Extract Glyphs using Go Tool Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/tools/README.md Run the `smart_extract.go` tool to automatically detect grid borders and extract glyphs from scanned images. This tool converts images to PBM and traces them to SVG using potrace. ```go go run tools/smart_extract.go ``` -------------------------------- ### CLI: Render at Specific DPI Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Control the resolution of the rendered PNG by specifying the DPI using the '-dpi' flag with zplrender. ```bash zplrender -dpi 300 label.zpl ``` -------------------------------- ### CLI: Specify Output Filename Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Use the '-o' flag with zplrender to specify a custom output filename for the rendered PNG image. ```bash zplrender -o output.png label.zpl ``` -------------------------------- ### Cargo Build Script for Linking libzpl Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md This `build.rs` script configures Cargo to find and link the libzpl shared library. It specifies the native library search path and the library name. On macOS, it also sets the rpath to ensure the dynamic library can be found at runtime. ```rust fn main() { // Tell cargo where to find the library println!("cargo:rustc-link-search=native=/path/to/libzpl"); println!("cargo:rustc-link-lib=dylib=zpl"); // On macOS, set rpath #[cfg(target_os = "macos")] println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path"); } ``` -------------------------------- ### API: Add Simple Text Field Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a basic text field to the label at specified coordinates with a given font, size, and content. ```go // Simple text field label.TextField(x, y, zpl.Font0, height, width, "Your text") ``` -------------------------------- ### CLI: Read from Stdin Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Pipe ZPL content to the zplrender CLI tool via standard input using the '-' option. ```bash cat label.zpl | zplrender -o output.png ``` -------------------------------- ### CLI: Convert ZPL to PNG Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Convert a ZPL file to a PNG image using the zplrender CLI tool. The output filename defaults to the input filename with a .png extension. ```bash zplrender label.zpl ``` -------------------------------- ### API: Write ZPL to io.Writer Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Write the generated ZPL code directly to any io.Writer implementation, such as a file or network connection. ```go // Write to io.Writer label.WriteTo(writer) ``` -------------------------------- ### zpl_render_png_simple Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md A simplified version of the render function using default settings (203 DPI, auto dimensions). ```APIDOC ## zpl_render_png_simple ### Description Render ZPL content to a PNG image using default settings. ### Parameters - **zpl_data** (char*) - Required - ZPL content - **zpl_len** (int) - Required - Length of ZPL data - **png_out** (char**) - Required - Output: PNG data (caller must free) - **png_len** (int*) - Required - Output: PNG length ### Response - **Return Value** (int) - 0 on success, negative on error ``` -------------------------------- ### Print Glyph Charts Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/testdata/FONT_EXTRACTION_GUIDE.md Commands to send ZPL files to a Zebra printer via direct connection, netcat, or Windows file share. ```bash # Option 1: Send directly to printer (adjust for your setup) lp -d zebra testdata/font0_glyph_chart.zpl lp -d zebra testdata/font0_isolated_glyphs.zpl # Option 2: Using netcat to network printer cat testdata/font0_glyph_chart.zpl | nc printer.local 9100 cat testdata/font0_isolated_glyphs.zpl | nc printer.local 9100 # Option 3: Copy to printer share (Windows) copy testdata\font0_glyph_chart.zpl \\printer\share ``` -------------------------------- ### Render ZPL to PNG with Default Settings Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md A simplified C function to render ZPL data to PNG using default settings (203 DPI, auto dimensions). It returns 0 on success and a negative error code on failure. The caller must free the output PNG data using `zpl_free`. ```c // Simpler version with defaults (203 DPI, auto dimensions) int zpl_render_png_simple( char* zpl_data, int zpl_len, char** png_out, int* png_len ); ``` -------------------------------- ### Build TrueType Font with FontForge Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/tools/README.md Use FontForge with the `build_font.py` script to generate a TrueType font from the processed SVG outlines. The output font is automatically embedded in the Go render package. ```bash fontforge -script tools/build_font.py ``` -------------------------------- ### API: Add QR Code Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a QR code to the label at specified coordinates with given data and magnification factor. ```go // QR Code label.QRCode(x, y, "data", magnification) ``` -------------------------------- ### API: Add Box Graphic Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a rectangular box (outline) to the label at specified coordinates with given width, height, and line thickness. ```go // Box/Rectangle label.Box(x, y, width, height, thickness) ``` -------------------------------- ### Test Generated Font Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/testdata/FONT_EXTRACTION_GUIDE.md Command to generate a test image using the newly created font for comparison. ```bash # Generate test image with new font go run ./examples/render/ # Compare against Labelary or real printer output ``` -------------------------------- ### Add zpl-rs to Cargo.toml Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/rust/zpl-rs/README.md Add this dependency to your project's Cargo.toml file to include the zpl-rs library. ```toml [dependencies] zpl-rs = "0.1" ``` -------------------------------- ### Font File Location Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/testdata/FONT_EXTRACTION_GUIDE.md The required file path for the generated font file to be used by the render package. ```text render/font0.ttf ``` -------------------------------- ### API: Add Text with Unit Conversion Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add text to the label using explicit unit conversions (e.g., inches to dots) for precise positioning. ```go // Using unit conversion label.TextFieldAt(0.5, 0.5, zpl.UnitInches, zpl.Font0, 30, 30, "Text") ``` -------------------------------- ### Thread-Safe Rendering with Mutex Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/rust/zpl-rs/README.md Ensures thread-safe rendering by using a static Mutex to serialize access to the underlying non-thread-safe Go library. ```rust use std::sync::Mutex; use zpl_rs::render; static ZPL_MUTEX: Mutex<()> = Mutex::new(()); fn render_safe(zpl: &str) -> zpl_rs::Result> { let _lock = ZPL_MUTEX.lock().unwrap(); render(zpl) } ``` -------------------------------- ### zpl_render_png Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md Renders ZPL data to a PNG image with configurable DPI and dimensions. ```APIDOC ## zpl_render_png ### Description Render ZPL content to a PNG image with specific DPI and label dimensions. ### Parameters - **zpl_data** (char*) - Required - ZPL content (not null-terminated) - **zpl_len** (int) - Required - Length of ZPL data - **dpi** (int) - Required - 203, 300, or 600 - **width** (int) - Required - Label width in dots (0 = auto) - **height** (int) - Required - Label height in dots (0 = auto) - **png_out** (char**) - Required - Output: PNG data (caller must free) - **png_len** (int*) - Required - Output: PNG length ### Response - **Return Value** (int) - 0 on success, negative on error (-1: ZPL parse error, -2: Render error, -3: Internal error) ``` -------------------------------- ### Trim Glyphs for Uniform Height Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/tools/README.md Execute `trim_glyphs.go` to normalize all extracted glyphs to a uniform height, using 'H' for cap height and baseline, and 'g' for the descender line. This ensures proper font metrics. ```bash go run tools/trim_glyphs.go ``` -------------------------------- ### Render ZPL in Rust Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Use the zpl_rs::render function in Rust to convert a ZPL string into PNG image bytes. ```rust let png_bytes = zpl_rs::render("^XA^FO50,50^A0N,30,30^FDHello!^FS^XZ")?; ``` -------------------------------- ### ZPL Rendering Functions Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/rust/zpl-rs/README.md Core functions for rendering ZPL strings or byte arrays into PNG image data. ```APIDOC ## render(zpl: &str) -> Result> ### Description Render a ZPL string to PNG bytes using default settings (203 DPI). ### Parameters - **zpl** (str) - Required - The ZPL command string to render. ### Response - **Result>** - Returns a Result containing the PNG image bytes or an error. ## render_with_options(zpl: &str, options: &RenderOptions) -> Result> ### Description Render a ZPL string to PNG bytes with custom configuration options. ### Parameters - **zpl** (str) - Required - The ZPL command string to render. - **options** (RenderOptions) - Required - Configuration object for DPI and dimensions. ### Response - **Result>** - Returns a Result containing the PNG image bytes or an error. ``` -------------------------------- ### API: Add Circle Graphic Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a circle to the label at specified coordinates with given diameter and line thickness. ```go // Circle label.Circle(x, y, diameter, thickness) ``` -------------------------------- ### Render ZPL to PNG with Custom DPI and Dimensions Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md This C function renders ZPL data into a PNG image. You can specify the DPI, width, and height of the label. The function returns 0 on success and a negative error code on failure. The caller is responsible for freeing the allocated PNG data using `zpl_free`. ```c // Render ZPL to PNG // Returns: 0 on success, negative on error int zpl_render_png( char* zpl_data, // ZPL content (not null-terminated) int zpl_len, // Length of ZPL data int dpi, // 203, 300, or 600 int width, // Label width in dots (0 = auto) int height, // Label height in dots (0 = auto) char** png_out, // Output: PNG data (caller must free) int* png_len // Output: PNG length ); ``` -------------------------------- ### Add New Characters to Extraction Tool Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/tools/README.md Update the `smart_extract.go` file by adding new character names to the `chars` slice. This is necessary for the extraction tool to recognize and process new characters. ```go var chars = []string{ // existing... "plus", "comma", "minus", // new characters } ``` -------------------------------- ### API: Add DataMatrix Barcode Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a DataMatrix barcode to the label at specified coordinates with given data and module size. ```go // DataMatrix label.DataMatrix(x, y, "data", moduleSize) ``` -------------------------------- ### Free Memory Allocated by libzpl Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md This C function should be used to free memory that was allocated by the `zpl_render_png` or `zpl_render_png_simple` functions. Failure to do so will result in memory leaks. ```c // Free memory allocated by render functions void zpl_free(char* ptr); ``` -------------------------------- ### API: Add Filled Box Graphic Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a solid, filled rectangular box to the label at specified coordinates with given width and height. ```go // Filled box label.FilledBox(x, y, width, height) ``` -------------------------------- ### API: Add PDF417 Barcode Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a PDF417 barcode to the label at specified coordinates with given data and height. ```go // PDF417 label.PDF417(x, y, "data", height) ``` -------------------------------- ### API: Add Code 39 Barcode Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a Code 39 barcode to the label at specified coordinates with given data and height. ```go // Code 39 label.Code39(x, y, "DATA", height) ``` -------------------------------- ### Add Unicode Mappings to Font Builder Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/tools/README.md Modify the `build_font.py` script to include Unicode mappings for new characters in the `GLYPH_MAP` dictionary. This ensures correct character representation in the final font. ```python GLYPH_MAP = { # existing... "plus": ord("+"), "comma": ord(","), } ``` -------------------------------- ### Create New ZPL Sheets Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/tools/README.md Define new ZPL sheets using the specified box format (90x120 dots, 2-dot border) for adding new characters. Include character definitions within the boxes. ```zpl ^XA ^PW800 ^LL1200 ^FX --- Row: characters --- ^FO10,10^GB90,120,2^FS ^FX Box at col 0 ^FO100,10^GB90,120,2^FS ^FX Box at col 1 ... ^FO25,25^A0N,80,80^FDX^FS ^FX Character in box ... ``` -------------------------------- ### zpl_free Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/cmd/libzpl/README.md Frees memory allocated by the render functions. ```APIDOC ## zpl_free ### Description Frees memory allocated by render functions. ### Parameters - **ptr** (char*) - Required - Pointer to the memory to be freed ``` -------------------------------- ### API: Add UPC-A Barcode Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a UPC-A barcode to the label at specified coordinates with given data and height. ```go // UPC-A label.UPCA(x, y, "012345678905", height) ``` -------------------------------- ### API: Add Horizontal Line Graphic Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a horizontal line to the label at specified coordinates with given length and thickness. ```go // Horizontal line label.HorizontalLine(x, y, length, thickness) ``` -------------------------------- ### API: Add Vertical Line Graphic Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a vertical line to the label at specified coordinates with given length and thickness. ```go // Vertical line label.VerticalLine(x, y, length, thickness) ``` -------------------------------- ### API: Add Code 128 Barcode Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add a Code 128 barcode to the label at specified coordinates with given data and height. ```go // Code 128 label.Code128(x, y, "data", height) ``` -------------------------------- ### API: Add EAN-13 Barcode Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/README.md Add an EAN-13 barcode to the label at specified coordinates with given data and height. ```go // EAN-13 label.EAN13(x, y, "5901234123457", height) ``` -------------------------------- ### Calculate Glyph Scale Source: https://github.com/stirlingmarketinggroup/go-zpl/blob/master/testdata/FONT_EXTRACTION_GUIDE.md Calculations for determining the physical size and pixel dimensions of glyphs based on printer DPI and scanner resolution. ```text 72 dots ÷ 203 DPI = 0.355 inches = 9.01 mm ``` ```text 0.355 inches × 1200 DPI = 426 pixels per glyph ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.