1 unstable release

0.1.0 May 9, 2020

#263 in Visualization


Used in gqair

MPL-2.0 license

9KB
75 lines

qr2cairo

Vector drawing of QR code using Cairo.

Examples

PDF

PDF example from the examples/ directory:

let surface = cairo::PdfSurface::new(100.0, 100.0, "example.pdf").unwrap();
let cr = cairo::Context::new(&surface);
qr2cairo::draw(&cr, 100.0, 100.0, "qr2cairo").unwrap();
cr.show_page();

This generates this PDF: example.pdf.

GTK

GTK example (note: no GTK required to use qr2cairo):

$ cd examples/gtk ; cargo run

qr2cairo gtk example

SVG

The underlying qrcode crate can create SVGs.


lib.rs:

Vector drawing of QR code using Cairo.

Examples

PDF

PDF example from the examples/ directory:

let surface = cairo::PdfSurface::new(100.0, 100.0, "example.pdf").unwrap();
let cr = cairo::Context::new(&surface);
qr2cairo::draw(&cr, 100.0, 100.0, "qr2cairo").unwrap();
cr.show_page();

This generates this PDF: example.pdf.

GTK

GTK example (note: no GTK required to use qr2cairo):

$ cd examples/gtk ; cargo run

qr2cairo gtk example

SVG

The underlying qrcode crate can create SVGs.

Dependencies

~1–1.8MB
~42K SLoC