Debian Codegraph @

/

debian rust-unicode-linebreak 0.1.5-1debian librust-unicode-linebreak-dev debian librust-unicode-linebreak+default-dev debian librust-unicode-linebreak-0-dev debian librust-unicode-linebreak-0+default-dev debian librust-unicode-linebreak-0.1-dev debian librust-unicode-linebreak-0.1+default-dev debian librust-unicode-linebreak-0.1.5-dev debian librust-unicode-linebreak-0.1.5+default-dev cargo unicode-linebreak 0.1.5 debianjsonmakefilemarkdownrustrustrust-c-abishelltoml 15 files · 101 symbols
View dependency graph

Depends on

  • dh-cargo (dh-sequence-cargo)
  • cargo, debhelper-compat, libstd-rust-dev, rustc
README (full)

unicode-linebreak

Implementation of the Line Breaking Algorithm described in Unicode Standard Annex #14.

test Documentation

Given an input text, locates "line break opportunities", or positions appropriate for wrapping lines when displaying text.

Example

use unicode_linebreak::{linebreaks, BreakOpportunity::{Mandatory, Allowed}};

let text = "a b \nc";
assert!(linebreaks(text).eq([
	(2, Allowed),   // May break after first space
	(5, Mandatory), // Must break after line feed
	(6, Mandatory)  // Must break at end of text, so that there always is at least one LB
]));

Development

After cloning the repository or modifying LineBreak.txt the tables have to be (re-)generated:

# Generate src/tables.rs
(cd gen-tables && cargo run)
# Run tests to make sure it was successful
cargo test
dir debian/
dir src/
file Cargo.toml
file Cargo.toml.orig
file LICENSE
file README.md