Skip to content

Commit

Permalink
Update fonts again
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Dec 17, 2023
1 parent a4c87c5 commit ab27a4d
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The following assets are made by [necrashter](https://github.com/necrashter/):
- `upgrade1.ogg` is [this CC0 sound](https://freesound.org/people/the_semen_incident/sounds/39013/).

The following assets are made by [Pyrious](https://github.com/benfrankel/):
- The fonts (`PyriousPixel-R.ttf` and `PyriousPixel-B.ttf`) are licensed under [CC0](https://creativecommons.org/public-domain/cc0/).
- The fonts (`PyriousPixel-R.ttf`, `PyriousPixel-B.ttf`, and `PyriousBlocky.ttf`) are licensed under [CC0](https://creativecommons.org/public-domain/cc0/).

Other assets:
- Sprites (1-bit): https://v3x3d.itch.io/bit-bonanza
Expand Down
12 changes: 6 additions & 6 deletions assets/config.ron
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
max_width: Vw(40.0),
background_color: Rgba(red: 0.106, green: 0.118, blue: 0.122, alpha: 0.850),
text_color: Rgba(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000),
font_size: Px(16.0),
font_size: Px(14.0),
),

splash_screen: SplashScreenConfig(
Expand All @@ -21,7 +21,7 @@
border_width: VMin(1.0),
text_color: Rgba(red: 0.149, green: 0.149, blue: 0.149, alpha: 1.000),
hyperlink_text_color: Rgba(red: 0.000, green: 0.188, blue: 0.702, alpha: 1.000),
font_size: Vw(2.2),
font_size: Vw(1.8),

title_background_color: Rgba(red: 0.549, green: 0.647, blue: 0.796, alpha: 1.000),
title_font_size: Vw(4.5),
Expand All @@ -47,20 +47,20 @@
info_bar_font_size: Px(32.0),

outline_panel_width: Px(280.0),
outline_panel_font_size: Px(16.0),
outline_panel_font_size: Px(14.0),
outline_panel_header_font_size: Px(24.0),

scene_view_background_color: Rgba(red: 0.500, green: 0.500, blue: 0.500, alpha: 1.000),

code_panel_height: Px(200.0),
code_panel_font_size: Px(16.0),
code_panel_font_size: Px(14.0),
code_panel_lines_max: 10,

upgrade_panel_width: Px(280.0),
upgrade_panel_header_font_size: Px(24.0),

upgrade_button_height: Px(56.0),
upgrade_button_font_size: Px(16.0),
upgrade_button_font_size: Px(14.0),

separator_width: Px(4.0),

Expand Down Expand Up @@ -170,7 +170,7 @@
border_width: VMin(0.9),
text_color: Rgba(red: 0.737, green: 0.737, blue: 0.737, alpha: 1.000),
hyperlink_text_color: Rgba(red: 0.435, green: 0.624, blue: 1.000, alpha: 1.000),
font_size: Vw(2.5),
font_size: Vw(2.0),

title_text_color: Rgba(red: 0.737, green: 0.737, blue: 0.737, alpha: 1.000),
title_font_size: Vw(5.0),
Expand Down
Binary file added assets/font/PyriousBlocky.ttf
Binary file not shown.
Binary file modified assets/font/PyriousPixel-B.ttf
Binary file not shown.
Binary file modified assets/font/PyriousPixel-R.ttf
Binary file not shown.
Binary file removed assets/font/PyriousPixel.aseprite
Binary file not shown.
Binary file modified assets/image/entity/text/PyriousPixel-B.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/state/editor_screen/info_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::simulation::Simulation;
use crate::state::editor_screen::EditorScreenConfig;
use crate::state::editor_screen::EditorScreenTheme;
use crate::ui::FontSize;
use crate::ui::BOLD_FONT_HANDLE;
use crate::ui::HEADER_FONT_HANDLE;
use crate::util::pretty_num;
use crate::AppSet;

Expand Down Expand Up @@ -46,7 +46,7 @@ pub fn spawn_info_bar(
TextBundle::from_section(
"",
TextStyle {
font: BOLD_FONT_HANDLE,
font: HEADER_FONT_HANDLE,
color: theme.info_bar_text_color,
..default()
},
Expand Down
4 changes: 2 additions & 2 deletions src/state/editor_screen/outline_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use crate::ui::InteractionPalette;
use crate::ui::ScrollContent;
use crate::ui::Tooltip;
use crate::ui::TooltipSide;
use crate::ui::BOLD_FONT_HANDLE;
use crate::ui::FONT_HANDLE;
use crate::ui::HEADER_FONT_HANDLE;
use crate::upgrade::UpgradeEvent;
use crate::upgrade::UpgradeKind;
use crate::upgrade::UpgradeList;
Expand Down Expand Up @@ -75,7 +75,7 @@ pub fn spawn_outline_panel(
text: Text::from_section(
"",
TextStyle {
font: BOLD_FONT_HANDLE,
font: HEADER_FONT_HANDLE,
color: theme.outline_panel_text_color,
..default()
},
Expand Down
6 changes: 3 additions & 3 deletions src/state/editor_screen/upgrade_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use crate::ui::FontSize;
use crate::ui::InteractionPalette;
use crate::ui::Tooltip;
use crate::ui::TooltipSide;
use crate::ui::BOLD_FONT_HANDLE;
use crate::ui::FONT_HANDLE;
use crate::ui::HEADER_FONT_HANDLE;
use crate::upgrade::UpgradeEvent;
use crate::upgrade::UpgradeKind;
use crate::upgrade::UpgradeList;
Expand Down Expand Up @@ -71,7 +71,7 @@ pub fn spawn_upgrade_panel(
TextBundle::from_section(
"Upgrades",
TextStyle {
font: BOLD_FONT_HANDLE,
font: HEADER_FONT_HANDLE,
color: theme.upgrade_panel_text_color,
..default()
},
Expand Down Expand Up @@ -302,7 +302,7 @@ fn spawn_submit_button(commands: &mut Commands, config: &EditorScreenConfig) ->
TextBundle::from_section(
"Submit",
TextStyle {
font: BOLD_FONT_HANDLE,
font: HEADER_FONT_HANDLE,
color: config.submit_button_text_color,
..default()
},
Expand Down
4 changes: 2 additions & 2 deletions src/state/loading_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::simulation::SpritePackAssets;
use crate::state::editor_screen::EditorScreenAssets;
use crate::state::AppState::*;
use crate::ui::FontSize;
use crate::ui::BOLD_FONT_HANDLE;
use crate::ui::HEADER_FONT_HANDLE;
use crate::AppRoot;

pub struct LoadingScreenStatePlugin;
Expand Down Expand Up @@ -94,7 +94,7 @@ fn enter_loading(mut commands: Commands, root: Res<AppRoot>, config: Res<Config>
text: Text::from_section(
"Loading...",
TextStyle {
font: BOLD_FONT_HANDLE,
font: HEADER_FONT_HANDLE,
color: config.foreground_color,
..default()
},
Expand Down
5 changes: 3 additions & 2 deletions src/state/results_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::ui::FontSize;
use crate::ui::InteractionPalette;
use crate::ui::BOLD_FONT_HANDLE;
use crate::ui::FONT_HANDLE;
use crate::ui::HEADER_FONT_HANDLE;
use crate::AppRoot;

pub struct ResultsScreenStatePlugin;
Expand Down Expand Up @@ -101,7 +102,7 @@ fn enter_results_screen(
TextBundle::from_section(
TITLE_TEXT,
TextStyle {
font: BOLD_FONT_HANDLE,
font: HEADER_FONT_HANDLE,
color: config.title_text_color,
..default()
},
Expand Down Expand Up @@ -305,7 +306,7 @@ fn spawn_return_button(commands: &mut Commands, config: &ResultsScreenConfig) ->
TextBundle::from_section(
"Try another jam?",
TextStyle {
font: BOLD_FONT_HANDLE,
font: HEADER_FONT_HANDLE,
color: config.return_button_text_color,
..default()
},
Expand Down
5 changes: 3 additions & 2 deletions src/state/title_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::ui::FontSize;
use crate::ui::InteractionPalette;
use crate::ui::BOLD_FONT_HANDLE;
use crate::ui::FONT_HANDLE;
use crate::ui::HEADER_FONT_HANDLE;
use crate::AppRoot;

pub struct TitleScreenStatePlugin;
Expand Down Expand Up @@ -149,7 +150,7 @@ fn enter_title_screen(mut commands: Commands, root: Res<AppRoot>, config: Res<Co
TextBundle::from_section(
TITLE_TEXT,
TextStyle {
font: BOLD_FONT_HANDLE,
font: HEADER_FONT_HANDLE,
color: config.text_color,
..default()
},
Expand Down Expand Up @@ -262,7 +263,7 @@ fn enter_title_screen(mut commands: Commands, root: Res<AppRoot>, config: Res<Co
TextBundle::from_section(
"Join",
TextStyle {
font: BOLD_FONT_HANDLE,
font: HEADER_FONT_HANDLE,
color: config.button_text_color,
..default()
},
Expand Down
1 change: 1 addition & 0 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub use crate::ui::code_typer::CodeTyper;
pub use crate::ui::font::FontSize;
pub use crate::ui::font::BOLD_FONT_HANDLE;
pub use crate::ui::font::FONT_HANDLE;
pub use crate::ui::font::HEADER_FONT_HANDLE;
pub use crate::ui::interaction_palette::InteractionPalette;
pub use crate::ui::scroll::ScrollContent;
pub use crate::ui::tooltip::Tooltip;
Expand Down
8 changes: 8 additions & 0 deletions src/ui/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ impl Plugin for FontPlugin {
"../../assets/font/PyriousPixel-B.ttf",
|bytes: &[u8], _path: String| Font::try_from_bytes(bytes.to_vec()).unwrap()
);
load_internal_binary_asset!(
app,
HEADER_FONT_HANDLE,
"../../assets/font/PyriousBlocky.ttf",
|bytes: &[u8], _path: String| Font::try_from_bytes(bytes.to_vec()).unwrap()
);

app.register_type::<FontSize>()
.add_systems(Update, scale_font_size.in_set(AppSet::End));
Expand All @@ -30,6 +36,8 @@ pub const FONT_HANDLE: Handle<Font> =
Handle::weak_from_u128(303551798864246209986336759745415587961);
pub const BOLD_FONT_HANDLE: Handle<Font> =
Handle::weak_from_u128(317423448069604009516378143395193332978);
pub const HEADER_FONT_HANDLE: Handle<Font> =
Handle::weak_from_u128(6129592437227906058946689932047862666);

#[derive(Component, Reflect)]
pub struct FontSize {
Expand Down

0 comments on commit ab27a4d

Please sign in to comment.