SixLabors.Fonts is a new cross-platform font loading and drawing library.
- Fonts is licensed under the Six Labors Split License, Version 1.0
Support the efforts of the development of the Six Labors projects.
- Purchase a Commercial License ❤️
- Become a sponsor via GitHub Sponsors ❤️
- Become a sponsor via Open Collective ❤️
- Detailed documentation for the Fonts API is available. This includes additional conceptual documentation to help you get started.
- Our Samples Repository is also available containing buildable code samples demonstrating common activities.
- Do you have questions? We are happy to help! Please join our Discussions Forum.
- Please read our Contribution Guide before opening issues or pull requests!
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
Install stable releases via Nuget; development releases are available via Feedz.io.
Package Name | Release (NuGet) | Nightly (Feedz.io) |
---|---|---|
SixLabors.Fonts |
If you prefer, you can compile Fonts yourself (please do and help!)
- Using Visual Studio 2022
- Make sure you have the latest version installed
- Make sure you have the .NET 7 SDK installed
Alternatively, you can work from command line and/or with a lightweight editor on both Linux/Unix and Windows:
To clone Fonts locally, click the "Clone in [YOUR_OS]" button above or run the following git commands:
git clone https://github.com/SixLabors/Fonts
If working with Windows please ensure that you have enabled log file paths in git (run as Administrator).
git config --system core.longpaths true
This repository contains git submodules. To add the submodules to the project, navigate to the repository root and type:
git submodule update --init --recursive
- Reading font description (name, family, subname etc plus other string metadata).
- Loading OpenType fonts with with CFF1 and True Type outlines.
- Loading True Type fonts.
- Loading WOFF fonts.
- Loading WOFF2 fonts.
- Load all compatible fonts from local machine store.
- Support for line breaking based on UAX 14
- Support for rendering left to right, right to left and bidirectional text.
- Support for ligatures.
- Support for advanced OpenType features glyph substitution (GSUB) and glyph positioning (GPOS)
FontDescription description = null;
using(var fs = File.OpenRead("Font.ttf")){
description = FontDescription.Load(fs); // once it has loaded the data the stream is no longer required and can be disposed of
}
string name = description.FontName(CultureInfo.InvariantCulture);
FontCollection fonts = new FontCollection();
FontFamily font1 = fonts.Add("./path/to/font1.ttf");
FontFamily font2 = fonts.Add("./path/to/font2.woff");
Please... Spread the word, contribute algorithms, submit performance improvements, unit tests.
- SixLabors.ImageSharp.Drawing - cross platform, fully managed, image drawing library.