Meziantou.Framework.Fonts
1.0.1
Prefix Reserved
dotnet add package Meziantou.Framework.Fonts --version 1.0.1
NuGet\Install-Package Meziantou.Framework.Fonts -Version 1.0.1
<PackageReference Include="Meziantou.Framework.Fonts" Version="1.0.1" />
<PackageVersion Include="Meziantou.Framework.Fonts" Version="1.0.1" />
<PackageReference Include="Meziantou.Framework.Fonts" />
paket add Meziantou.Framework.Fonts --version 1.0.1
#r "nuget: Meziantou.Framework.Fonts, 1.0.1"
#:package Meziantou.Framework.Fonts@1.0.1
#addin nuget:?package=Meziantou.Framework.Fonts&version=1.0.1
#tool nuget:?package=Meziantou.Framework.Fonts&version=1.0.1
Meziantou.Framework.Fonts
The fully managed OpenType font reader and text shaper of Meziantou.Framework.Imaging and Meziantou.Framework.WebPlatform.
Its public API (FontLoader, FontFace, TextShaper, GlyphBuffer, ...) is the one these packages use: to load fonts and draw text, Meziantou.Framework.Imaging is the simpler entry point. The packages that use it depend on its exact version, so update them together.
What it covers:
- TrueType and OpenType fonts and font collections, WOFF 1.0 and WOFF 2.0
- TrueType, CFF and CFF2 outlines, variable fonts (
fvar,avar1 and 2,gvar,HVAR,VVAR,MVAR) - Color fonts:
COLRversions 0 and 1,CPAL,sbix,CBDT - Horizontal and vertical metrics,
BASEbaselines - Text shaping with
GSUBandGPOS, and the shaping models of complex scripts (Arabic, Hebrew, Indic, Khmer, Myanmar, Thai and Lao, Hangul, and the universal shaping engine) - The fonts installed on Windows, macOS and Linux (
SystemFontCollection): an index of their faces by family and by name, read without loading the fonts, and the font matching of CSS to choose a face of a family
The types are in the Meziantou.Framework.Fonts namespace:
// The fonts of the machine are scanned once per process; only the tables that describe a face are read.
var fonts = SystemFontCollection.Default;
if (fonts.Match("Arial", weight: 700, isItalic: false) is { } face)
{
using var stream = File.OpenRead(face.FilePath);
var font = FontLoader.Load(stream, new PooledFontEnvironment(FontResourceLimits.Default, 64 * 1024 * 1024))[face.FaceIndex];
Console.WriteLine($"{font.FamilyName} {font.SubfamilyName}: {font.UnitsPerEm} units per em");
}
The installed fonts are found in the fonts directory of Windows, in the fonts installed for the user and in the files the registry lists; in the Library/Fonts directories of macOS and in the fonts it downloads on demand; and on Linux in the directories of the configuration of fontconfig (fonts.conf and the files it includes) and in the XDG font directories. SystemFontCollection.Create indexes chosen directories instead.
It is written from the specifications and checked against HarfBuzz and FreeType.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. net11.0 is compatible. |
-
net10.0
- Meziantou.Framework.Unicode (>= 2.0.12)
-
net11.0
- Meziantou.Framework.Unicode (>= 2.0.12)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Meziantou.Framework.Fonts:
| Package | Downloads |
|---|---|
|
Meziantou.Framework.Imaging
Fully managed, performance-oriented image library for .NET: PNG, APNG, GIF, JPEG, WebP, QOI, BMP, TGA, Netpbm, TIFF, ICO/CUR, ANI, AVIF, HEIC and JPEG 2000 decoding/encoding, JPEG XL decoding and lossless/lossy encoding, lossless JPEG recompression as JPEG XL, animation-aware processing, vector drawing, ICC color conversion, and bounded-memory streaming. |
|
|
Meziantou.Framework.WebPlatform
Spec-compliant HTML, XML, SVG and CSS parser exposing the browser DOM API (WHATWG DOM, HTML, URL, Encoding, Selectors, CSSOM, DOM XPath). |
GitHub repositories
This package is not used by any popular GitHub repositories.