Use IBM Plex Sans / Lilex (#36084)

The Zed Plex fonts were found to violate the OFL by using the word Plex
in the name.

Lilex has better ligatures and box-drawing characters than Zed Plex
Mono, but Zed Plex Sans should be identical
to IBM Plex Sans.

Closes #15542
Closes zed-industries/zed-fonts#31

Release Notes:

- The "Zed Plex Sans" and "Zed Plex Mono" fonts have been replaced with
"IBM Plex Sans" and "Lilex". The old names still work for backward
compatibility. Other than fixing line-drawing characters, and improving
the ligatures, there should be little visual change as the fonts are all
of the same family.
- Introduced ".ZedSans" and ".ZedMono" as aliases to allow us to easily
change the default fonts in the future. These currently default to "IBM
Plex Sans" and "Lilex" respectively.
This commit is contained in:
Conrad Irwin 2025-08-13 13:25:52 -06:00 committed by GitHub
parent 4a35498829
commit bd61eb0889
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 58 additions and 110 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,8 +1,9 @@
Copyright © 2017 IBM Corp. with Reserved Font Name "Plex" Copyright 2019 The Lilex Project Authors (https://github.com/mishamyrt/Lilex)
This Font Software is licensed under the SIL Open Font License, Version 1.1. This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL https://scripts.sil.org/OFL
----------------------------------------------------------- -----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
@ -89,4 +90,4 @@ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE. OTHER DEALINGS IN THE FONT SOFTWARE.

View file

@ -28,7 +28,9 @@
"edit_prediction_provider": "zed" "edit_prediction_provider": "zed"
}, },
// The name of a font to use for rendering text in the editor // The name of a font to use for rendering text in the editor
"buffer_font_family": "Zed Plex Mono", // ".ZedMono" currently aliases to Lilex
// but this may change in the future.
"buffer_font_family": ".ZedMono",
// Set the buffer text's font fallbacks, this will be merged with // Set the buffer text's font fallbacks, this will be merged with
// the platform's default fallbacks. // the platform's default fallbacks.
"buffer_font_fallbacks": null, "buffer_font_fallbacks": null,
@ -54,7 +56,9 @@
"buffer_line_height": "comfortable", "buffer_line_height": "comfortable",
// The name of a font to use for rendering text in the UI // The name of a font to use for rendering text in the UI
// You can set this to ".SystemUIFont" to use the system font // You can set this to ".SystemUIFont" to use the system font
"ui_font_family": "Zed Plex Sans", // ".ZedSans" currently aliases to "IBM Plex Sans", but this may
// change in the future
"ui_font_family": ".ZedSans",
// Set the UI's font fallbacks, this will be merged with the platform's // Set the UI's font fallbacks, this will be merged with the platform's
// default font fallbacks. // default font fallbacks.
"ui_font_fallbacks": null, "ui_font_fallbacks": null,
@ -1402,7 +1406,7 @@
// "font_size": 15, // "font_size": 15,
// Set the terminal's font family. If this option is not included, // Set the terminal's font family. If this option is not included,
// the terminal will default to matching the buffer's font family. // the terminal will default to matching the buffer's font family.
// "font_family": "Zed Plex Mono", // "font_family": ".ZedMono",
// Set the terminal's font fallbacks. If this option is not included, // Set the terminal's font fallbacks. If this option is not included,
// the terminal will default to matching the buffer's font fallbacks. // the terminal will default to matching the buffer's font fallbacks.
// This will be merged with the platform's default font fallbacks // This will be merged with the platform's default font fallbacks

View file

@ -58,9 +58,7 @@ impl Assets {
pub fn load_test_fonts(&self, cx: &App) { pub fn load_test_fonts(&self, cx: &App) {
cx.text_system() cx.text_system()
.add_fonts(vec![ .add_fonts(vec![
self.load("fonts/plex-mono/ZedPlexMono-Regular.ttf") self.load("fonts/lilex/Lilex-Regular.ttf").unwrap().unwrap(),
.unwrap()
.unwrap(),
]) ])
.unwrap() .unwrap()
} }

View file

@ -2290,8 +2290,6 @@ mod tests {
fn test_blocks_on_wrapped_lines(cx: &mut gpui::TestAppContext) { fn test_blocks_on_wrapped_lines(cx: &mut gpui::TestAppContext) {
cx.update(init_test); cx.update(init_test);
let _font_id = cx.text_system().font_id(&font("Helvetica")).unwrap();
let text = "one two three\nfour five six\nseven eight"; let text = "one two three\nfour five six\nseven eight";
let buffer = cx.update(|cx| MultiBuffer::build_simple(text, cx)); let buffer = cx.update(|cx| MultiBuffer::build_simple(text, cx));

View file

@ -1223,7 +1223,7 @@ mod tests {
let tab_size = NonZeroU32::new(rng.gen_range(1..=4)).unwrap(); let tab_size = NonZeroU32::new(rng.gen_range(1..=4)).unwrap();
let font = test_font(); let font = test_font();
let _font_id = text_system.font_id(&font); let _font_id = text_system.resolve_font(&font);
let font_size = px(14.0); let font_size = px(14.0);
log::info!("Tab size: {}", tab_size); log::info!("Tab size: {}", tab_size);

View file

@ -53,7 +53,7 @@ pub fn marked_display_snapshot(
let (unmarked_text, markers) = marked_text_offsets(text); let (unmarked_text, markers) = marked_text_offsets(text);
let font = Font { let font = Font {
family: "Zed Plex Mono".into(), family: ".ZedMono".into(),
features: FontFeatures::default(), features: FontFeatures::default(),
fallbacks: None, fallbacks: None,
weight: FontWeight::default(), weight: FontWeight::default(),

View file

@ -213,11 +213,7 @@ impl CosmicTextSystemState {
features: &FontFeatures, features: &FontFeatures,
) -> Result<SmallVec<[FontId; 4]>> { ) -> Result<SmallVec<[FontId; 4]>> {
// TODO: Determine the proper system UI font. // TODO: Determine the proper system UI font.
let name = if name == ".SystemUIFont" { let name = crate::text_system::font_name_with_fallbacks(name, "IBM Plex Sans");
"Zed Plex Sans"
} else {
name
};
let families = self let families = self
.font_system .font_system

View file

@ -211,11 +211,7 @@ impl MacTextSystemState {
features: &FontFeatures, features: &FontFeatures,
fallbacks: Option<&FontFallbacks>, fallbacks: Option<&FontFallbacks>,
) -> Result<SmallVec<[FontId; 4]>> { ) -> Result<SmallVec<[FontId; 4]>> {
let name = if name == ".SystemUIFont" { let name = crate::text_system::font_name_with_fallbacks(name, ".AppleSystemUIFont");
".AppleSystemUIFont"
} else {
name
};
let mut font_ids = SmallVec::new(); let mut font_ids = SmallVec::new();
let family = self let family = self

View file

@ -498,8 +498,9 @@ impl DirectWriteState {
) )
.unwrap() .unwrap()
} else { } else {
let family = self.system_ui_font_name.clone();
self.find_font_id( self.find_font_id(
target_font.family.as_ref(), font_name_with_fallbacks(target_font.family.as_ref(), family.as_ref()),
target_font.weight, target_font.weight,
target_font.style, target_font.style,
&target_font.features, &target_font.features,
@ -512,7 +513,6 @@ impl DirectWriteState {
} }
#[cfg(not(any(test, feature = "test-support")))] #[cfg(not(any(test, feature = "test-support")))]
{ {
let family = self.system_ui_font_name.clone();
log::error!("{} not found, use {} instead.", target_font.family, family); log::error!("{} not found, use {} instead.", target_font.family, family);
self.get_font_id_from_font_collection( self.get_font_id_from_font_collection(
family.as_ref(), family.as_ref(),

View file

@ -65,7 +65,7 @@ impl TextSystem {
font_runs_pool: Mutex::default(), font_runs_pool: Mutex::default(),
fallback_font_stack: smallvec![ fallback_font_stack: smallvec![
// TODO: Remove this when Linux have implemented setting fallbacks. // TODO: Remove this when Linux have implemented setting fallbacks.
font("Zed Plex Mono"), font(".ZedMono"),
font("Helvetica"), font("Helvetica"),
font("Segoe UI"), // Windows font("Segoe UI"), // Windows
font("Cantarell"), // Gnome font("Cantarell"), // Gnome
@ -96,7 +96,7 @@ impl TextSystem {
} }
/// Get the FontId for the configure font family and style. /// Get the FontId for the configure font family and style.
pub fn font_id(&self, font: &Font) -> Result<FontId> { fn font_id(&self, font: &Font) -> Result<FontId> {
fn clone_font_id_result(font_id: &Result<FontId>) -> Result<FontId> { fn clone_font_id_result(font_id: &Result<FontId>) -> Result<FontId> {
match font_id { match font_id {
Ok(font_id) => Ok(*font_id), Ok(font_id) => Ok(*font_id),
@ -844,3 +844,16 @@ impl FontMetrics {
(self.bounding_box / self.units_per_em as f32 * font_size.0).map(px) (self.bounding_box / self.units_per_em as f32 * font_size.0).map(px)
} }
} }
#[allow(unused)]
pub(crate) fn font_name_with_fallbacks<'a>(name: &'a str, system: &'a str) -> &'a str {
// Note: the "Zed Plex" fonts were deprecated as we are not allowed to use "Plex"
// in a derived font name. They are essentially indistinguishable from IBM Plex/Lilex,
// and so retained here for backward compatibility.
match name {
".SystemUIFont" => system,
".ZedSans" | "Zed Plex Sans" => "IBM Plex Sans",
".ZedMono" | "Zed Plex Mono" => "Lilex",
_ => name,
}
}

View file

@ -327,7 +327,7 @@ mod tests {
fn build_wrapper() -> LineWrapper { fn build_wrapper() -> LineWrapper {
let dispatcher = TestDispatcher::new(StdRng::seed_from_u64(0)); let dispatcher = TestDispatcher::new(StdRng::seed_from_u64(0));
let cx = TestAppContext::build(dispatcher, None); let cx = TestAppContext::build(dispatcher, None);
let id = cx.text_system().font_id(&font("Zed Plex Mono")).unwrap(); let id = cx.text_system().resolve_font(&font(".ZedMono"));
LineWrapper::new(id, px(16.), cx.text_system().platform_text_system.clone()) LineWrapper::new(id, px(16.), cx.text_system().platform_text_system.clone())
} }

View file

@ -77,16 +77,16 @@ impl Render for MarkdownExample {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement { fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
let markdown_style = MarkdownStyle { let markdown_style = MarkdownStyle {
base_text_style: gpui::TextStyle { base_text_style: gpui::TextStyle {
font_family: "Zed Plex Sans".into(), font_family: ".ZedSans".into(),
color: cx.theme().colors().terminal_ansi_black, color: cx.theme().colors().terminal_ansi_black,
..Default::default() ..Default::default()
}, },
code_block: StyleRefinement::default() code_block: StyleRefinement::default()
.font_family("Zed Plex Mono") .font_family(".ZedMono")
.m(rems(1.)) .m(rems(1.))
.bg(rgb(0xAAAAAAA)), .bg(rgb(0xAAAAAAA)),
inline_code: gpui::TextStyleRefinement { inline_code: gpui::TextStyleRefinement {
font_family: Some("Zed Mono".into()), font_family: Some(".ZedMono".into()),
color: Some(cx.theme().colors().editor_foreground), color: Some(cx.theme().colors().editor_foreground),
background_color: Some(cx.theme().colors().editor_background), background_color: Some(cx.theme().colors().editor_background),
..Default::default() ..Default::default()

View file

@ -128,7 +128,7 @@ impl Render for StoryWrapper {
.flex() .flex()
.flex_col() .flex_col()
.size_full() .size_full()
.font_family("Zed Plex Mono") .font_family(".ZedMono")
.child(self.story.clone()) .child(self.story.clone())
} }
} }

View file

@ -284,9 +284,7 @@ pub fn init(cx: &mut App) {
let count = Vim::take_count(cx).unwrap_or(1) as f32; let count = Vim::take_count(cx).unwrap_or(1) as f32;
Vim::take_forced_motion(cx); Vim::take_forced_motion(cx);
let theme = ThemeSettings::get_global(cx); let theme = ThemeSettings::get_global(cx);
let Ok(font_id) = window.text_system().font_id(&theme.buffer_font) else { let font_id = window.text_system().resolve_font(&theme.buffer_font);
return;
};
let Ok(width) = window let Ok(width) = window
.text_system() .text_system()
.advance(font_id, theme.buffer_font_size(cx), 'm') .advance(font_id, theme.buffer_font_size(cx), 'm')
@ -300,9 +298,7 @@ pub fn init(cx: &mut App) {
let count = Vim::take_count(cx).unwrap_or(1) as f32; let count = Vim::take_count(cx).unwrap_or(1) as f32;
Vim::take_forced_motion(cx); Vim::take_forced_motion(cx);
let theme = ThemeSettings::get_global(cx); let theme = ThemeSettings::get_global(cx);
let Ok(font_id) = window.text_system().font_id(&theme.buffer_font) else { let font_id = window.text_system().resolve_font(&theme.buffer_font);
return;
};
let Ok(width) = window let Ok(width) = window
.text_system() .text_system()
.advance(font_id, theme.buffer_font_size(cx), 'm') .advance(font_id, theme.buffer_font_size(cx), 'm')

View file

@ -4401,11 +4401,11 @@ mod tests {
cx.text_system() cx.text_system()
.add_fonts(vec![ .add_fonts(vec![
Assets Assets
.load("fonts/plex-mono/ZedPlexMono-Regular.ttf") .load("fonts/lilex/Lilex-Regular.ttf")
.unwrap() .unwrap()
.unwrap(), .unwrap(),
Assets Assets
.load("fonts/plex-sans/ZedPlexSans-Regular.ttf") .load("fonts/ibm-plex-sans/IBMPlexSans-Regular.ttf")
.unwrap() .unwrap()
.unwrap(), .unwrap(),
]) ])

View file

@ -294,11 +294,11 @@ Define extensions which should be installed (`true`) or never installed (`false`
- Description: The name of a font to use for rendering text in the editor. - Description: The name of a font to use for rendering text in the editor.
- Setting: `buffer_font_family` - Setting: `buffer_font_family`
- Default: `Zed Plex Mono` - Default: `.ZedMono`. This currently aliases to [Lilex](https://lilex.myrt.co).
**Options** **Options**
The name of any font family installed on the user's system The name of any font family installed on the user's system, or `".ZedMono"`.
## Buffer Font Features ## Buffer Font Features
@ -3511,11 +3511,11 @@ Float values between `0.0` and `0.9`, where:
- Description: The name of the font to use for text in the UI. - Description: The name of the font to use for text in the UI.
- Setting: `ui_font_family` - Setting: `ui_font_family`
- Default: `Zed Plex Sans` - Default: `.ZedSans`. This currently aliases to [IBM Plex](https://www.ibm.com/plex/).
**Options** **Options**
The name of any font family installed on the system. The name of any font family installed on the system, `".ZedSans"` to use the Zed-provided default, or `".SystemUIFont"` to use the system's default UI font (on macOS and Windows).
## UI Font Features ## UI Font Features
@ -3603,7 +3603,7 @@ For example, to use `Nerd Font` as a fallback, add the following to your setting
"soft_wrap": "none", "soft_wrap": "none",
"buffer_font_size": 18, "buffer_font_size": 18,
"buffer_font_family": "Zed Plex Mono", "buffer_font_family": ".ZedMono",
"autosave": "on_focus_change", "autosave": "on_focus_change",
"format_on_save": "off", "format_on_save": "off",

View file

@ -1,56 +0,0 @@
# Fonts
<!--
TBD: WIP. Zed Fonts documentation. This is currently not linked from SUMMARY.md are so unpublished.
-->
Zed ships two fonts: Zed Plex Mono and Zed Plex Sans. These are based on IBM Plex Mono and IBM Plex Sans, respectively.
<!--
TBD: Document how Zed Plex font files were created. Repo links, etc.
-->
## Settings
<!--
TBD: Explain various font settings in Zed.
-->
- Buffer fonts
- `buffer-font-family`
- `buffer-font-features`
- `buffer-font-size`
- `buffer-line-height`
- UI fonts
- `ui_font_family`
- `ui_font_fallbacks`
- `ui_font_features`
- `ui_font_weight`
- `ui_font_size`
- Terminal fonts
- `terminal.font-size`
- `terminal.font-family`
- `terminal.font-features`
## Old Zed Fonts
Previously, Zed shipped with `Zed Mono` and `Zed Sans`, customized versions of the [Iosevka](https://typeof.net/Iosevka/) typeface. You can find more about them in the [zed-fonts](https://github.com/zed-industries/zed-fonts/) repository.
Here's how you can use the old Zed fonts instead of `Zed Plex Mono` and `Zed Plex Sans`:
1. Download [zed-app-fonts-1.2.0.zip](https://github.com/zed-industries/zed-fonts/releases/download/1.2.0/zed-app-fonts-1.2.0.zip) from the [zed-fonts releases](https://github.com/zed-industries/zed-fonts/releases) page.
2. Open macOS `Font Book.app`
3. Unzip the file and drag the `ttf` files into the Font Book app.
4. Update your settings `ui_font_family` and `buffer_font_family` to use `Zed Mono` or `Zed Sans` in your `settings.json` file.
```json
{
"ui_font_family": "Zed Sans Extended",
"buffer_font_family": "Zed Mono Extend",
"terminal": {
"font-family": "Zed Mono Extended"
}
}
```
5. Note there will be red squiggles under the font name. (this is a bug, but harmless.)

View file

@ -39,13 +39,15 @@ If you would like to use distinct themes for light mode/dark mode that can be se
## Fonts ## Fonts
```json ```json
// UI Font. Use ".SystemUIFont" to use the default system font (SF Pro on macOS) // UI Font. Use ".SystemUIFont" to use the default system font (SF Pro on macOS),
"ui_font_family": "Zed Plex Sans", // or ".ZedSans" for the bundled default (currently IBM Plex)
"ui_font_family": ".SystemUIFont",
"ui_font_weight": 400, // Font weight in standard CSS units from 100 to 900. "ui_font_weight": 400, // Font weight in standard CSS units from 100 to 900.
"ui_font_size": 16, "ui_font_size": 16,
// Buffer Font - Used by editor buffers // Buffer Font - Used by editor buffers
"buffer_font_family": "Zed Plex Mono", // Font name for editor buffers // use ".ZedMono" for the bundled default monospace (currently Lilex)
"buffer_font_family": "Berkeley Mono", // Font name for editor buffers
"buffer_font_size": 15, // Font size for editor buffers "buffer_font_size": 15, // Font size for editor buffers
"buffer_font_weight": 400, // Font weight in CSS units [100-900] "buffer_font_weight": 400, // Font weight in CSS units [100-900]
// Line height "comfortable" (1.618), "standard" (1.3) or custom: `{ "custom": 2 }` // Line height "comfortable" (1.618), "standard" (1.3) or custom: `{ "custom": 2 }`
@ -53,7 +55,7 @@ If you would like to use distinct themes for light mode/dark mode that can be se
// Terminal Font Settings // Terminal Font Settings
"terminal": { "terminal": {
"font_family": "Zed Plex Mono", "font_family": "",
"font_size": 15, "font_size": 15,
// Terminal line height: comfortable (1.618), standard(1.3) or `{ "custom": 2 }` // Terminal line height: comfortable (1.618), standard(1.3) or `{ "custom": 2 }`
"line_height": "comfortable", "line_height": "comfortable",
@ -473,7 +475,7 @@ See [Zed AI Documentation](./ai/overview.md) for additional non-visual AI settin
"show": null // Show/hide: (auto, system, always, never) "show": null // Show/hide: (auto, system, always, never)
}, },
// Terminal Font Settings // Terminal Font Settings
"font_family": "Zed Plex Mono", "font_family": "Fira Code",
"font_size": 15, "font_size": 15,
"font_weight": 400, "font_weight": 400,
// Terminal line height: comfortable (1.618), standard(1.3) or `{ "custom": 2 }` // Terminal line height: comfortable (1.618), standard(1.3) or `{ "custom": 2 }`

View file

@ -171,8 +171,8 @@ let
ZSTD_SYS_USE_PKG_CONFIG = true; ZSTD_SYS_USE_PKG_CONFIG = true;
FONTCONFIG_FILE = makeFontsConf { FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [ fontDirectories = [
../assets/fonts/plex-mono ../assets/fonts/lilex
../assets/fonts/plex-sans ../assets/fonts/ibm-plex-sans
]; ];
}; };
ZED_UPDATE_EXPLANATION = "Zed has been installed using Nix. Auto-updates have thus been disabled."; ZED_UPDATE_EXPLANATION = "Zed has been installed using Nix. Auto-updates have thus been disabled.";

View file

@ -46,8 +46,8 @@
# outside the nix store instead of to `$src` # outside the nix store instead of to `$src`
FONTCONFIG_FILE = makeFontsConf { FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [ fontDirectories = [
"./assets/fonts/plex-mono" "./assets/fonts/lilex"
"./assets/fonts/plex-sans" "./assets/fonts/ibm-plex-sans"
]; ];
}; };
PROTOC = "${protobuf}/bin/protoc"; PROTOC = "${protobuf}/bin/protoc";