zed icon indicating copy to clipboard operation
zed copied to clipboard

windows: Introduce `Direct Write`

Open JunkuiZhang opened this issue 10 months ago • 5 comments

This PR brings Direct Write to Zed. Now, Zed first trys to query dwrite interface, if not supported, which means runing on Windows below win10 1703), will choose cosmic as a fallback text system.

This direct write text system supports:

  • Full font features support
  • Emoji support
  • Default system fonts as fallback

Font features

https://github.com/zed-industries/zed/assets/14981363/198eff88-47df-4bc8-a257-e3acf81fd61d

Emoji

Screenshot 2024-04-03 211354

Note: input emoji through IME or IMM not working yet, copy paste emoji works fine (will be fixed by #10125 )

Font fallback

I use Zed mono which dose not support chinese chars to test font fallback

https://github.com/zed-industries/zed/assets/14981363/c97d0847-0ac5-47e6-aa00-f3ce6d1e50a5

Release Notes:

  • N/A

JunkuiZhang avatar Apr 03 '24 13:04 JunkuiZhang

gave your branch a try! Noticed a couple things

1. Italicized text with Fira Code font

I'm using a pretty popular font called Fira Code, but specifically the modified one by 'nerd-fonts' https://github.com/ryanoasis/nerd-fonts. I'm not sure if the modified version has to do with it, but all my text is italicized now with this pull request.

main direct write branch
image image

2. Random panic

When clicking into the window after doing cargo run and the window is in the background I get this panic.

Panic Stack
Thread "main" panicked with "called `Result::unwrap()` on an `Err` value: Error
{ code: HRESULT(0x80070057), message: \"The parameter is incorrect.\" }" at crates\gpui\src\platform\windows\direct_write.rs:343:22
   0: backtrace::backtrace::dbghelp::trace
             at C:\Users\zekew\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.69\src\backtrace\dbghelp.rs:98
   1: backtrace::backtrace::trace_unsynchronized<:capture::impl>
             at C:\Users\zekew\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.69\src\backtrace\mod.rs:66
   2: backtrace::backtrace::trace<:capture::impl>
             at C:\Users\zekew\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.69\src\backtrace\mod.rs:53
   3: backtrace::capture::Backtrace::create
             at C:\Users\zekew\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.69\src\capture.rs:176
   4: backtrace::capture::Backtrace::new
             at C:\Users\zekew\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.69\src\capture.rs:140
   5: Zed::init_panic_hook::closure$0
             at crates\zed\src\main.rs:674
   6: alloc::boxed::impl$49::call
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\alloc\src\boxed.rs:2029
   7: std::panicking::rust_panic_with_hook
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:785
   8: std::panicking::begin_panic_handler::closure$0
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:659
   9: std::sys_common::backtrace::__rust_end_short_backtrace<:panicking::begin_panic_handler::closure_env>
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\sys_common\backtrace.rs:171
  10: std::panicking::begin_panic_handler
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:647
  11: core::panicking::panic_fmt
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\core\src\panicking.rs:72
  12: core::result::unwrap_failed
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\core\src\result.rs:1649
  13: core::result::Result::unwrap
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\core\src\result.rs:1073
  14: gpui::platform::windows::direct_write::DirectWriteState::layout_line
             at crates\gpui\src\platform\windows\direct_write.rs:331
  15: gpui::platform::windows::direct_write::impl$2::layout_line
             at crates\gpui\src\platform\windows\direct_write.rs:160
  16: gpui::text_system::line_layout::LineLayoutCache::layout_line
             at crates\gpui\src\text_system\line_layout.rs:437
  17: gpui::text_system::WindowTextSystem::layout_line
             at crates\gpui\src\text_system.rs:500
  18: gpui::text_system::WindowTextSystem::shape_line
             at crates\gpui\src\text_system.rs:352
  19: editor::element::impl$1::layout_cursors::closure$0::closure$0
             at crates\editor\src\element.rs:895
  20: core::option::Option::and_then,gpui::text_system::line::ShapedLine,editor::element::impl$1::layout_cursors::closure$0::closure_env$0>
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\core\src\option.rs:1406
  21: editor::element::impl$1::layout_cursors::closure$0
             at crates\editor\src\element.rs:879
  22: gpui::window::impl$20::update_view<:editor>,editor::element::impl$1::layout_cursors::closure_env$0>
             at crates\gpui\src\window.rs:1943
  23: gpui::window::element_cx::impl$11::update_view<:editor>,editor::element::impl$1::layout_cursors::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:336
  24: gpui::view::View::update<:editor>,editor::element::impl$1::layout_cursors::closure_env$0>
             at crates\gpui\src\view.rs:75
  25: editor::element::EditorElement::layout_cursors
             at crates\editor\src\element.rs:856
  26: editor::element::impl$5::after_layout::closure$0::closure$0
             at crates\editor\src\element.rs:3572
  27: gpui::window::element_cx::ElementContext::with_content_mask<:element::editorlayout>
             at crates\gpui\src\window\element_cx.rs:642
  28: editor::element::impl$5::after_layout::closure$0
             at crates\editor\src\element.rs:3344
  29: gpui::window::element_cx::ElementContext::with_text_style<:element::impl>
             at crates\gpui\src\window\element_cx.rs:587
  30: editor::element::impl$5::after_layout
             at crates\editor\src\element.rs:3343
  31: gpui::element::Drawable::after_layout<:element::editorelement>
             at crates\gpui\src\element.rs:291
  32: gpui::element::impl$6::after_layout<:element::editorelement>
             at crates\gpui\src\element.rs:381
  33: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
  34: gpui::view::impl$16::after_layout::closure$1
             at crates\gpui\src\view.rs:350
  35: gpui::window::element_cx::ElementContext::with_element_id >,enum2$<:window::elementid>,gpui::view::impl$16::after_layout::closure_env$1>
             at crates\gpui\src\window\element_cx.rs:623
  36: gpui::view::impl$16::after_layout
             at crates\gpui\src\view.rs:348
  37: gpui::element::Drawable::after_layout<:view::anyview>
             at crates\gpui\src\element.rs:291
  38: gpui::element::impl$6::after_layout<:view::anyview>
             at crates\gpui\src\element.rs:381
  39: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
  40: gpui::elements::div::impl$5::after_layout::closure$0::closure$0
             at crates\gpui\src\elements\div.rs:1148
  41: gpui::window::element_cx::ElementContext::with_element_offset,gpui::elements::div::impl$5::after_layout::closure$0::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:658
  42: gpui::elements::div::impl$5::after_layout::closure$0
             at crates\gpui\src\elements\div.rs:1146
  43: gpui::elements::div::impl$7::after_layout::closure$0::closure$1::closure$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1339
  44: gpui::window::element_cx::ElementContext::with_content_mask >,enum2$<:option::option> > >,gpui::elements::div::impl$7::after_layout::clo
             at crates\gpui\src\window\element_cx.rs:646
  45: gpui::elements::div::impl$7::after_layout::closure$0::closure$1 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1331
  46: gpui::window::element_cx::ElementContext::with_text_style<:elements::div::impl> >,gpui::elements::div::impl$5::after_layout::closure_env$0>,tuple$ >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1330
  48: gpui::window::element_cx::impl$12::with_element_state::closure$0<:elements::div::interactiveelementstate> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,enum2$<:window::elementid>,gpui::window::element_cx::impl$12::with_element_state::closure_env$0<:elements::div::interactive at crates gpui::window::element_cx::elementcontext::with_element_state> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1308
  52: gpui::elements::div::impl$5::after_layout
             at crates\gpui\src\elements\div.rs:1141
  53: gpui::element::Drawable::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:291
  54: gpui::element::impl$6::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:381
  55: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
  56: gpui::elements::div::impl$5::after_layout::closure$0::closure$0
             at crates\gpui\src\elements\div.rs:1148
  57: gpui::window::element_cx::ElementContext::with_element_offset,gpui::elements::div::impl$5::after_layout::closure$0::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:658
  58: gpui::elements::div::impl$5::after_layout::closure$0
             at crates\gpui\src\elements\div.rs:1146
  59: gpui::elements::div::impl$7::after_layout::closure$0::closure$1::closure$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1339
  60: gpui::window::element_cx::ElementContext::with_content_mask >,enum2$<:option::option> > >,gpui::elements::div::impl$7::after_layout::clo
             at crates\gpui\src\window\element_cx.rs:642
  61: gpui::elements::div::impl$7::after_layout::closure$0::closure$1 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1331
  62: gpui::window::element_cx::ElementContext::with_text_style<:elements::div::impl> >,gpui::elements::div::impl$5::after_layout::closure_env$0>,tuple$ >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1330
  64: gpui::window::element_cx::impl$12::with_element_state::closure$0<:elements::div::interactiveelementstate> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,enum2$<:window::elementid>,gpui::window::element_cx::impl$12::with_element_state::closure_env$0<:elements::div::interactive at crates gpui::window::element_cx::elementcontext::with_element_state> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1308
  68: gpui::elements::div::impl$5::after_layout
             at crates\gpui\src\elements\div.rs:1141
  69: gpui::element::Drawable::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:291
  70: gpui::element::impl$6::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:381
  71: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
  72: gpui::element::impl$7::layout::closure$0
             at crates\gpui\src\element.rs:450
  73: gpui::window::element_cx::ElementContext::with_absolute_element_offset,gpui::element::impl$7::layout::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:676
  74: gpui::element::AnyElement::layout
             at crates\gpui\src\element.rs:450
  75: gpui::view::impl$16::after_layout::closure$0
             at crates\gpui\src\view.rs:330
  76: gpui::window::element_cx::impl$12::with_element_state::closure$0<:view::anyviewstate> >,gpui::view::impl$16::after_layout::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:857
  77: gpui::window::element_cx::ElementContext::with_element_id >,enum2$<:window::elementid>,gpui::window::element_cx::impl$12::with_element_state::closure_env$0<:view::anyviewstate at crates gpui::window::element_cx::elementcontext::with_element_state> >,gpui::view::impl$16::after_layout::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:802
  79: gpui::view::impl$16::after_layout
             at crates\gpui\src\view.rs:305
  80: gpui::element::Drawable::after_layout<:view::anyview>
             at crates\gpui\src\element.rs:291
  81: gpui::element::impl$6::after_layout<:view::anyview>
             at crates\gpui\src\element.rs:381
  82: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
  83: gpui::elements::div::impl$5::after_layout::closure$0::closure$0
             at crates\gpui\src\elements\div.rs:1148
  84: gpui::window::element_cx::ElementContext::with_element_offset,gpui::elements::div::impl$5::after_layout::closure$0::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:658
  85: gpui::elements::div::impl$5::after_layout::closure$0
             at crates\gpui\src\elements\div.rs:1146
  86: gpui::elements::div::impl$7::after_layout::closure$0::closure$1::closure$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1339
  87: gpui::window::element_cx::ElementContext::with_content_mask >,enum2$<:option::option> > >,gpui::elements::div::impl$7::after_layout::clo
             at crates\gpui\src\window\element_cx.rs:646
  88: gpui::elements::div::impl$7::after_layout::closure$0::closure$1 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1331
  89: gpui::window::element_cx::ElementContext::with_text_style<:elements::div::impl> >,gpui::elements::div::impl$5::after_layout::closure_env$0>,tuple$ >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1330
  91: gpui::window::element_cx::impl$12::with_element_state::closure$0<:elements::div::interactiveelementstate> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,enum2$<:window::elementid>,gpui::window::element_cx::impl$12::with_element_state::closure_env$0<:elements::div::interactive at crates gpui::window::element_cx::elementcontext::with_element_state> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1308
  95: gpui::elements::div::impl$5::after_layout
             at crates\gpui\src\elements\div.rs:1141
  96: gpui::element::Drawable::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:291
  97: gpui::element::impl$6::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:381
  98: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
  99: gpui::element::impl$7::layout::closure$0
             at crates\gpui\src\element.rs:450
 100: gpui::window::element_cx::ElementContext::with_absolute_element_offset,gpui::element::impl$7::layout::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:676
 101: gpui::element::AnyElement::layout
             at crates\gpui\src\element.rs:450
 102: workspace::pane_group::element::impl$2::after_layout
             at crates\workspace\src\pane_group.rs:875
 103: gpui::element::Drawable::after_layout<:pane_group::element::paneaxiselement>
             at crates\gpui\src\element.rs:291
 104: gpui::element::impl$6::after_layout<:pane_group::element::paneaxiselement>
             at crates\gpui\src\element.rs:381
 105: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
 106: gpui::element::impl$8::after_layout
             at crates\gpui\src\element.rs:470
 107: gpui::element::Drawable::after_layout<:element::anyelement>
             at crates\gpui\src\element.rs:291
 108: gpui::element::impl$6::after_layout<:element::anyelement>
             at crates\gpui\src\element.rs:381
 109: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
 110: gpui::element::impl$8::after_layout
             at crates\gpui\src\element.rs:470
 111: gpui::element::Drawable::after_layout<:element::anyelement>
             at crates\gpui\src\element.rs:291
 112: gpui::element::impl$6::after_layout<:element::anyelement>
             at crates\gpui\src\element.rs:381
 113: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
 114: gpui::elements::div::impl$5::after_layout::closure$0::closure$0
             at crates\gpui\src\elements\div.rs:1148
 115: gpui::window::element_cx::ElementContext::with_element_offset,gpui::elements::div::impl$5::after_layout::closure$0::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:658
 116: gpui::elements::div::impl$5::after_layout::closure$0
             at crates\gpui\src\elements\div.rs:1146
 117: gpui::elements::div::impl$7::after_layout::closure$0::closure$1::closure$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1339
 118: gpui::window::element_cx::ElementContext::with_content_mask >,enum2$<:option::option> > >,gpui::elements::div::impl$7::after_layout::clo
             at crates\gpui\src\window\element_cx.rs:642
 119: gpui::elements::div::impl$7::after_layout::closure$0::closure$1 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1331
 120: gpui::window::element_cx::ElementContext::with_text_style<:elements::div::impl> >,gpui::elements::div::impl$5::after_layout::closure_env$0>,tuple$ >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1330
 122: gpui::window::element_cx::impl$12::with_element_state::closure$0<:elements::div::interactiveelementstate> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,enum2$<:window::elementid>,gpui::window::element_cx::impl$12::with_element_state::closure_env$0<:elements::div::interactive at crates gpui::window::element_cx::elementcontext::with_element_state> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1308
 126: gpui::elements::div::impl$5::after_layout
             at crates\gpui\src\elements\div.rs:1141
 127: gpui::element::Drawable::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:291
 128: gpui::element::impl$6::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:381
 129: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
 130: gpui::elements::div::impl$5::after_layout::closure$0::closure$0
             at crates\gpui\src\elements\div.rs:1148
 131: gpui::window::element_cx::ElementContext::with_element_offset,gpui::elements::div::impl$5::after_layout::closure$0::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:658
 132: gpui::elements::div::impl$5::after_layout::closure$0
             at crates\gpui\src\elements\div.rs:1146
 133: gpui::elements::div::impl$7::after_layout::closure$0::closure$1::closure$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1339
 134: gpui::window::element_cx::ElementContext::with_content_mask >,enum2$<:option::option> > >,gpui::elements::div::impl$7::after_layout::clo
             at crates\gpui\src\window\element_cx.rs:646
 135: gpui::elements::div::impl$7::after_layout::closure$0::closure$1 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1331
 136: gpui::window::element_cx::ElementContext::with_text_style<:elements::div::impl> >,gpui::elements::div::impl$5::after_layout::closure_env$0>,tuple$ >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1330
 138: gpui::window::element_cx::impl$12::with_element_state::closure$0<:elements::div::interactiveelementstate> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,enum2$<:window::elementid>,gpui::window::element_cx::impl$12::with_element_state::closure_env$0<:elements::div::interactive at crates gpui::window::element_cx::elementcontext::with_element_state> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1308
 142: gpui::elements::div::impl$5::after_layout
             at crates\gpui\src\elements\div.rs:1141
 143: gpui::element::Drawable::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:291
 144: gpui::element::impl$6::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:381
 145: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
 146: gpui::elements::div::impl$5::after_layout::closure$0::closure$0
             at crates\gpui\src\elements\div.rs:1148
 147: gpui::window::element_cx::ElementContext::with_element_offset,gpui::elements::div::impl$5::after_layout::closure$0::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:658
 148: gpui::elements::div::impl$5::after_layout::closure$0
             at crates\gpui\src\elements\div.rs:1146
 149: gpui::elements::div::impl$7::after_layout::closure$0::closure$1::closure$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1339
 150: gpui::window::element_cx::ElementContext::with_content_mask >,enum2$<:option::option> > >,gpui::elements::div::impl$7::after_layout::clo
             at crates\gpui\src\window\element_cx.rs:642
 151: gpui::elements::div::impl$7::after_layout::closure$0::closure$1 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1331
 152: gpui::window::element_cx::ElementContext::with_text_style<:elements::div::impl> >,gpui::elements::div::impl$5::after_layout::closure_env$0>,tuple$ >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1330
 154: gpui::window::element_cx::impl$12::with_element_state::closure$0<:elements::div::interactiveelementstate> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,enum2$<:window::elementid>,gpui::window::element_cx::impl$12::with_element_state::closure_env$0<:elements::div::interactive at crates gpui::window::element_cx::elementcontext::with_element_state> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1308
 158: gpui::elements::div::impl$5::after_layout
             at crates\gpui\src\elements\div.rs:1141
 159: gpui::elements::div::impl$22::after_layout<:elements::div::div>
             at crates\gpui\src\elements\div.rs:2299
 160: gpui::element::Drawable::after_layout<:elements::div::stateful> >
             at crates\gpui\src\element.rs:291
 161: gpui::element::impl$6::after_layout<:elements::div::stateful> >
             at crates\gpui\src\element.rs:381
 162: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
 163: gpui::elements::div::impl$5::after_layout::closure$0::closure$0
             at crates\gpui\src\elements\div.rs:1148
 164: gpui::window::element_cx::ElementContext::with_element_offset,gpui::elements::div::impl$5::after_layout::closure$0::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:658
 165: gpui::elements::div::impl$5::after_layout::closure$0
             at crates\gpui\src\elements\div.rs:1146
 166: gpui::elements::div::impl$7::after_layout::closure$0::closure$1::closure$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1339
 167: gpui::window::element_cx::ElementContext::with_content_mask >,enum2$<:option::option> > >,gpui::elements::div::impl$7::after_layout::clo
             at crates\gpui\src\window\element_cx.rs:646
 168: gpui::elements::div::impl$7::after_layout::closure$0::closure$1 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1331
 169: gpui::window::element_cx::ElementContext::with_text_style<:elements::div::impl> >,gpui::elements::div::impl$5::after_layout::closure_env$0>,tuple$ >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1330
 171: gpui::window::element_cx::impl$12::with_element_state::closure$0<:elements::div::interactiveelementstate> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,enum2$<:window::elementid>,gpui::window::element_cx::impl$12::with_element_state::closure_env$0<:elements::div::interactive at crates gpui::window::element_cx::elementcontext::with_element_state> >,gpui::elements::div::impl$7::after_layout::closure_env$0 >,gpui::elements::div::impl$5::after_layout::closure_env$0>
             at crates\gpui\src\elements\div.rs:1308
 175: gpui::elements::div::impl$5::after_layout
             at crates\gpui\src\elements\div.rs:1141
 176: gpui::element::Drawable::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:291
 177: gpui::element::impl$6::after_layout<:elements::div::div>
             at crates\gpui\src\element.rs:381
 178: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
 179: gpui::view::impl$16::after_layout::closure$1
             at crates\gpui\src\view.rs:350
 180: gpui::window::element_cx::ElementContext::with_element_id >,enum2$<:window::elementid>,gpui::view::impl$16::after_layout::closure_env$1>
             at crates\gpui\src\window\element_cx.rs:623
 181: gpui::view::impl$16::after_layout
             at crates\gpui\src\view.rs:348
 182: gpui::element::Drawable::after_layout<:view::anyview>
             at crates\gpui\src\element.rs:291
 183: gpui::element::impl$6::after_layout<:view::anyview>
             at crates\gpui\src\element.rs:381
 184: gpui::element::AnyElement::after_layout
             at crates\gpui\src\element.rs:425
 185: gpui::element::impl$7::layout::closure$0
             at crates\gpui\src\element.rs:450
 186: gpui::window::element_cx::ElementContext::with_absolute_element_offset,gpui::element::impl$7::layout::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:676
 187: gpui::element::AnyElement::layout
             at crates\gpui\src\element.rs:450
 188: gpui::window::element_cx::ElementContext::draw_roots
             at crates\gpui\src\window\element_cx.rs:370
 189: gpui::window::impl$17::draw::closure$0
             at crates\gpui\src\window.rs:1031
 190: gpui::window::WindowContext::with_element_context,gpui::window::impl$17::draw::closure_env$0>
             at crates\gpui\src\window\element_cx.rs:215
 191: gpui::window::WindowContext::draw
             at crates\gpui\src\window.rs:1031
 192: gpui::window::impl$15::new::closure$2::closure$1::closure$0
             at crates\gpui\src\window.rs:471
 193: gpui::app::impl$5::update_window::closure$0,gpui::window::impl$15::new::closure$2::closure$1::closure_env$0>
             at crates\gpui\src\app.rs:1310
 194: gpui::app::AppContext::update,anyhow::Error> >,gpui::app::impl$5::update_window::closure_env$0,gpui::window::impl$15::new::closure$2::closure$1::closure_env$0> >
             at crates\gpui\src\app.rs:363
 195: gpui::app::impl$5::update_window,gpui::window::impl$15::new::closure$2::closure$1::closure_env$0>
             at crates\gpui\src\app.rs:1301
 196: gpui::app::async_context::impl$0::update_window,gpui::window::impl$15::new::closure$2::closure$1::closure_env$0>
             at crates\gpui\src\app\async_context.rs:92
 197: gpui::window::AnyWindowHandle::update<:app::async_context::asyncappcontext>,gpui::window::impl$15::new::closure$2::closure$1::closure_env$0>
             at crates\gpui\src\window.rs:2775
 198: gpui::window::impl$15::new::closure$2::closure$1
             at crates\gpui\src\window.rs:469
 199: util::measure,gpui::window::impl$15::new::closure$2::closure_env$1>
             at crates\util\src\util.rs:212
 200: gpui::window::impl$15::new::closure$2
             at crates\gpui\src\window.rs:468
 201: alloc::boxed::impl$48::call_mut,dyn$<:ops::function::fnmut>,assoc$ > > >,alloc::alloc::Global>
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\alloc\src\boxed.rs:2022
 202: gpui::platform::windows::window::WindowsWindowInner::handle_paint_msg
             at crates\gpui\src\platform\windows\window.rs:358
 203: gpui::platform::windows::window::WindowsWindowInner::handle_msg
             at crates\gpui\src\platform\windows\window.rs:262
 204: gpui::platform::windows::window::wnd_proc
             at crates\gpui\src\platform\windows\window.rs:1765
 205: DispatchMessageW
 206: CallWindowProcW
 207: wglSwapBuffers
 208: DispatchMessageW
 209: DispatchMessageW
 210: GetClassLongW
 211: KiUserCallbackDispatcher
 212: NtUserRedrawWindow
 213: windows::Win32::Graphics::Gdi::RedrawWindow<:win32::foundation::hwnd>
             at C:\Users\zekew\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.53.0\src\Windows\Win32\Graphics\Gdi\mod.rs:2392
 214: gpui::platform::windows::platform::WindowsPlatform::redraw_all
             at crates\gpui\src\platform\windows\platform.rs:194
 215: gpui::platform::windows::platform::impl$3::run
             at crates\gpui\src\platform\windows\platform.rs:238
 216: gpui::app::App::run<:main::closure_env>
             at crates\gpui\src\app.rs:142
 217: Zed::main
             at crates\zed\src\main.rs:160
 218: core::ops::function::FnOnce::call_once >
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\core\src\ops\function.rs:250
 219: std::sys_common::backtrace::__rust_begin_short_backtrace >
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\std\src\sys_common\backtrace.rs:155
 220: std::sys_common::backtrace::__rust_begin_short_backtrace >
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\std\src\sys_common\backtrace.rs:155
 221: std::rt::lang_start::closure$0 >
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\std\src\rt.rs:166
 222: std::rt::lang_start_internal::closure$2
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\rt.rs:148
 223: std::panicking::try::do_call
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:554
 224: std::panicking::try
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:518
 225: std::panic::catch_unwind
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panic.rs:142
 226: std::rt::lang_start_internal
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\rt.rs:148
 227: std::rt::lang_start >
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\std\src\rt.rs:165
 228: main
 229: invoke_main
             at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
 230: __scrt_common_main_seh
             at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
 231: BaseThreadInitThunk
 232: RtlUserThreadStart
 

I got it without the reproducing steps above as well, but I don't remeber how.

zaucy avatar Apr 12 '24 19:04 zaucy

@zaucy Thank you for this feedback! Im looking into it.

JunkuiZhang avatar Apr 13 '24 13:04 JunkuiZhang

@zaucy I use the official fira code font with One Dark theme, it seems good. Screenshot 2024-04-13 220224

Could you share the font files and themes you are using? This would help me quickly debug.

JunkuiZhang avatar Apr 13 '24 14:04 JunkuiZhang

@JunkuiZhang its fira code from the nerd fonts repository I linked above. here: https://github.com/ryanoasis/nerd-fonts/releases/tag/v3.2.1

I updated to the latest to make sure and it is still italicized. Doesn't matter what theme I use. This is from One Dark image

zaucy avatar Apr 14 '24 19:04 zaucy

@zaucy This "italicized" bug dose not happen on my side, could you share your setting.json file?

https://github.com/zed-industries/zed/assets/14981363/52c76eb4-f2c4-466b-9a9e-ebc4588d7592

JunkuiZhang avatar Apr 15 '24 01:04 JunkuiZhang

Thank you!

mikayla-maki avatar Apr 18 '24 18:04 mikayla-maki