windows: Support all OpenType font features (#10756)

Release Notes:

- Added support for all `OpenType` font features to DirectWrite.



https://github.com/zed-industries/zed/assets/14981363/cb2848cd-9178-4d87-881a-54dc646b2b61

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
张小白 2024-04-27 04:58:12 +08:00 committed by GitHub
parent 268cb948a7
commit 11dc3c2582
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 114 additions and 25 deletions

View file

@ -90,7 +90,7 @@ impl PlatformTextSystem for CosmicTextSystem {
let candidates = if let Some(font_ids) = state.font_ids_by_family_cache.get(&font.family) {
font_ids.as_slice()
} else {
let font_ids = state.load_family(&font.family, font.features)?;
let font_ids = state.load_family(&font.family, &font.features)?;
state
.font_ids_by_family_cache
.insert(font.family.clone(), font_ids);
@ -211,7 +211,7 @@ impl CosmicTextSystemState {
fn load_family(
&mut self,
name: &str,
_features: FontFeatures,
_features: &FontFeatures,
) -> Result<SmallVec<[FontId; 4]>> {
// TODO: Determine the proper system UI font.
let name = if name == ".SystemUIFont" {