SlugText-Sharp
0.1.2
dotnet add package SlugText-Sharp --version 0.1.2
NuGet\Install-Package SlugText-Sharp -Version 0.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SlugText-Sharp" Version="0.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SlugText-Sharp" Version="0.1.2" />
<PackageReference Include="SlugText-Sharp" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SlugText-Sharp --version 0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SlugText-Sharp, 0.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SlugText-Sharp@0.1.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SlugText-Sharp&version=0.1.2
#tool nuget:?package=SlugText-Sharp&version=0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SlugText-Sharp
Slug is now open source, and SlugText-Sharp is a 100% C# implementation of Slug-style .slug ("SLUGGISH") generation.
The core library is intentionally minimal and depends on:
FreeTypeSharp
Context
- Upstream Slug project (Eric Lengyel): https://github.com/EricLengyel/Slug
- This repository focuses on generation/serialization in C# for .NET workflows.
What This Library Provides
- Compile
.ttf/.otffonts to.slugbinaries. - Restrict generation to custom charsets (ASCII, extended ASCII, CJK, Korean, etc.).
- Validate generated binary structure.
- Optional progress + timing callbacks for profiling generation steps.
Install
dotnet add package SlugText-Sharp
Quick Start (Core)
using SlugSharp.Core;
var result = SlugCompiler.CompileWithReport(
fontPath: "fonts/SpaceMono-Regular.ttf",
options: new GeneratorOptions { BandCount = 16 },
validateOutput: true);
File.WriteAllBytes("SpaceMono.slug", result.Bytes);
Console.WriteLine($"Generated in {result.Report.TotalMilliseconds} ms");
CLI Usage
dotnet run --project SlugSharp.CLI -- <fontPath> <outputPath> [options]
Common options:
--full-range--whitelist=32,65,66--charset-file=charset.txt--validate-charset--print-charset--progress--progress-interval=100--timings
Example:
dotnet run --project SlugSharp.CLI -- fonts/SpaceMono-Regular.ttf out.slug --charset-file=fonts/test_fonts/charsets/eascii_korean.txt --progress --timings
Test Your Generated .slug Files
If you want to quickly inspect and test generated sluggish files in browser:
- TypeScript implementation (
TS-SLUG): https://github.com/ExtraBinoss/ts-slug - Live demo: https://extrabinoss.github.io/ts-slug/
You can load .slug files generated by this C# library directly in that demo.
Documentation
- Core usage: docs/core-usage.md
- Licensing and attribution: docs/licensing-and-attribution.md
License
This project is licensed under MIT. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- FreeTypeSharp (>= 3.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.