Replace text_font_family with font in markdown
This commit is contained in:
parent
7e8c1c916f
commit
c80b62790f
1 changed files with 5 additions and 9 deletions
|
|
@ -320,7 +320,6 @@ impl Span {
|
||||||
.padding(style.inline_code_padding)
|
.padding(style.inline_code_padding)
|
||||||
} else if *strong || *emphasis {
|
} else if *strong || *emphasis {
|
||||||
span.font(Font {
|
span.font(Font {
|
||||||
family: style.text_font_family,
|
|
||||||
weight: if *strong {
|
weight: if *strong {
|
||||||
font::Weight::Bold
|
font::Weight::Bold
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -331,13 +330,10 @@ impl Span {
|
||||||
} else {
|
} else {
|
||||||
font::Style::Normal
|
font::Style::Normal
|
||||||
},
|
},
|
||||||
..Font::default()
|
..style.font
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
span.font(Font {
|
span.font(style.font)
|
||||||
family: style.text_font_family,
|
|
||||||
..Font::default()
|
|
||||||
})
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(link) = link.as_ref() {
|
if let Some(link) = link.as_ref() {
|
||||||
|
|
@ -1050,8 +1046,8 @@ impl From<Theme> for Settings {
|
||||||
/// The text styling of some Markdown rendering in [`view`].
|
/// The text styling of some Markdown rendering in [`view`].
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct Style {
|
pub struct Style {
|
||||||
/// The [`font::Family`] to be applied to non-code text.
|
/// The [`Font`] to be applied to basic text.
|
||||||
pub text_font_family: font::Family,
|
pub font: Font,
|
||||||
/// The [`Highlight`] to be applied to the background of inline code.
|
/// The [`Highlight`] to be applied to the background of inline code.
|
||||||
pub inline_code_highlight: Highlight,
|
pub inline_code_highlight: Highlight,
|
||||||
/// The [`Padding`] to be applied to the background of inline code.
|
/// The [`Padding`] to be applied to the background of inline code.
|
||||||
|
|
@ -1070,7 +1066,7 @@ impl Style {
|
||||||
/// Creates a new [`Style`] from the given [`theme::Palette`].
|
/// Creates a new [`Style`] from the given [`theme::Palette`].
|
||||||
pub fn from_palette(palette: theme::Palette) -> Self {
|
pub fn from_palette(palette: theme::Palette) -> Self {
|
||||||
Self {
|
Self {
|
||||||
text_font_family: font::Family::default(),
|
font: Font::default(),
|
||||||
inline_code_padding: padding::left(1).right(1),
|
inline_code_padding: padding::left(1).right(1),
|
||||||
inline_code_highlight: Highlight {
|
inline_code_highlight: Highlight {
|
||||||
background: color!(0x111111).into(),
|
background: color!(0x111111).into(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue