Fix missing buffer font features in Blame UI, Hover Popover and Markdown Preview (#44657)

- Fix missing font features in 
  `git_ui::blame_ui::GitBlameRenderer.render_blame_entry`
- Fix missing buffer font features in
`markdown_preview::markdown_renderer`
- Update the way that the markdown style is built for hover popovers so
  that, for code blocks, the buffer font features are used.
- Introduce `gpui::Styled.font_features` to allow callers to also set
  the font's features, similar to how `gpui::Styled.font_family` already
  exists.

Relates to #44209

Release Notes:

- Fixed wrong font features in Blame UI, Hover Popover and Markdown
Preview
This commit is contained in:
Dino
2025-12-12 09:55:06 +00:00
committed by GitHub
parent 1186b50ca4
commit 12073e10f8
4 changed files with 26 additions and 6 deletions
@@ -75,8 +75,10 @@ impl RenderContext {
let settings = ThemeSettings::get_global(cx);
let buffer_font_family = settings.buffer_font.family.clone();
let buffer_font_features = settings.buffer_font.features.clone();
let mut buffer_text_style = window.text_style();
buffer_text_style.font_family = buffer_font_family.clone();
buffer_text_style.font_features = buffer_font_features;
buffer_text_style.font_size = AbsoluteLength::from(settings.buffer_font_size(cx));
RenderContext {
@@ -631,8 +633,14 @@ fn render_markdown_code_block(
.tooltip(Tooltip::text("Copy code block"))
.visible_on_hover("markdown-block");
let font = gpui::Font {
family: cx.buffer_font_family.clone(),
features: cx.buffer_text_style.font_features.clone(),
..Default::default()
};
cx.with_common_p(div())
.font_family(cx.buffer_font_family.clone())
.font(font)
.px_3()
.py_3()
.bg(cx.code_block_background_color)