From 2e93bdcff7cd9eff703d8b0814fe8857f6c69659 Mon Sep 17 00:00:00 2001 From: Thomas Churchman Date: Fri, 26 Jul 2024 09:40:58 +0200 Subject: [PATCH] refactor: change project name font-metrics is taken on crates.io --- .github/workflows/ci.yml | 10 +++++----- Cargo.lock | 2 +- Cargo.toml | 4 ++-- README.md | 18 +++++++++--------- default.nix | 2 +- flake.nix | 4 ++-- font-enumeration/Cargo.toml | 2 +- font-enumeration/README.md | 2 +- src/logger.rs | 4 ++-- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbcbb66..167fdff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,13 +25,13 @@ jobs: - name: Run font-enumeration tests run: cargo test --package font-enumeration --verbose - build-and-test-font-metrics: + build-and-test-font-info: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build font-metrics - run: cargo build --package font-metrics --verbose - - name: Run font-metrics tests - run: cargo test --package font-metrics --verbose + - name: Build font-info + run: cargo build --package font-info --verbose + - name: Run font-info tests + run: cargo test --package font-info --verbose diff --git a/Cargo.lock b/Cargo.lock index 3c78b54..8aaaec8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -222,7 +222,7 @@ dependencies = [ ] [[package]] -name = "font-metrics" +name = "font-info" version = "0.1.0" dependencies = [ "anyhow", diff --git a/Cargo.toml b/Cargo.toml index df89f25..4b685f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "font-metrics" +name = "font-info" version = "0.1.0" edition = "2021" description = "Load fonts and print their metrics" keywords = ["font", "glyph", "text"] license = "MIT OR Apache-2.0" readme = "README.md" -repository = "https://github.com/tomcur/font-metrics" +repository = "https://github.com/tomcur/font-info" [dependencies] anyhow = "1.0.86" diff --git a/README.md b/README.md index dd42b52..b351d90 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@
-# font-metrics 🗚 +# font-info 🗚 **Load fonts and print their metrics** ![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg) -[![Crates.io](https://img.shields.io/crates/v/font-metrics.svg)](https://crates.io/crates/font-metrics) -[![Build status](https://github.com/tomcur/font-metrics/workflows/CI/badge.svg)](https://github.com/tomcur/font-metrics/actions) +[![Crates.io](https://img.shields.io/crates/v/font-info.svg)](https://crates.io/crates/font-info) +[![Build status](https://github.com/tomcur/font-info/workflows/CI/badge.svg)](https://github.com/tomcur/font-info/actions)
@@ -25,12 +25,12 @@ Supported platforms: ## Usage -See `$ font-metrics --help` for CLI usage documentation. For example, to find +See `$ font-info --help` for CLI usage documentation. For example, to find all fonts in the "Liberation Sans" font family on your system and print out their metrics, run: ```bash -$ font-metrics --family-name "Liberation Sans" +$ font-info --family-name "Liberation Sans" -[ FONT 1 ]------------------------------------------------- Source: /path/to/share/fonts/truetype/LiberationSans-Bold.ttf Font index in source: 0 @@ -57,7 +57,7 @@ The previous command has human-readable output. To output as machine-readable JSON, run: ```bash -$ font-metrics --family-name "Liberation Sans" --format json +$ font-info --family-name "Liberation Sans" --format json ``` You can print fonts' features and supported writing systems using the @@ -68,13 +68,13 @@ You can print fonts' features and supported writing systems using the Install using Cargo: ```bash -$ cargo install font-metrics -$ font-metrics --family-name "Liberation Sans" +$ cargo install font-info +$ font-info --family-name "Liberation Sans" ``` Run using Nix flakes: ```bash # Run ls -$ nix run github:tomcur/font-metrics -- --family-name "Liberation Sans" +$ nix run github:tomcur/font-info -- --family-name "Liberation Sans" ``` diff --git a/default.nix b/default.nix index 76d1256..c8308b8 100644 --- a/default.nix +++ b/default.nix @@ -4,7 +4,7 @@ , fontconfig }: rustPlatform.buildRustPackage { - pname = "font-metrics"; + pname = "font-info"; version = (lib.trivial.importTOML ./Cargo.toml).package.version; src = ./.; cargoLock = { diff --git a/flake.nix b/flake.nix index 12c0eaa..eafd8a4 100644 --- a/flake.nix +++ b/flake.nix @@ -13,8 +13,8 @@ pkgs = nixpkgs.legacyPackages.${system}; in rec { - packages.font-metrics = pkgs.callPackage ./default.nix { }; - packages.default = packages.font-metrics; + packages.font-info = pkgs.callPackage ./default.nix { }; + packages.default = packages.font-info; devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ diff --git a/font-enumeration/Cargo.toml b/font-enumeration/Cargo.toml index 464d48d..c3af4fd 100644 --- a/font-enumeration/Cargo.toml +++ b/font-enumeration/Cargo.toml @@ -6,7 +6,7 @@ description = "Simple cross-platform font enumeration" keywords = ["font", "text"] license = "MIT OR Apache-2.0" readme = "README.md" -repository = "https://github.com/tomcur/font-metrics" +repository = "https://github.com/tomcur/font-info" [dependencies] thiserror = "1.0" diff --git a/font-enumeration/README.md b/font-enumeration/README.md index edac966..89e97c1 100644 --- a/font-enumeration/README.md +++ b/font-enumeration/README.md @@ -6,7 +6,7 @@ ![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg) [![Crates.io](https://img.shields.io/crates/v/font-enumeration.svg)](https://crates.io/crates/font-enumeration) -[![Build status](https://github.com/tomcur/font-metrics/workflows/CI/badge.svg)](https://github.com/tomcur/font-metrics/actions) +[![Build status](https://github.com/tomcur/font-info/workflows/CI/badge.svg)](https://github.com/tomcur/font-info/actions) diff --git a/src/logger.rs b/src/logger.rs index d43da85..6188aef 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -25,13 +25,13 @@ impl Log for StderrLogger { let _ = match (record.file(), record.line()) { (Some(file), Some(line)) => writeln!( stderr, - "font-metrics: {}|{file}:{line}: {}", + "font-info: {}|{file}:{line}: {}", record.level(), record.args() ), (_, _) => writeln!( stderr, - "font-metrics: {}: {}", + "font-info: {}: {}", record.level(), record.args() ),