Vlad Gaevsky and Chris Biscardi
55387ea4b7
gpui_windows: Keep DirectWrite's default ligatures when no font features are set ( #62338 )
...
On Windows, ligatures are off by default: they only show up if
`buffer_font_features` is set to something non-empty.
`generate_font_features` always creates an `IDWriteTypography` and
passes it to `apply_font_features` (`direct_write.rs:446-452`), and the
layout code calls `SetTypography` with it unconditionally (`:567`,
`:605`). `apply_font_features` returned early when no features were
configured, so an empty typography object reached DirectWrite.
`SetTypography` replaces the default feature set with exactly what the
typography contains, so `liga`, `clig` and `calt` ended up disabled.
Dropping the early return lets the rest of the function run, which adds
`liga`, `clig` and `calt` at 1. Users who configure features explicitly
are unaffected: that path already ran before this change, and an
explicit `liga: 0` still resolves to 0 through the same loop.
I went with this rather than guarding the two `SetTypography` calls,
because the function already owns the knowledge of which features
DirectWrite enables by default for the non-empty case, and guarding the
call sites would duplicate it in two places.
Other platforms are not affected: `generate_feature_array` on macOS
(`gpui_macos/src/open_type.rs:77`) appends one dictionary per configured
tag and does not replace the default feature set when the list is empty.
No test here: `apply_font_features` takes a live `IDWriteTypography`
from `CreateTypography()`, so covering it needs a real DirectWrite
factory and cannot run off Windows. I can extract the tag resolution
into a pure function and unit test that separately if you would prefer
it.
Checked on a Windows build with no `buffer_font_features` set: ligatures
render with this change and are absent without it.
Release Notes:
- Fixed ligatures being disabled on Windows unless
`buffer_font_features` was set
- [GPUI] N/A
Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com >
2026-09-17 16:37:56 +00:00
..
2026-09-14 14:04:09 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-16 16:03:09 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 14:39:57 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-20 10:08:48 +00:00
2026-09-16 21:41:45 +00:00
2026-08-19 14:32:19 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-09 22:29:52 +00:00
2026-08-28 11:51:00 +00:00
2026-08-31 11:58:50 +00:00
2026-08-26 14:33:13 +00:00
2026-09-03 14:38:23 +00:00
2026-02-25 08:12:04 +01:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-27 16:21:41 +00:00
2026-06-05 10:32:57 +00:00
2026-09-15 09:58:45 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-28 18:06:41 +00:00
2026-09-15 23:25:47 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-26 14:33:13 +00:00
2026-08-20 10:08:48 +00:00
2026-04-24 10:29:51 +00:00
2026-09-17 08:49:31 +00:00
2026-05-13 23:35:10 +00:00
2026-09-08 07:12:28 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-27 12:55:42 +00:00
2026-08-09 22:29:52 +00:00
2026-09-17 08:49:31 +00:00
2026-09-07 19:01:41 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-07 16:23:05 +00:00
2026-09-16 23:26:23 +00:00
2026-06-05 19:24:28 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-11 09:13:44 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-07 19:01:41 +00:00
2026-09-07 19:01:41 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-27 16:21:41 +00:00
2026-08-27 20:11:28 +00:00
2026-09-17 08:49:31 +00:00
2026-02-19 18:57:49 +01:00
2026-09-07 15:18:49 +00:00
2026-07-30 12:59:16 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-20 10:08:48 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 16:37:56 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-26 21:36:59 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-20 10:08:48 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-16 19:16:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-16 16:03:30 +00:00
2026-09-16 09:00:29 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-27 16:21:41 +00:00
2026-09-09 14:31:14 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-26 14:33:13 +00:00
2026-09-17 01:46:02 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-16 16:02:58 +00:00
2026-09-09 13:47:28 +00:00
2026-09-16 16:04:13 +00:00
2026-09-09 14:31:14 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-02 18:21:25 +00:00
2026-09-11 21:33:11 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-16 16:04:24 +00:00
2026-08-20 10:08:48 +00:00
2026-09-08 21:44:06 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-28 03:28:04 +00:00
2026-09-12 19:03:48 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-16 16:03:09 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-06-13 05:21:05 +00:00
2026-09-17 08:49:31 +00:00
2026-09-07 19:01:41 +00:00
2026-09-15 16:33:57 +00:00
2026-08-28 11:51:00 +00:00
2026-09-17 08:49:31 +00:00
2026-09-09 14:55:56 +00:00
2026-07-23 22:46:06 +00:00
2026-09-10 17:54:38 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-07 15:18:49 +00:00
2026-09-17 08:49:31 +00:00
2026-09-16 16:03:26 +00:00
2026-09-07 19:01:41 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-11 09:13:44 +00:00
2026-09-17 08:49:31 +00:00
2026-08-31 13:35:07 +00:00
2026-08-20 10:08:48 +00:00
2026-08-31 11:41:34 +00:00
2026-08-24 10:41:04 +00:00
2026-09-15 11:49:56 +00:00
2026-09-17 09:17:09 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-06-23 09:33:47 +00:00
2026-09-17 09:17:09 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-07-20 11:17:43 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-20 10:08:48 +00:00
2026-09-17 08:49:31 +00:00
2026-08-28 03:28:04 +00:00
2026-09-17 08:49:31 +00:00
2026-09-09 09:09:25 +00:00
2026-09-17 08:49:31 +00:00
2026-08-18 07:58:21 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-08-27 06:40:50 +00:00
2026-09-07 15:18:49 +00:00
2026-08-28 18:05:57 +00:00
2026-09-11 15:19:53 +00:00
2026-09-17 08:49:31 +00:00
2026-07-29 20:59:24 +00:00
2026-08-27 16:21:41 +00:00
2026-09-11 15:19:53 +00:00
2026-05-28 19:43:30 +00:00
2026-09-16 21:41:45 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 14:39:57 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-16 16:03:18 +00:00
2026-09-17 08:49:31 +00:00
2026-09-15 15:27:26 +00:00
2026-09-17 08:49:31 +00:00
2026-09-10 06:33:43 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 09:17:09 +00:00
2026-09-17 08:49:31 +00:00
2026-09-16 16:03:50 +00:00
2026-09-17 08:49:31 +00:00
2026-09-07 19:01:41 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-16 16:00:19 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00
2026-09-17 08:49:31 +00:00