From 18f46a6f8378e8173ae4b0e6099f0828a5c024ac Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Mon, 17 Feb 2020 16:22:49 +0000 Subject: [PATCH] Fix Fonts --- assets/voxygen/i18n/en.ron | 2 +- voxygen/src/hud/buttons.rs | 12 ++++++++++-- voxygen/src/hud/minimap.rs | 2 +- voxygen/src/hud/mod.rs | 19 +++++++++++++++++-- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index f13969a9b5..96d7344654 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -35,7 +35,7 @@ VoxygenLocalization( scale_ratio: 1.0, ), "cyri": Font ( - asset_key: "voxygen.font.haxrcorp_4089_cyrillic_altgr", + asset_key: "voxygen.font.haxrcorp_4089_cyrillic_altgr_extended", scale_ratio: 1.0, ), }, diff --git a/voxygen/src/hud/buttons.rs b/voxygen/src/hud/buttons.rs index b6931106cf..65c0a209c4 100644 --- a/voxygen/src/hud/buttons.rs +++ b/voxygen/src/hud/buttons.rs @@ -31,7 +31,7 @@ pub struct Buttons<'a> { show_bag: bool, imgs: &'a Imgs, - _fonts: &'a ConrodVoxygenFonts, + fonts: &'a ConrodVoxygenFonts, #[conrod(common_builder)] common: widget::CommonBuilder, } @@ -49,7 +49,7 @@ impl<'a> Buttons<'a> { show_map, show_bag, imgs, - _fonts: fonts, + fonts, common: widget::CommonBuilder::default(), } } @@ -101,6 +101,7 @@ impl<'a> Widget for Buttons<'a> { Text::new("B") .bottom_right_with_margins_on(state.ids.bag, 0.0, 0.0) .font_size(10) + .font_id(self.fonts.cyri.conrod_id) .color(TEXT_COLOR) .set(state.ids.bag_text, ui); } else { @@ -111,6 +112,7 @@ impl<'a> Widget for Buttons<'a> { Text::new("B") .bottom_right_with_margins_on(state.ids.bag, 0.0, 0.0) .font_size(10) + .font_id(self.fonts.cyri.conrod_id) .color(TEXT_COLOR) .set(state.ids.bag_text, ui); } @@ -122,6 +124,7 @@ impl<'a> Widget for Buttons<'a> { .hover_image(self.imgs.settings_hover) .press_image(self.imgs.settings_press) .label("N") + .label_font_id(self.fonts.cyri.conrod_id) .label_font_size(10) .label_color(TEXT_COLOR) .label_y(conrod_core::position::Relative::Scalar(-7.0)) @@ -144,6 +147,7 @@ impl<'a> Widget for Buttons<'a> { .hover_image(self.imgs.map_hover) .press_image(self.imgs.map_press) .label("M") + .label_font_id(self.fonts.cyri.conrod_id) .label_font_size(10) .label_color(TEXT_COLOR) .label_y(conrod_core::position::Relative::Scalar(-7.0)) @@ -185,6 +189,7 @@ impl<'a> Widget for Buttons<'a> { .hover_image(self.imgs.social_hover) .press_image(self.imgs.social_press) .label("O") + .label_font_id(self.fonts.cyri.conrod_id) .label_font_size(10) .label_color(TEXT_COLOR) .label_y(conrod_core::position::Relative::Scalar(-7.0)) @@ -202,6 +207,7 @@ impl<'a> Widget for Buttons<'a> { .hover_image(self.imgs.spellbook_hover) .press_image(self.imgs.spellbook_press) .label("P") + .label_font_id(self.fonts.cyri.conrod_id) .label_font_size(10) .label_color(TEXT_COLOR) .label_y(conrod_core::position::Relative::Scalar(-7.0)) @@ -219,6 +225,7 @@ impl<'a> Widget for Buttons<'a> { .hover_image(self.imgs.character_hover) .press_image(self.imgs.character_press) .label("C") + .label_font_id(self.fonts.cyri.conrod_id) .label_font_size(10) .label_color(TEXT_COLOR) .label_y(conrod_core::position::Relative::Scalar(-7.0)) @@ -236,6 +243,7 @@ impl<'a> Widget for Buttons<'a> { .hover_image(self.imgs.qlog_hover) .press_image(self.imgs.qlog_press) .label("L") + .label_font_id(self.fonts.cyri.conrod_id) .label_font_size(10) .label_color(TEXT_COLOR) .label_y(conrod_core::position::Relative::Scalar(-7.0)) diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index d44668ed5f..7fd5190b32 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -306,7 +306,7 @@ impl<'a> Widget for MiniMap<'a> { .font_size( self.fonts .cyri - .scale(if self.show.mini_map { 30 } else { 18 }), + .scale(if self.show.mini_map { 20 } else { 18 }), ) .font_id(self.fonts.cyri.conrod_id) .color(TEXT_COLOR) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 023a701d71..fdda3be94a 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -806,12 +806,14 @@ impl Hud { Text::new(&format!("{}", (hp_damage).abs())) .font_size(font_size) + .font_id(self.fonts.cyri.conrod_id) .color(Color::Rgba(0.0, 0.0, 0.0, fade)) .x_y(0.0, y - 3.0) .position_ingame(ingame_pos) .set(sct_bg_id, ui_widgets); Text::new(&format!("{}", hp_damage.abs())) .font_size(font_size) + .font_id(self.fonts.cyri.conrod_id) .x_y(0.0, y) .color(if hp_damage < 0 { Color::Rgba(font_col.r, font_col.g, font_col.b, fade) @@ -852,6 +854,7 @@ impl Hud { Text::new(&format!("{}", (floater.hp_change).abs())) .font_size(font_size) + .font_id(self.fonts.cyri.conrod_id) .color(if floater.hp_change < 0 { Color::Rgba(0.0, 0.0, 0.0, fade) } else { @@ -862,6 +865,7 @@ impl Hud { .set(sct_bg_id, ui_widgets); Text::new(&format!("{}", (floater.hp_change).abs())) .font_size(font_size) + .font_id(self.fonts.cyri.conrod_id) .x_y(0.0, y) .color(if floater.hp_change < 0 { Color::Rgba(font_col.r, font_col.g, font_col.b, fade) @@ -919,6 +923,7 @@ impl Hud { ((crate::ecs::sys::floater::MY_HP_SHOWTIME - timer) * 0.25) + 0.2; Text::new(&format!("{}", (hp_damage).abs())) .font_size(font_size) + .font_id(self.fonts.cyri.conrod_id) .color(if hp_damage < 0 { Color::Rgba(0.0, 0.0, 0.0, hp_fade) } else { @@ -928,6 +933,7 @@ impl Hud { .set(player_sct_bg_id, ui_widgets); Text::new(&format!("{}", (hp_damage).abs())) .font_size(font_size) + .font_id(self.fonts.cyri.conrod_id) .color(if hp_damage < 0 { Color::Rgba(1.0, 0.1, 0.0, hp_fade) } else { @@ -991,11 +997,13 @@ impl Hud { + 0.2; Text::new(&format!("{}", (floater.hp_change).abs())) .font_size(font_size) + .font_id(self.fonts.cyri.conrod_id) .color(Color::Rgba(0.0, 0.0, 0.0, hp_fade)) .x_y(x, y - 3.0) .set(player_sct_bg_id, ui_widgets); Text::new(&format!("{}", (floater.hp_change).abs())) .font_size(font_size) + .font_id(self.fonts.cyri.conrod_id) .color(if floater.hp_change < 0 { Color::Rgba(1.0, 0.1, 0.0, hp_fade) } else { @@ -1046,6 +1054,7 @@ impl Hud { Text::new(&format!("{} Exp", exp_change)) .font_size(font_size_xp) + .font_id(self.fonts.cyri.conrod_id) .color(Color::Rgba(0.0, 0.0, 0.0, fade)) .x_y( ui_widgets.win_w * (0.5 * rand.0 as f64 - 0.25), @@ -1054,6 +1063,7 @@ impl Hud { .set(player_sct_bg_id, ui_widgets); Text::new(&format!("{} Exp", exp_change)) .font_size(font_size_xp) + .font_id(self.fonts.cyri.conrod_id) .color(Color::Rgba(0.59, 0.41, 0.67, fade)) .x_y( ui_widgets.win_w * (0.5 * rand.0 as f64 - 0.25), @@ -1087,6 +1097,7 @@ impl Hud { Text::new(&format!("{} Exp", floater.exp_change)) .font_size(font_size_xp) + .font_id(self.fonts.cyri.conrod_id) .color(Color::Rgba(0.0, 0.0, 0.0, fade)) .x_y( ui_widgets.win_w * (0.5 * floater.rand.0 as f64 - 0.25), @@ -1095,6 +1106,7 @@ impl Hud { .set(player_sct_bg_id, ui_widgets); Text::new(&format!("{} Exp", floater.exp_change)) .font_size(font_size_xp) + .font_id(self.fonts.cyri.conrod_id) .color(Color::Rgba(0.59, 0.41, 0.67, fade)) .x_y( ui_widgets.win_w * (0.5 * floater.rand.0 as f64 - 0.25), @@ -1167,13 +1179,15 @@ impl Hud { // Name Text::new(&name) - .font_size(self.fonts.cyri.scale(30)) + .font_id(self.fonts.cyri.conrod_id) + .font_size(30) .color(Color::Rgba(0.0, 0.0, 0.0, 1.0)) .x_y(-1.0, MANA_BAR_Y + 48.0) .position_ingame(ingame_pos) .set(name_bg_id, ui_widgets); Text::new(&name) - .font_size(self.fonts.cyri.scale(30)) + .font_id(self.fonts.cyri.conrod_id) + .font_size(30) .color(Color::Rgba(0.61, 0.61, 0.89, 1.0)) .x_y(0.0, MANA_BAR_Y + 50.0) .position_ingame(ingame_pos) @@ -1193,6 +1207,7 @@ impl Hud { // -5 - +5 levels around player level -> equal // - 5 levels below player -> low Text::new(if level_comp < 10 { &level_str } else { "?" }) + .font_id(self.fonts.cyri.conrod_id) .font_size(if op_level > 9 && level_comp < 10 { 14 } else {