Remove monospaced from attrs

This commit is contained in:
Jeremy Soller 2023-03-30 08:04:52 -06:00
parent 521acb64e0
commit 3c7dc1f657
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
5 changed files with 17 additions and 29 deletions

View file

@ -93,7 +93,6 @@ pub struct Attrs<'a> {
//TODO: should this be an option?
pub color_opt: Option<Color>,
pub family: Family<'a>,
pub monospaced: bool,
pub stretch: Stretch,
pub style: Style,
pub weight: Weight,
@ -108,7 +107,6 @@ impl<'a> Attrs<'a> {
Self {
color_opt: None,
family: Family::SansSerif,
monospaced: false,
stretch: Stretch::Normal,
style: Style::Normal,
weight: Weight::NORMAL,
@ -128,12 +126,6 @@ impl<'a> Attrs<'a> {
self
}
/// Set monospaced
pub fn monospaced(mut self, monospaced: bool) -> Self {
self.monospaced = monospaced;
self
}
/// Set [Stretch]
pub fn stretch(mut self, stretch: Stretch) -> Self {
self.stretch = stretch;
@ -164,14 +156,12 @@ impl<'a> Attrs<'a> {
face.post_script_name.contains("Emoji")
|| (face.style == self.style
&& face.weight == self.weight
&& face.stretch == self.stretch
&& face.monospaced == self.monospaced)
&& face.stretch == self.stretch)
}
/// Check if this set of attributes can be shaped with another
pub fn compatible(&self, other: &Self) -> bool {
self.family == other.family
&& self.monospaced == other.monospaced
&& self.stretch == other.stretch
&& self.style == other.style
&& self.weight == other.weight
@ -184,7 +174,6 @@ pub struct AttrsOwned {
//TODO: should this be an option?
pub color_opt: Option<Color>,
pub family_owned: FamilyOwned,
pub monospaced: bool,
pub stretch: Stretch,
pub style: Style,
pub weight: Weight,
@ -196,7 +185,6 @@ impl AttrsOwned {
Self {
color_opt: attrs.color_opt,
family_owned: FamilyOwned::new(attrs.family),
monospaced: attrs.monospaced,
stretch: attrs.stretch,
style: attrs.style,
weight: attrs.weight,
@ -208,7 +196,6 @@ impl AttrsOwned {
Attrs {
color_opt: self.color_opt,
family: self.family_owned.as_family(),
monospaced: self.monospaced,
stretch: self.stretch,
style: self.style,
weight: self.weight,