Skip to content

Commit

Permalink
only keep one font; bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
tasgon committed Aug 9, 2023
1 parent 3c0052e commit 03d599d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 130 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_iced"
version = "0.3.1"
version = "0.4.0"
edition = "2021"
description = "Iced integration for Bevy"
authors = ["tasgon <[email protected]>"]
Expand Down
121 changes: 0 additions & 121 deletions assets/fonts/Rainbow2000-License.txt

This file was deleted.

Binary file removed assets/fonts/Rainbow2000-Regular.ttf
Binary file not shown.
13 changes: 5 additions & 8 deletions examples/fonts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use std::{fs, io};

use bevy::prelude::*;
use bevy_iced::iced::{
font,
widget::{column, text},
Font,
};
use bevy_iced::{iced, IcedContext, IcedPlugin};

const ALPHAPROTA_FONT: Font = Font::with_name("Alpha Prota");
const RAINBOW2000_FONT: Font = Font::with_name("Rainbow 2000");

#[derive(Event)]
pub enum UiMessage {}
Expand All @@ -17,13 +17,10 @@ pub fn main() -> io::Result<()> {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(IcedPlugin {
fonts: vec![
fs::read("assets/fonts/AlphaProta.ttf")?.leak(),
fs::read("assets/fonts/Rainbow2000-Regular.ttf")?.leak(),
],
fonts: vec![fs::read("assets/fonts/AlphaProta.ttf")?.leak()],
settings: iced::Settings {
default_font: ALPHAPROTA_FONT,
default_text_size: 40.0,
default_font: ALPHAPROTA_FONT,
..Default::default()
},
})
Expand All @@ -36,7 +33,7 @@ pub fn main() -> io::Result<()> {

fn ui_system(mut ctx: IcedContext<UiMessage>) {
ctx.display(column!(
text(format!("I am the default font")),
text(format!("I am another font")).font(RAINBOW2000_FONT)
text(format!("I am the default font")).font(font::Font::DEFAULT),
text(format!("I am another font"))
));
}

0 comments on commit 03d599d

Please sign in to comment.