Add more unifont symbols
This commit is contained in:
parent
757b401b2d
commit
bd069e8f26
4 changed files with 6 additions and 2 deletions
BIN
showbits-assets/data/unifont_jp-15.1.05.otf
Normal file
BIN
showbits-assets/data/unifont_jp-15.1.05.otf
Normal file
Binary file not shown.
BIN
showbits-assets/data/unifont_upper-15.1.05.otf
Normal file
BIN
showbits-assets/data/unifont_upper-15.1.05.otf
Normal file
Binary file not shown.
|
|
@ -1,3 +1,5 @@
|
||||||
pub const UNIFONT: &[u8] = include_bytes!("../data/unifont-15.1.05.otf");
|
pub const UNIFONT: &[u8] = include_bytes!("../data/unifont-15.1.05.otf");
|
||||||
|
pub const UNIFONT_JP: &[u8] = include_bytes!("../data/unifont_jp-15.1.05.otf");
|
||||||
|
pub const UNIFONT_UPPER: &[u8] = include_bytes!("../data/unifont_upper-15.1.05.otf");
|
||||||
pub const UNIFONT_NAME: &str = "Unifont";
|
pub const UNIFONT_NAME: &str = "Unifont";
|
||||||
pub const UNIFONT_SIZE: f32 = 16.0;
|
pub const UNIFONT_SIZE: f32 = 16.0;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use cosmic_text::{Attrs, AttrsOwned, Buffer, Family, FontSystem, Metrics, Shaping, SwashCache};
|
use cosmic_text::{Attrs, AttrsOwned, Buffer, Family, FontSystem, Metrics, Shaping, SwashCache};
|
||||||
use palette::Srgba;
|
use palette::Srgba;
|
||||||
use showbits_assets::{UNIFONT, UNIFONT_NAME, UNIFONT_SIZE};
|
use showbits_assets::{UNIFONT, UNIFONT_JP, UNIFONT_NAME, UNIFONT_SIZE, UNIFONT_UPPER};
|
||||||
use taffy::{
|
use taffy::{
|
||||||
prelude::{AvailableSpace, Size},
|
prelude::{AvailableSpace, Size},
|
||||||
Layout,
|
Layout,
|
||||||
|
|
@ -20,6 +20,8 @@ impl FontStuff {
|
||||||
let mut font_system = FontSystem::new();
|
let mut font_system = FontSystem::new();
|
||||||
let db = font_system.db_mut();
|
let db = font_system.db_mut();
|
||||||
db.load_font_data(UNIFONT.to_vec());
|
db.load_font_data(UNIFONT.to_vec());
|
||||||
|
db.load_font_data(UNIFONT_JP.to_vec());
|
||||||
|
db.load_font_data(UNIFONT_UPPER.to_vec());
|
||||||
db.set_monospace_family(UNIFONT_NAME);
|
db.set_monospace_family(UNIFONT_NAME);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|
@ -61,7 +63,7 @@ impl Text {
|
||||||
metrics: Self::default_metrics(),
|
metrics: Self::default_metrics(),
|
||||||
default_attrs: AttrsOwned::new(Self::default_attrs()),
|
default_attrs: AttrsOwned::new(Self::default_attrs()),
|
||||||
chunks: vec![],
|
chunks: vec![],
|
||||||
shaping: Shaping::Basic,
|
shaping: Shaping::Advanced,
|
||||||
color: color::BLACK,
|
color: color::BLACK,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue