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:
parent
4a35498829
commit
bd61eb0889
37 changed files with 58 additions and 110 deletions
BIN
assets/fonts/ibm-plex-sans/IBMPlexSans-Bold.ttf
Normal file
BIN
assets/fonts/ibm-plex-sans/IBMPlexSans-Bold.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/ibm-plex-sans/IBMPlexSans-BoldItalic.ttf
Normal file
BIN
assets/fonts/ibm-plex-sans/IBMPlexSans-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/ibm-plex-sans/IBMPlexSans-Italic.ttf
Normal file
BIN
assets/fonts/ibm-plex-sans/IBMPlexSans-Italic.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/ibm-plex-sans/IBMPlexSans-Regular.ttf
Normal file
BIN
assets/fonts/ibm-plex-sans/IBMPlexSans-Regular.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/lilex/Lilex-Bold.ttf
Normal file
BIN
assets/fonts/lilex/Lilex-Bold.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/lilex/Lilex-BoldItalic.ttf
Normal file
BIN
assets/fonts/lilex/Lilex-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/lilex/Lilex-Italic.ttf
Normal file
BIN
assets/fonts/lilex/Lilex-Italic.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/lilex/Lilex-Regular.ttf
Normal file
BIN
assets/fonts/lilex/Lilex-Regular.ttf
Normal file
Binary file not shown.
|
@ -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 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
|
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.
|
@ -28,7 +28,9 @@
|
|||
"edit_prediction_provider": "zed"
|
||||
},
|
||||
// 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
|
||||
// the platform's default fallbacks.
|
||||
"buffer_font_fallbacks": null,
|
||||
|
@ -54,7 +56,9 @@
|
|||
"buffer_line_height": "comfortable",
|
||||
// The name of a font to use for rendering text in the UI
|
||||
// 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
|
||||
// default font fallbacks.
|
||||
"ui_font_fallbacks": null,
|
||||
|
@ -1402,7 +1406,7 @@
|
|||
// "font_size": 15,
|
||||
// Set the terminal's font family. If this option is not included,
|
||||
// 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,
|
||||
// the terminal will default to matching the buffer's font fallbacks.
|
||||
// This will be merged with the platform's default font fallbacks
|
||||
|
|
|
@ -58,9 +58,7 @@ impl Assets {
|
|||
pub fn load_test_fonts(&self, cx: &App) {
|
||||
cx.text_system()
|
||||
.add_fonts(vec![
|
||||
self.load("fonts/plex-mono/ZedPlexMono-Regular.ttf")
|
||||
.unwrap()
|
||||
.unwrap(),
|
||||
self.load("fonts/lilex/Lilex-Regular.ttf").unwrap().unwrap(),
|
||||
])
|
||||
.unwrap()
|
||||
}
|
||||
|
|
|
@ -2290,8 +2290,6 @@ mod tests {
|
|||
fn test_blocks_on_wrapped_lines(cx: &mut gpui::TestAppContext) {
|
||||
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 buffer = cx.update(|cx| MultiBuffer::build_simple(text, cx));
|
||||
|
|
|
@ -1223,7 +1223,7 @@ mod tests {
|
|||
let tab_size = NonZeroU32::new(rng.gen_range(1..=4)).unwrap();
|
||||
|
||||
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);
|
||||
|
||||
log::info!("Tab size: {}", tab_size);
|
||||
|
|
|
@ -53,7 +53,7 @@ pub fn marked_display_snapshot(
|
|||
let (unmarked_text, markers) = marked_text_offsets(text);
|
||||
|
||||
let font = Font {
|
||||
family: "Zed Plex Mono".into(),
|
||||
family: ".ZedMono".into(),
|
||||
features: FontFeatures::default(),
|
||||
fallbacks: None,
|
||||
weight: FontWeight::default(),
|
||||
|
|
|
@ -213,11 +213,7 @@ impl CosmicTextSystemState {
|
|||
features: &FontFeatures,
|
||||
) -> Result<SmallVec<[FontId; 4]>> {
|
||||
// TODO: Determine the proper system UI font.
|
||||
let name = if name == ".SystemUIFont" {
|
||||
"Zed Plex Sans"
|
||||
} else {
|
||||
name
|
||||
};
|
||||
let name = crate::text_system::font_name_with_fallbacks(name, "IBM Plex Sans");
|
||||
|
||||
let families = self
|
||||
.font_system
|
||||
|
|
|
@ -211,11 +211,7 @@ impl MacTextSystemState {
|
|||
features: &FontFeatures,
|
||||
fallbacks: Option<&FontFallbacks>,
|
||||
) -> Result<SmallVec<[FontId; 4]>> {
|
||||
let name = if name == ".SystemUIFont" {
|
||||
".AppleSystemUIFont"
|
||||
} else {
|
||||
name
|
||||
};
|
||||
let name = crate::text_system::font_name_with_fallbacks(name, ".AppleSystemUIFont");
|
||||
|
||||
let mut font_ids = SmallVec::new();
|
||||
let family = self
|
||||
|
|
|
@ -498,8 +498,9 @@ impl DirectWriteState {
|
|||
)
|
||||
.unwrap()
|
||||
} else {
|
||||
let family = self.system_ui_font_name.clone();
|
||||
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.style,
|
||||
&target_font.features,
|
||||
|
@ -512,7 +513,6 @@ impl DirectWriteState {
|
|||
}
|
||||
#[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);
|
||||
self.get_font_id_from_font_collection(
|
||||
family.as_ref(),
|
||||
|
|
|
@ -65,7 +65,7 @@ impl TextSystem {
|
|||
font_runs_pool: Mutex::default(),
|
||||
fallback_font_stack: smallvec![
|
||||
// TODO: Remove this when Linux have implemented setting fallbacks.
|
||||
font("Zed Plex Mono"),
|
||||
font(".ZedMono"),
|
||||
font("Helvetica"),
|
||||
font("Segoe UI"), // Windows
|
||||
font("Cantarell"), // Gnome
|
||||
|
@ -96,7 +96,7 @@ impl TextSystem {
|
|||
}
|
||||
|
||||
/// 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> {
|
||||
match 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)
|
||||
}
|
||||
}
|
||||
|
||||
#[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,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -327,7 +327,7 @@ mod tests {
|
|||
fn build_wrapper() -> LineWrapper {
|
||||
let dispatcher = TestDispatcher::new(StdRng::seed_from_u64(0));
|
||||
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())
|
||||
}
|
||||
|
||||
|
|
|
@ -77,16 +77,16 @@ impl Render for MarkdownExample {
|
|||
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
let markdown_style = MarkdownStyle {
|
||||
base_text_style: gpui::TextStyle {
|
||||
font_family: "Zed Plex Sans".into(),
|
||||
font_family: ".ZedSans".into(),
|
||||
color: cx.theme().colors().terminal_ansi_black,
|
||||
..Default::default()
|
||||
},
|
||||
code_block: StyleRefinement::default()
|
||||
.font_family("Zed Plex Mono")
|
||||
.font_family(".ZedMono")
|
||||
.m(rems(1.))
|
||||
.bg(rgb(0xAAAAAAA)),
|
||||
inline_code: gpui::TextStyleRefinement {
|
||||
font_family: Some("Zed Mono".into()),
|
||||
font_family: Some(".ZedMono".into()),
|
||||
color: Some(cx.theme().colors().editor_foreground),
|
||||
background_color: Some(cx.theme().colors().editor_background),
|
||||
..Default::default()
|
||||
|
|
|
@ -128,7 +128,7 @@ impl Render for StoryWrapper {
|
|||
.flex()
|
||||
.flex_col()
|
||||
.size_full()
|
||||
.font_family("Zed Plex Mono")
|
||||
.font_family(".ZedMono")
|
||||
.child(self.story.clone())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -284,9 +284,7 @@ pub fn init(cx: &mut App) {
|
|||
let count = Vim::take_count(cx).unwrap_or(1) as f32;
|
||||
Vim::take_forced_motion(cx);
|
||||
let theme = ThemeSettings::get_global(cx);
|
||||
let Ok(font_id) = window.text_system().font_id(&theme.buffer_font) else {
|
||||
return;
|
||||
};
|
||||
let font_id = window.text_system().resolve_font(&theme.buffer_font);
|
||||
let Ok(width) = window
|
||||
.text_system()
|
||||
.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;
|
||||
Vim::take_forced_motion(cx);
|
||||
let theme = ThemeSettings::get_global(cx);
|
||||
let Ok(font_id) = window.text_system().font_id(&theme.buffer_font) else {
|
||||
return;
|
||||
};
|
||||
let font_id = window.text_system().resolve_font(&theme.buffer_font);
|
||||
let Ok(width) = window
|
||||
.text_system()
|
||||
.advance(font_id, theme.buffer_font_size(cx), 'm')
|
||||
|
|
|
@ -4401,11 +4401,11 @@ mod tests {
|
|||
cx.text_system()
|
||||
.add_fonts(vec![
|
||||
Assets
|
||||
.load("fonts/plex-mono/ZedPlexMono-Regular.ttf")
|
||||
.load("fonts/lilex/Lilex-Regular.ttf")
|
||||
.unwrap()
|
||||
.unwrap(),
|
||||
Assets
|
||||
.load("fonts/plex-sans/ZedPlexSans-Regular.ttf")
|
||||
.load("fonts/ibm-plex-sans/IBMPlexSans-Regular.ttf")
|
||||
.unwrap()
|
||||
.unwrap(),
|
||||
])
|
||||
|
|
|
@ -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.
|
||||
- Setting: `buffer_font_family`
|
||||
- Default: `Zed Plex Mono`
|
||||
- Default: `.ZedMono`. This currently aliases to [Lilex](https://lilex.myrt.co).
|
||||
|
||||
**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
|
||||
|
||||
|
@ -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.
|
||||
- Setting: `ui_font_family`
|
||||
- Default: `Zed Plex Sans`
|
||||
- Default: `.ZedSans`. This currently aliases to [IBM Plex](https://www.ibm.com/plex/).
|
||||
|
||||
**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
|
||||
|
||||
|
@ -3603,7 +3603,7 @@ For example, to use `Nerd Font` as a fallback, add the following to your setting
|
|||
"soft_wrap": "none",
|
||||
|
||||
"buffer_font_size": 18,
|
||||
"buffer_font_family": "Zed Plex Mono",
|
||||
"buffer_font_family": ".ZedMono",
|
||||
|
||||
"autosave": "on_focus_change",
|
||||
"format_on_save": "off",
|
||||
|
|
|
@ -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.)
|
|
@ -39,13 +39,15 @@ If you would like to use distinct themes for light mode/dark mode that can be se
|
|||
## Fonts
|
||||
|
||||
```json
|
||||
// UI Font. Use ".SystemUIFont" to use the default system font (SF Pro on macOS)
|
||||
"ui_font_family": "Zed Plex Sans",
|
||||
// UI Font. Use ".SystemUIFont" to use the default system font (SF Pro on macOS),
|
||||
// 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_size": 16,
|
||||
|
||||
// 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_weight": 400, // Font weight in CSS units [100-900]
|
||||
// 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_family": "Zed Plex Mono",
|
||||
"font_family": "",
|
||||
"font_size": 15,
|
||||
// Terminal line height: comfortable (1.618), standard(1.3) or `{ "custom": 2 }`
|
||||
"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)
|
||||
},
|
||||
// Terminal Font Settings
|
||||
"font_family": "Zed Plex Mono",
|
||||
"font_family": "Fira Code",
|
||||
"font_size": 15,
|
||||
"font_weight": 400,
|
||||
// Terminal line height: comfortable (1.618), standard(1.3) or `{ "custom": 2 }`
|
||||
|
|
|
@ -171,8 +171,8 @@ let
|
|||
ZSTD_SYS_USE_PKG_CONFIG = true;
|
||||
FONTCONFIG_FILE = makeFontsConf {
|
||||
fontDirectories = [
|
||||
../assets/fonts/plex-mono
|
||||
../assets/fonts/plex-sans
|
||||
../assets/fonts/lilex
|
||||
../assets/fonts/ibm-plex-sans
|
||||
];
|
||||
};
|
||||
ZED_UPDATE_EXPLANATION = "Zed has been installed using Nix. Auto-updates have thus been disabled.";
|
||||
|
|
|
@ -46,8 +46,8 @@
|
|||
# outside the nix store instead of to `$src`
|
||||
FONTCONFIG_FILE = makeFontsConf {
|
||||
fontDirectories = [
|
||||
"./assets/fonts/plex-mono"
|
||||
"./assets/fonts/plex-sans"
|
||||
"./assets/fonts/lilex"
|
||||
"./assets/fonts/ibm-plex-sans"
|
||||
];
|
||||
};
|
||||
PROTOC = "${protobuf}/bin/protoc";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue