sixlabors - SixLabors.Fonts 1.0.0-beta18.5

A cross-platform library for loading and laying out fonts for processing and measuring; written in C#

PM> Install-Package SixLabors.Fonts -Version 1.0.0-beta18.5 -Source https://www.myget.org/F/sixlabors/api/v3/index.json

Copy to clipboard

> nuget.exe install SixLabors.Fonts -Version 1.0.0-beta18.5 -Source https://www.myget.org/F/sixlabors/api/v3/index.json

Copy to clipboard

> dotnet add package SixLabors.Fonts --version 1.0.0-beta18.5 --source https://www.myget.org/F/sixlabors/api/v3/index.json

Copy to clipboard
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta18.5" />
Copy to clipboard
source https://www.myget.org/F/sixlabors/api/v3/index.json

nuget SixLabors.Fonts  ~> 1.0.0-beta18.5
Copy to clipboard

> choco install SixLabors.Fonts --version 1.0.0-beta18.5 --source https://www.myget.org/F/sixlabors/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "sixlabors" -SourceLocation "https://www.myget.org/F/sixlabors/api/v2"
Install-Module -Name "SixLabors.Fonts" -RequiredVersion "1.0.0-beta18.5" -Repository "sixlabors" -AllowPreRelease
Copy to clipboard

Browse the sources in this package using Visual Studio or WinDbg by configuring the following symbol server URL: https://www.myget.org/F/sixlabors/api/v2/symbolpackage/


SixLabors.Fonts
SixLabors.Fonts

Build Status codecov License: Six Labors Split

SixLabors.Fonts is a cross-platform library for loading, measuring, and laying out fonts and text. It supports TrueType and OpenType fonts (including CFF1 and CFF2 outlines), WOFF/WOFF2 web fonts, variable fonts, color fonts (COLR v0/v1 and SVG), and TrueType hinting. The library provides a full OpenType layout engine with GSUB/GPOS support, advanced text shaping for complex scripts, and bidirectional text rendering.

Fonts also exposes high-level text layout primitives for applications that need more than a single bounding box. Callers can measure advance, ink bounds, renderable bounds, lines, words, graphemes, and glyphs; reuse prepared text across multiple wrapping widths; inspect the resolved font used to shape and render fallback glyphs; and use built-in hit testing, caret placement, and selection geometry.

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

LFS

This repository uses LFS Large File Storage. To configure it for the project, navigate to the repository root and type:

git lfs install
git lfs pull

Features

  • Reading font description (name, family, subname etc plus other string metadata).
  • Loading TrueType fonts and OpenType fonts with CFF1 and CFF2 outlines.
  • Loading WOFF and WOFF2 web fonts.
  • Loading all compatible fonts from the local machine store.
  • Support for variable fonts (fvar, gvar, cvar, CFF2 variations).
  • Support for color fonts (COLR v0/v1 and SVG).
  • TrueType hinting (FreeType v40-compatible interpreter).
  • Support for advanced OpenType layout via glyph substitution (GSUB) and glyph positioning (GPOS).
  • Advanced text shaping for complex scripts (Indic, Myanmar, Universal Shaping Engine).
  • Support for ligatures and kerning.
  • Support for rendering left to right, right to left, and bidirectional text.
  • Support for line breaking based on UAX 14.
  • Support for reusable prepared text layout via TextBlock.
  • Text measurement APIs for advance bounds, ink bounds, renderable bounds, line metrics, word metrics, grapheme metrics, and glyph metrics.
  • Glyph and grapheme metrics expose the resolved font used to shape and render each entry, including fallback fonts.
  • Text interaction helpers for hit testing, caret positioning, caret movement, and selection bounds.
  • Support for wrapping, trimming, ellipsis, hyphenation, tab width, tracking, line height, and horizontal and vertical layout modes.

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

  • .NETCoreApp 3.1
  • .NETStandard 2.0
    • System.Buffers (>= 4.5.1)
    • System.IO.Compression (>= 4.3.0)
    • System.IO.UnmanagedMemoryStream (>= 4.3.0)
    • System.Memory (>= 4.5.4)
    • System.Numerics.Vectors (>= 4.5.0)
    • System.Runtime.CompilerServices.Unsafe (>= 4.7.0)
    • System.Threading.Tasks.Parallel (>= 4.3.0)
    • System.ValueTuple (>= 4.5.0)
  • .NETStandard 2.1
    • System.IO.Compression (>= 4.3.0)
    • System.IO.UnmanagedMemoryStream (>= 4.3.0)
    • System.Numerics.Vectors (>= 4.5.0)
    • System.Runtime.CompilerServices.Unsafe (>= 4.7.0)
    • System.Threading.Tasks.Parallel (>= 4.3.0)
    • System.ValueTuple (>= 4.5.0)
  • .NETCoreApp 3.1: 3.1.0.0
  • .NETStandard 2.0: 2.0.0.0
  • .NETStandard 2.1: 2.1.0.0

Owners

Six Labors Scott Williams James Jackson-South

Authors

Six Labors and contributors

Project URL

https://github.com/SixLabors/Fonts

License

Apache-2.0

Tags

font truetype opentype woff woff2

Info

8631 total downloads
160 downloads for version 1.0.0-beta18.5
Download (751.42 KB)
Download symbols (261.84 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
1.0.0-beta19.19 849.59 KB Fri, 07 Jul 2023 22:57:38 GMT 222
1.0.0-beta19.18 772.69 KB Fri, 30 Jun 2023 02:40:41 GMT 202
1.0.0-beta19.15 776.91 KB Mon, 26 Jun 2023 05:56:15 GMT 192
1.0.0-beta19.14 776.89 KB Wed, 21 Jun 2023 02:22:54 GMT 179
1.0.0-beta19.13 781.19 KB Thu, 04 May 2023 11:13:57 GMT 201
1.0.0-beta19.12 781.16 KB Mon, 01 May 2023 12:23:12 GMT 160
1.0.0-beta19.11 780.55 KB Sat, 29 Apr 2023 03:21:44 GMT 198
1.0.0-beta19.10 760.1 KB Thu, 16 Mar 2023 01:46:07 GMT 189
1.0.0-beta19.9 760.07 KB Wed, 15 Mar 2023 12:04:21 GMT 188
1.0.0-beta19.6 754.92 KB Sun, 29 Jan 2023 12:07:12 GMT 180
1.0.0-beta19.5 754.48 KB Mon, 09 Jan 2023 06:10:09 GMT 174
1.0.0-beta19.4 754.45 KB Tue, 27 Dec 2022 11:25:13 GMT 161
1.0.0-beta19.3 754.46 KB Tue, 20 Dec 2022 12:42:47 GMT 175
1.0.0-beta19.2 754.45 KB Mon, 05 Dec 2022 10:56:56 GMT 168
1.0.0-beta19.1 754.54 KB Thu, 24 Nov 2022 12:18:27 GMT 194
1.0.0-beta19 754.48 KB Mon, 01 May 2023 12:22:48 GMT 150
1.0.0-beta18.6 754.52 KB Sat, 15 Oct 2022 13:47:40 GMT 175
1.0.0-beta18.5 751.42 KB Mon, 10 Oct 2022 23:39:46 GMT 160
1.0.0-beta18.4 751.38 KB Mon, 03 Oct 2022 20:47:02 GMT 156
1.0.0-beta18.3 751.38 KB Tue, 27 Sep 2022 12:59:52 GMT 149
1.0.0-beta18.2 751.38 KB Fri, 19 Aug 2022 13:50:01 GMT 159
1.0.0-beta18.1 751.35 KB Tue, 26 Jul 2022 05:22:28 GMT 147
1.0.0-beta18 751.24 KB Fri, 22 Jul 2022 14:06:54 GMT 183
1.0.0-beta17.16 751.26 KB Sat, 02 Jul 2022 06:33:50 GMT 149
1.0.0-beta17.15 749.39 KB Sat, 02 Jul 2022 06:24:40 GMT 145
1.0.0-beta17.14 748.78 KB Thu, 30 Jun 2022 05:17:41 GMT 155
1.0.0-beta17.13 748.97 KB Wed, 29 Jun 2022 09:25:29 GMT 145
1.0.0-beta17.12 751.12 KB Mon, 27 Jun 2022 10:16:43 GMT 145
1.0.0-beta17.11 750.29 KB Sun, 19 Jun 2022 12:48:44 GMT 150
1.0.0-beta17.10 752.31 KB Tue, 14 Jun 2022 12:55:33 GMT 156
1.0.0-beta17.9 752.29 KB Tue, 14 Jun 2022 12:13:23 GMT 167
1.0.0-beta17.8 752.88 KB Fri, 10 Jun 2022 08:18:46 GMT 158
1.0.0-beta17.7 692.63 KB Sat, 04 Jun 2022 20:17:56 GMT 171
1.0.0-beta17.6 692.62 KB Sat, 04 Jun 2022 19:49:59 GMT 147
1.0.0-beta17.5 692.63 KB Sat, 04 Jun 2022 19:22:23 GMT 182
1.0.0-beta17.4 692.64 KB Sat, 04 Jun 2022 18:18:58 GMT 143
1.0.0-beta17.3 692.63 KB Sat, 04 Jun 2022 17:54:06 GMT 166
1.0.0-beta17.2 692.63 KB Sat, 04 Jun 2022 17:01:38 GMT 152
1.0.0-beta17.1 692.64 KB Wed, 25 May 2022 12:50:39 GMT 153
1.0.0-beta17 692.29 KB Wed, 18 May 2022 09:40:22 GMT 147
1.0.0-beta16.16 692.33 KB Tue, 17 May 2022 10:39:38 GMT 116
1.0.0-beta16.13 674.29 KB Mon, 28 Mar 2022 09:16:08 GMT 141
1.0.0-beta16.11 643.9 KB Wed, 02 Mar 2022 01:53:25 GMT 137
1.0.0-beta16.6 640.2 KB Thu, 24 Feb 2022 22:16:33 GMT 139
1.0.0-beta16 636.46 KB Wed, 09 Feb 2022 02:06:46 GMT 152
1.0.0-beta15.26 847.99 KB Sun, 06 Feb 2022 11:48:26 GMT 149
1.0.0-beta15.25 852.83 KB Mon, 24 Jan 2022 11:13:55 GMT 135
1.0.0-beta15.24 852.48 KB Mon, 06 Dec 2021 01:23:04 GMT 219
1.0.0-beta15.23 851.71 KB Thu, 02 Dec 2021 10:08:49 GMT 115
1.0.0-beta15.20 847.49 KB Wed, 17 Nov 2021 11:35:13 GMT 165
1.0.0-beta15.17 504.17 KB Mon, 27 Sep 2021 01:15:37 GMT 157
1.0.0-beta15.16 504.92 KB Sun, 26 Sep 2021 12:09:16 GMT 148
1.0.0-beta15.15 504.33 KB Wed, 15 Sep 2021 14:23:47 GMT 165