skera
skera is a Rust library and binary for subsetting a font file according to provided input.
Installation
Library
To use skera in your Rust project, add it via cargo:
CLI
To install the skera command-line tool, use cargo install with the cli feature enabled:
Usage
CLI
To subset a font using the command-line tool:
For a full list of available options and flags, run:
Profiling
How-To: Profile a Skera Binary using Samply
Prerequisites
Install samply using Cargo:
Step 1: Enable Debug Symbols in Release Profiles
Add the following configuration to your root Cargo.toml:
Step 2: Compile your crate using the release profile with the cli feature:
Step 3: Record and Profile the Binary
Run the generated release executable using samply record. Replace with your compiled binary's name and <args...> with any execution arguments:
example:
Step 4: Analyze the Results
Once your binary finishes execution, samply automatically starts a local web server and prints a URL to the console:
Open the provided link in your web browser. The browser will open the Firefox Profiler interface, populated with your recorded run's call tree, flame graph, and timeline views.
Alternative Profiling Tools
If samply is not suitable for your target environment, you may consider these alternative options:
cargo-flamegraph: A tool that utilizes perf (on Linux) or dtrace (on macOS) to generate a static vector-graphic .svg flame graph.
perf (Linux-only): The standard system profiler on Linux, useful for command-line profiling and capturing kernel-level events.