Rename FontFamily::VariableWidth to FontFamily::Proportional
This commit is contained in:
parent
53ab2f4ef6
commit
847f67c835
2 changed files with 13 additions and 9 deletions
|
@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
### Changed 🔧
|
||||||
|
|
||||||
|
* Renamed `FontFamily::VariableWidth` to `FontFamily::Proportional`.
|
||||||
|
|
||||||
### Fixed 🐛
|
### Fixed 🐛
|
||||||
|
|
||||||
* `RepaintSignal` now implements `Sync` so it can be sent to a background thread.
|
* `RepaintSignal` now implements `Sync` so it can be sent to a background thread.
|
||||||
|
|
|
@ -43,14 +43,14 @@ impl TextStyle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Which style of font: [`Monospace`][`FontFamily::Monospace`] or [`VariableWidth`][`FontFamily::VariableWidth`].
|
/// Which style of font: [`Monospace`][`FontFamily::Monospace`] or [`Proportional`][`FontFamily::Proportional`].
|
||||||
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||||
// #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
// #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||||
pub enum FontFamily {
|
pub enum FontFamily {
|
||||||
/// A font where each character is the same width (`w` is the same width as `i`).
|
/// A font where each character is the same width (`w` is the same width as `i`).
|
||||||
Monospace,
|
Monospace,
|
||||||
/// A font where some characters are wider than other (e.g. 'w' is wider than 'i').
|
/// A font where some characters are wider than other (e.g. 'w' is wider than 'i').
|
||||||
VariableWidth,
|
Proportional,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The data of a `.ttf` or `.otf` file.
|
/// The data of a `.ttf` or `.otf` file.
|
||||||
|
@ -76,7 +76,7 @@ fn rusttype_font_from_font_data(name: &str, data: &FontData) -> rusttype::Font<'
|
||||||
/// // Large button text:
|
/// // Large button text:
|
||||||
/// fonts.family_and_size.insert(
|
/// fonts.family_and_size.insert(
|
||||||
/// egui::TextStyle::Button,
|
/// egui::TextStyle::Button,
|
||||||
/// (egui::FontFamily::VariableWidth, 32.0));
|
/// (egui::FontFamily::Proportional, 32.0));
|
||||||
/// ctx.set_fonts(fonts);
|
/// ctx.set_fonts(fonts);
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
|
@ -152,7 +152,7 @@ impl FontDefinitions {
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
fonts_for_family.insert(
|
fonts_for_family.insert(
|
||||||
FontFamily::VariableWidth,
|
FontFamily::Proportional,
|
||||||
vec![
|
vec![
|
||||||
"Ubuntu-Light".to_owned(),
|
"Ubuntu-Light".to_owned(),
|
||||||
"NotoEmoji-Regular".to_owned(),
|
"NotoEmoji-Regular".to_owned(),
|
||||||
|
@ -164,14 +164,14 @@ impl FontDefinitions {
|
||||||
#[cfg(not(feature = "default_fonts"))]
|
#[cfg(not(feature = "default_fonts"))]
|
||||||
{
|
{
|
||||||
fonts_for_family.insert(FontFamily::Monospace, vec![]);
|
fonts_for_family.insert(FontFamily::Monospace, vec![]);
|
||||||
fonts_for_family.insert(FontFamily::VariableWidth, vec![]);
|
fonts_for_family.insert(FontFamily::Proportional, vec![]);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut family_and_size = BTreeMap::new();
|
let mut family_and_size = BTreeMap::new();
|
||||||
family_and_size.insert(TextStyle::Small, (FontFamily::VariableWidth, 10.0));
|
family_and_size.insert(TextStyle::Small, (FontFamily::Proportional, 10.0));
|
||||||
family_and_size.insert(TextStyle::Body, (FontFamily::VariableWidth, 14.0));
|
family_and_size.insert(TextStyle::Body, (FontFamily::Proportional, 14.0));
|
||||||
family_and_size.insert(TextStyle::Button, (FontFamily::VariableWidth, 16.0));
|
family_and_size.insert(TextStyle::Button, (FontFamily::Proportional, 16.0));
|
||||||
family_and_size.insert(TextStyle::Heading, (FontFamily::VariableWidth, 20.0));
|
family_and_size.insert(TextStyle::Heading, (FontFamily::Proportional, 20.0));
|
||||||
family_and_size.insert(TextStyle::Monospace, (FontFamily::Monospace, 13.0)); // 13 for `ProggyClean`
|
family_and_size.insert(TextStyle::Monospace, (FontFamily::Monospace, 13.0)); // 13 for `ProggyClean`
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|
Loading…
Reference in a new issue