update nerdfonts to 3.3.0
This commit is contained in:
6 files changed
+3323
-240
No files matched your search
Binary file not shown.
@@ -185,6 +185,7 @@ As features stabilize some brief notes about them will accumulate here.
|
||||
* Bundled harfbuzz to 10.2.0
|
||||
* Bundled libssh to 0.11.1
|
||||
* Bundled freetype to 2.13.3
|
||||
* Bundled Nerd Font Symbols font to v3.3.0
|
||||
* image crate to 0.25, which means that JPEG images are now decoded via
|
||||
[zune-jpeg](https://docs.rs/zune-jpeg/latest/zune_jpeg/), which improves
|
||||
handling of non-conforming jpeg images. #5365
|
||||
|
||||
+1648
-108
File diff suppressed because it is too large.
Load diff
@@ -4,7 +4,10 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
phf_codegen = "0.10"
|
||||
ucd-trie = "0.1"
|
||||
reqwest = {version="0.12", features=["blocking"]}
|
||||
human-sort = "0.2"
|
||||
phf_codegen = "0.10"
|
||||
reqwest = {version="0.12", features=["blocking"]}
|
||||
serde = {version="1.0", features=["derive"]}
|
||||
serde_json = "1.0"
|
||||
ucd-trie = "0.1"
|
||||
|
||||
+20
-21
@@ -1,4 +1,7 @@
|
||||
use std::io::Write;
|
||||
use serde::Deserialize;
|
||||
use serde_json::Value;
|
||||
use std::collections::HashMap;
|
||||
use std::path::Path;
|
||||
|
||||
const VARIATION_SEQUENCES: &str = include_str!("../../data/emoji-variation-sequences.txt");
|
||||
@@ -18,30 +21,26 @@ fn main() {
|
||||
fn generate_nerdfonts_data() {
|
||||
let mut symbols: Vec<(String, char)> = vec![];
|
||||
|
||||
for set in &["cod", "dev", "fa", "fae", "iec", "logos", "md", "oct", "ple", "pom", "seti", "weather"] {
|
||||
let url = format!("https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/bin/scripts/lib/i_{set}.sh");
|
||||
let filename = format!("/tmp/termwiz-data-fa-{set}.sh");
|
||||
let url = "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/glyphnames.json";
|
||||
let body = reqwest::blocking::get(url).unwrap().text().unwrap();
|
||||
|
||||
if !Path::new(&filename).exists() {
|
||||
let body = reqwest::blocking::get(url).unwrap().text().unwrap();
|
||||
std::fs::write(&filename, &body).unwrap();
|
||||
}
|
||||
|
||||
let data = std::fs::read_to_string(&filename).unwrap();
|
||||
|
||||
for line in data.lines() {
|
||||
let fields: Vec<&str> = line.split(' ').collect();
|
||||
if fields.len() == 2 {
|
||||
if let Some(codepoint) = fields[0].strip_prefix("i='").and_then(|s| s.strip_suffix("'")) {
|
||||
if let Some(name) = fields[1].strip_prefix("i_").and_then(|s| s.strip_suffix("=$i")) {
|
||||
let codepoint = codepoint.chars().next().unwrap();
|
||||
symbols.push((name.to_string(), codepoint));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#[derive(Deserialize)]
|
||||
struct Glyph{
|
||||
#[serde(rename="char")]
|
||||
glyph_text: char,
|
||||
code: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct Glyphnames {
|
||||
#[serde(rename="METADATA")]
|
||||
metadata: Value,
|
||||
#[serde(flatten)]
|
||||
glyphs: HashMap<String, Glyph>,
|
||||
}
|
||||
|
||||
let parsed: Glyphnames = serde_json::from_str(&body).unwrap();
|
||||
symbols = parsed.glyphs.into_iter().map(|(name, g)| (name.replace("-", "_"), g.glyph_text)).collect();
|
||||
symbols.sort_by(|(a, _), (b, _)| human_sort::compare(a, b));
|
||||
|
||||
let mut f = std::fs::File::create("../src/nerdfonts_data.rs").unwrap();
|
||||
|
||||
+1648
-108
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user