Compare commits

...

6 Commits

Author SHA1 Message Date
Peter Tripp
a0d4c82c0c Another bad path. 2024-10-13 22:11:50 -04:00
Peter Tripp
8e6fac76df Fix two asset loads. 2024-10-13 21:57:44 -04:00
Peter Tripp
a027217629 Merge branch 'main' into ibm_plex 2024-10-11 10:34:22 -04:00
Peter Tripp
6183b02db0 fonts.md 2024-08-31 01:04:58 -04:00
Peter Tripp
ced0d608ca Newline 2024-08-31 01:00:13 -04:00
Peter Tripp
4a9e15b1b1 Switch to upstream IBM Plex fonts.
- Update [@ibm/plex-sans@1.0.0](https://github.com/IBM/plex/releases/tag/%40ibm/plex-sans%401.0.0)
- Update [@ibm/plex-mono@1.0.0](https://github.com/IBM/plex/releases/tag/%40ibm/plex-mono%401.0.0)

```
ca403c56931baef307d20ba64b69acb71abcad61f75e66414661d57484b690ec  ibm-plex-mono/IBMPlexMono-Bold.ttf
0e45a5a540992163229d2a29662553f313fab391757ca2ab3dc8f4e0d9be0979  ibm-plex-mono/IBMPlexMono-BoldItalic.ttf
8ebe04c8c6cc82f0be19896ddc61d9935cdd0f027b0173c1945b8d247d7dfc2a  ibm-plex-mono/IBMPlexMono-Italic.ttf
fe11304a5fe956d5744e9b6a246cc83d90425245e75a62230044966ca96a7f50  ibm-plex-mono/IBMPlexMono-Regular.ttf
9e6c74a889a700d707613d24548fe4ffa6bc59559a0689d2cf9e133bdcdafb2f  ibm-plex-sans/IBMPlexSans-Bold.ttf
0e3142ba2ef31fe5c02f0c6c36424f251609cd6b73880076e21c2e81931ba2b9  ibm-plex-sans/IBMPlexSans-BoldItalic.ttf
a9c6ef9942c49e49d11e11a6dacc0b3a087978757e9b22a06b8ac22a6400fb15  ibm-plex-sans/IBMPlexSans-Italic.ttf
975dcda37d80f038dcd143c22e33ca2d97a0cc5a929aace1c749153b0fe1afa5  ibm-plex-sans/IBMPlexSans-Regular.ttf
```
2024-08-31 00:58:48 -04:00
32 changed files with 97 additions and 37 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

@@ -27,14 +27,14 @@
"inline_completion_provider": "copilot"
},
// The name of a font to use for rendering text in the editor
"buffer_font_family": "Zed Plex Mono",
"buffer_font_family": "IBM Plex Mono",
// Set the buffer text's font fallbacks, this will be merged with
// the platform's default fallbacks.
"buffer_font_fallbacks": null,
// The OpenType features to enable for text in the editor.
"buffer_font_features": {
// Disable ligatures:
// "calt": false
"calt": false
},
// The default font size for text in the editor
"buffer_font_size": 15,
@@ -53,7 +53,7 @@
"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",
"ui_font_family": "IBM Plex Sans",
// Set the UI's font fallbacks, this will be merged with the platform's
// default font fallbacks.
"ui_font_fallbacks": null,
@@ -753,7 +753,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": "IBM Plex Mono",
// 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

View File

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

View File

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

View File

@@ -198,7 +198,7 @@ impl CosmicTextSystemState {
) -> Result<SmallVec<[FontId; 4]>> {
// TODO: Determine the proper system UI font.
let name = if name == ".SystemUIFont" {
"Zed Plex Sans"
"IBM Plex Sans"
} else {
name
};

View File

@@ -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("IBM Plex Mono"),
font("Helvetica"),
font("Segoe UI"), // Windows
font("Cantarell"), // Gnome

View File

@@ -223,12 +223,12 @@ mod tests {
let cx = TestAppContext::new(dispatcher, None);
cx.text_system()
.add_fonts(vec![std::fs::read(
"../../assets/fonts/plex-mono/ZedPlexMono-Regular.ttf",
"../../assets/fonts/ibm-plex-mono/IBMPlexMono-Regular.ttf",
)
.unwrap()
.into()])
.unwrap();
let id = cx.text_system().font_id(&font("Zed Plex Mono")).unwrap();
let id = cx.text_system().font_id(&font("IBM Plex Mono")).unwrap();
LineWrapper::new(id, px(16.), cx.text_system().platform_text_system.clone())
}

View File

@@ -116,12 +116,12 @@ pub fn main() {
cx.new_view(|cx| {
let markdown_style = MarkdownStyle {
base_text_style: gpui::TextStyle {
font_family: "Zed Plex Sans".into(),
font_family: "IBM Plex Sans".into(),
color: cx.theme().colors().terminal_ansi_black,
..Default::default()
},
code_block: StyleRefinement::default()
.font_family("Zed Plex Mono")
.font_family("IBM Plex Mono")
.m(rems(1.))
.bg(rgb(0xAAAAAAA)),
inline_code: gpui::TextStyleRefinement {

View File

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

View File

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

View File

@@ -153,7 +153,7 @@ Extensions that provide language servers may also provide default settings for t
- Description: The name of a font to use for rendering text in the editor.
- Setting: `buffer_font_family`
- Default: `Zed Plex Mono`
- Default: `IBM Plex Mono`
**Options**
@@ -2290,7 +2290,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": "IBM Plex Mono",
"autosave": "on_focus_change",
"format_on_save": "off",

View File

@@ -4,11 +4,7 @@
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.
-->
Zed ships two font faces by [Mike Abbink](https://mikeabbink.com/typefaces/) and [Bold Monday](https://boldmonday.com/custom/ibm/): IBM Plex Mono and IBM Plex Sans.
## Settings
@@ -17,10 +13,12 @@ TBD: Explain various font settings in Zed.
-->
- Buffer fonts
- `buffer-font-family`
- `buffer-font-features`
- `buffer-font-size`
- `buffer-line-height`
- `buffer_font_family`
- `buffer_font_features`
- `buffer_font_size`
- `buffer_font_weight`
- `buffer_font_fallbacks`
- `buffer_line_height`
- UI fonts
- `ui_font_family`
- `ui_font_fallbacks`
@@ -28,17 +26,24 @@ TBD: Explain various font settings in Zed.
- `ui_font_weight`
- `ui_font_size`
- Terminal fonts
- `terminal.font-size`
- `terminal.font-family`
- `terminal.font-features`
- `terminal.font_size`
- `terminal.font_family`
- `terminal.font_features`
- `terminal.line_height`
- Other settings:
- `active-pane-magnification`
- `active_pane_magnification`
## Old Zed Fonts
## Old 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.
### Zed Plex
Here's how you can use the old Zed fonts instead of `Zed Plex Mono` and `Zed Plex Sans`:
Previously Zed shipped slightly customized versions of `IBM Plex Mono` and `IBM Plex Sans` branded as `Zed Plex Mono` and `Zed Plex Sans`. We now ship unchanged versions of `IBM Plex` fonts instead.
### Zed Mono & Zed Sans {#zed-fonts}
Prior to that, 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 `Zed Mono` and `Zed 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`

View File

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

View File

@@ -43,8 +43,8 @@ in
FONTCONFIG_FILE = pkgs.makeFontsConf {
fontDirectories = [
"./assets/fonts/zed-mono"
"./assets/fonts/zed-sans"
"./assets/fonts/ibm-plex-mono"
"./assets/fonts/ibm-plex-sans"
];
};
ZSTD_SYS_USE_PKG_CONFIG = true;

55
script/update-ibm-plex Executable file
View File

@@ -0,0 +1,55 @@
#!/bin/sh
set -eu
REPO="https://github.com/IBM/plex"
ASSET_FONTS_DIR="assets/fonts"
FONT_NAMES=("plex-sans" "plex-mono")
FILENAMES=("IBMPlexSans" "IBMPlexMono")
STYLES=("Regular" "Italic" "Bold" "BoldItalic")
run_else() { $1 >/dev/null 2>&1 || { echo "$2"; exit 1; }; }
run_else "gh" "gh CLI missing"
run_else "which unzip" "unzip CLI missing"
run_else "gh auth status" "run: gh auth login"
run_else "ls ${ASSET_FONTS_DIR}" "Not in repo root. Run from repo root."
pushd "${ASSET_FONTS_DIR}"
for i in $(seq 0 $((${#FONT_NAMES[@]} - 1))); do
font="${FONT_NAMES[$i]}"
filename="${FILENAMES[$i]}"
tagName=$(gh release list \
--repo "$REPO" \
--json tagName,createdAt,isDraft,isPrerelease \
--jq '
[.[] | select(.tagName | startswith("'"@ibm/$font"'@"))
| select(.isDraft == false and .isPrerelease == false)
| {tagName, createdAt}]
| sort_by(.tagName | split("@")[2] | split(".") | map(tonumber))
| reverse
| first
| .tagName
')
releaseDate=$(gh api /repos/IBM/plex/releases/tags/"$tagName" --jq '.published_at[:10]')
releaseUrl=$(gh api /repos/IBM/plex/releases/tags/"$tagName" --jq '.html_url')
echo "- Update [${tagName}](${releaseUrl})"
zipFileName=$(gh api /repos/IBM/plex/releases/tags/"$tagName" --jq '.assets[].name | select(endswith(".zip"))')
gh release download "$tagName" \
--repo https://github.com/IBM/plex \
--clobber \
--pattern "$zipFileName"
prefix="ibm-${font}/fonts/complete/ttf"
out_dir="ibm-${font}"
files_to_extract="$prefix/license.txt"
for style in "${STYLES[@]}"; do
files_to_extract+=" $prefix/${filename}-$style.ttf"
done
unzip -q -o -j "$zipFileName" $files_to_extract -d $out_dir
rm "$zipFileName"
done
echo
echo "\`\`\`"
shasum -a 256 */*.ttf
echo "\`\`\`"