Skip to content

Commit

Permalink
utf-8: added README section
Browse files Browse the repository at this point in the history
  • Loading branch information
cab404 committed Feb 9, 2020
1 parent ec6b09e commit f2f8248
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,39 @@ fn main() {

Generates this SVG:

[![Output](src/test_annex_i_micro_qr_as_svg.svg)](src/test_annex_i_micro_qr_as_svg.svg)
[![Output](src/test_annex_i_micro_qr_as_svg.svg)](src/test_annex_i_micro_qr_as_svg.svg)

## Unicode string generation

```rust
use qrcode::QrCode;

fn main() {
let code = QrCode::new("mow mow").unwrap();
let image = code.render::<u8>()
.dark_color(0)
.light_color(1)
.build();
println!("{}", image);
}
```

Generates this output:

```
█████████████████████████████
█████████████████████████████
████ ▄▄▄▄▄ █ ▀▀▀▄█ ▄▄▄▄▄ ████
████ █ █ █▀ ▀ ▀█ █ █ ████
████ █▄▄▄█ ██▄ ▀█ █▄▄▄█ ████
████▄▄▄▄▄▄▄█ ▀▄▀ █▄▄▄▄▄▄▄████
████▄▀ ▄▀ ▄ █▄█ ▀ ▀█ █▄ ████
████▄██▄▄▀▄▄▀█▄ ██▀▀█▀▄▄▄████
█████▄▄▄█▄▄█ ▀▀▄█▀▀▀▄█▄▄████
████ ▄▄▄▄▄ █ ▄▄██▄ ▄ ▀▀████
████ █ █ █▀▄▄▀▄▄ ▄▄▄▄ ▄████
████ █▄▄▄█ █▄ █▄▀▄▀██▄█▀████
████▄▄▄▄▄▄▄█▄████▄█▄██▄██████
█████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
```

0 comments on commit f2f8248

Please sign in to comment.