Fix Galley test
This commit is contained in:
parent
6a4a03ce9d
commit
c82186e196
1 changed files with 3 additions and 6 deletions
|
@ -654,14 +654,11 @@ fn test_text_layout() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
use crate::mutex::Mutex;
|
use crate::paint::*;
|
||||||
use crate::paint::{font::Font, *};
|
|
||||||
|
|
||||||
let pixels_per_point = 1.0;
|
let pixels_per_point = 1.0;
|
||||||
let typeface_data = include_bytes!("../../fonts/ProggyClean.ttf");
|
let fonts = Fonts::from_definitions(FontDefinitions::with_pixels_per_point(pixels_per_point));
|
||||||
let atlas = TextureAtlas::new(512, 16);
|
let font = &fonts[TextStyle::Monospace];
|
||||||
let atlas = std::sync::Arc::new(Mutex::new(atlas));
|
|
||||||
let font = Font::new(atlas, typeface_data, 13.0, pixels_per_point);
|
|
||||||
|
|
||||||
let galley = font.layout_multiline("".to_owned(), 1024.0);
|
let galley = font.layout_multiline("".to_owned(), 1024.0);
|
||||||
assert_eq!(galley.rows.len(), 1);
|
assert_eq!(galley.rows.len(), 1);
|
||||||
|
|
Loading…
Reference in a new issue