✒️ Font loading and layout library.
Перейти к файлу
James Jackson-South e0eb5032d8
Merge pull request #366 from SixLabors/dependabot/github_actions/actions/setup-dotnet-4
Bump actions/setup-dotnet from 3 to 4
2023-12-05 11:54:17 +10:00
.github Bump actions/setup-dotnet from 3 to 4 2023-12-04 20:50:36 +00:00
samples Fix null ref exception 2023-11-30 20:09:09 +10:00
shared-infrastructure@353b9afe32 Update license 2023-08-24 19:47:14 +10:00
src Fix .NET 7 warnings 2023-11-30 20:22:43 +10:00
tests Fix null ref exception 2023-11-30 20:09:09 +10:00
.editorconfig Update license 2023-08-24 19:47:14 +10:00
.gitattributes Update license 2023-08-24 19:47:14 +10:00
.gitignore
.gitmodules
CODE_OF_CONDUCT.md
Directory.Build.props Replace MyGet 2023-03-13 21:10:18 +10:00
Directory.Build.targets
LICENSE Update license 2023-08-24 19:47:14 +10:00
README.md Use overloads while passing culture 2023-09-25 20:10:31 +10:00
SixLabors.Fonts.sln Readme and workflows 2023-08-24 21:33:27 +10:00
SixLabors.Fonts.sln.DotSettings
SixLabors.Fonts.v3.ncrunchsolution
ci-build.ps1 Readme and workflows 2023-08-24 21:33:27 +10:00
ci-pack.ps1
ci-test.ps1
codecov.yml

README.md

SixLabors.Fonts
SixLabors.Fonts

Build Status codecov License: Six Labors Split GitHub issues GitHub stars GitHub forks

SixLabors.Fonts is a new cross-platform font loading and drawing library.

License

Support Six Labors

Support the efforts of the development of the Six Labors projects.

Documentation

  • 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.

Questions

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.

Installation

Install stable releases via Nuget; development releases are available via Feedz.io.

Package Name Release (NuGet) Nightly (Feedz.io)
SixLabors.Fonts NuGet feedz.io

Manual build

If you prefer, you can compile Fonts yourself (please do and help!)

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

Submodules

This repository contains git submodules. To add the submodules to the project, navigate to the repository root and type:

git submodule update --init --recursive

Features

  • 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)

API Examples

Read font description

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);

Populating a font collection

FontCollection fonts = new FontCollection();
FontFamily font1 = fonts.Add("./path/to/font1.ttf");
FontFamily font2 = fonts.Add("./path/to/font2.woff");

How can you help?

Please... Spread the word, contribute algorithms, submit performance improvements, unit tests.

Projects using SixLabors.Fonts

The SixLabors.Fonts Team