windows: Introduce Direct Write (#10119)

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](https://github.com/zed-industries/zed/assets/14981363/a5bc5845-42e8-4af1-af7e-abba598c1e72)

**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
This commit is contained in:
张小白 2024-04-19 02:58:46 +08:00 committed by GitHub
parent 1127b1a0de
commit 11a3d2b04b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 1329 additions and 8 deletions

View file

@ -125,8 +125,11 @@ impl Platform for TestPlatform {
#[cfg(target_os = "macos")]
return Arc::new(crate::platform::mac::MacTextSystem::new());
#[cfg(not(target_os = "macos"))]
#[cfg(target_os = "linux")]
return Arc::new(crate::platform::cosmic_text::CosmicTextSystem::new());
#[cfg(target_os = "windows")]
return Arc::new(crate::platform::windows::DirectWriteTextSystem::new().unwrap());
}
fn run(&self, _on_finish_launching: Box<dyn FnOnce()>) {