mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Improve docs concerning custom fonts, themes and accessibility
Closes https://github.com/emilk/egui/pull/370 Closes https://github.com/emilk/egui/issues/372
This commit is contained in:
@@ -58,11 +58,24 @@ impl super::View for FontBook {
|
||||
use super::font_contents_ubuntu::UBUNTU_FONT_CHARACTERS;
|
||||
|
||||
ui.label(format!(
|
||||
"egui supports {} standard characters and {} emojis.\nClick on a character to copy it.",
|
||||
"The default egui fonts supports {} standard characters and {} emojis.",
|
||||
UBUNTU_FONT_CHARACTERS.len(),
|
||||
FULL_EMOJI_LIST.len(),
|
||||
));
|
||||
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.spacing_mut().item_spacing.x = 0.0;
|
||||
ui.label("You can add more characters by installing additional fonts with ");
|
||||
ui.add(
|
||||
egui::Hyperlink::from_label_and_url(
|
||||
"Context::set_fonts",
|
||||
"https://docs.rs/egui/latest/egui/struct.Context.html#method.set_fonts",
|
||||
)
|
||||
.text_style(egui::TextStyle::Monospace),
|
||||
);
|
||||
ui.label(".");
|
||||
});
|
||||
|
||||
ui.separator();
|
||||
|
||||
egui::ComboBox::from_label("Text style")
|
||||
|
||||
@@ -88,8 +88,9 @@ impl View for MiscDemoWindow {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("You can pretty easily paint your own small icons:");
|
||||
use std::f32::consts::TAU;
|
||||
let (rect, _response) = ui.allocate_at_least(Vec2::splat(16.0), Sense::hover());
|
||||
let painter = ui.painter();
|
||||
let size = Vec2::splat(16.0);
|
||||
let (response, painter) = ui.allocate_painter(size, Sense::hover());
|
||||
let rect = response.rect;
|
||||
let c = rect.center();
|
||||
let r = rect.width() / 2.0 - 1.0;
|
||||
let color = Color32::from_gray(128);
|
||||
|
||||
Reference in New Issue
Block a user