Add alignment parameter to set_text (#419)
* add alignment parameter to set_text * Fix doc comment
This commit is contained in:
parent
750e1a4dd1
commit
3c1f6c9e8a
10 changed files with 30 additions and 11 deletions
|
|
@ -31,7 +31,7 @@ fn main() {
|
|||
|
||||
let attrs = Attrs::new().family(Family::Monospace);
|
||||
match fs::read_to_string(&path) {
|
||||
Ok(text) => buffer.set_text(&text, &attrs, Shaping::Advanced),
|
||||
Ok(text) => buffer.set_text(&text, &attrs, Shaping::Advanced, None),
|
||||
Err(err) => {
|
||||
log::error!("failed to load {:?}: {}", path, err);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ fn main() {
|
|||
let text = std::env::args()
|
||||
.nth(1)
|
||||
.unwrap_or(" Hi, Rust! 🦀 ".to_string());
|
||||
buffer.set_text(&text, &attrs, Shaping::Advanced);
|
||||
buffer.set_text(&text, &attrs, Shaping::Advanced, None);
|
||||
|
||||
// Perform shaping as desired
|
||||
buffer.shape_until_scroll(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue