mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-28 16:00:58 +00:00
Bring in bold font, use in side menu
This commit is contained in:
parent
53dd9c913b
commit
87e73032fd
BIN
fonts/DejaVuSans-Bold-SansEmoji.ttf
Normal file
BIN
fonts/DejaVuSans-Bold-SansEmoji.ttf
Normal file
Binary file not shown.
BIN
fonts/DejaVuSans-Bold.ttf
Normal file
BIN
fonts/DejaVuSans-Bold.ttf
Normal file
Binary file not shown.
@ -26,3 +26,6 @@ Noto Emoji (monochrome) comes from:
|
||||
CHARS COVERED
|
||||
NotoEmoji-Regular:
|
||||
From 1F000 forward, we take these. Therefore strip them from the other fonts.
|
||||
|
||||
|
||||
pyftsubset DejaVuSans-Bold.ttf --unicodes="U+0000-FFFD" --ignore-missing-glyphs --output-file DejaVuSans-Bold-SansEmoji.ttf
|
||||
|
@ -38,7 +38,7 @@ use eframe::{egui, IconData};
|
||||
#[cfg(not(feature = "side-menu"))]
|
||||
use egui::SelectableLabel;
|
||||
use egui::{
|
||||
Color32, ColorImage, Context, Image, ImageData, Label, RichText, Sense,
|
||||
Color32, ColorImage, Context, FontFamily, Image, ImageData, Label, RichText, Sense,
|
||||
TextStyle, TextureHandle, TextureOptions, Ui, Vec2,
|
||||
};
|
||||
#[cfg(feature = "video-ffmpeg")]
|
||||
@ -1148,7 +1148,10 @@ impl GossipUi {
|
||||
}
|
||||
|
||||
fn new_selected_label(&mut self, selected: bool, text: &str ) -> Label {
|
||||
let rtext = RichText::new(text).color(self.settings.theme.navigation_text_color(selected));
|
||||
let mut rtext = RichText::new(text).color(self.settings.theme.navigation_text_color(selected));
|
||||
if selected {
|
||||
rtext = rtext.family(FontFamily::Name("Bold".into()));
|
||||
}
|
||||
Label::new(rtext).sense(Sense::click())
|
||||
}
|
||||
|
||||
|
@ -350,6 +350,10 @@ pub(super) fn font_definitions() -> FontDefinitions {
|
||||
"DejaVuSans".to_owned(),
|
||||
FontData::from_static(include_bytes!("../../../fonts/DejaVuSansSansEmoji.ttf")),
|
||||
);
|
||||
font_data.insert(
|
||||
"DejaVuSansBold".to_owned(),
|
||||
FontData::from_static(include_bytes!("../../../fonts/DejaVuSans-Bold-SansEmoji.ttf")),
|
||||
);
|
||||
|
||||
if cfg!(feature = "lang-cjk") {
|
||||
font_data.insert(
|
||||
@ -395,6 +399,11 @@ pub(super) fn font_definitions() -> FontDefinitions {
|
||||
vec!["Inconsolata".to_owned(), "NotoEmoji-Regular".to_owned()],
|
||||
);
|
||||
|
||||
families.insert(
|
||||
FontFamily::Name("Bold".into()),
|
||||
vec!["DejaVuSansBold".to_owned()]
|
||||
);
|
||||
|
||||
FontDefinitions {
|
||||
font_data,
|
||||
families,
|
||||
|
Loading…
Reference in New Issue
Block a user