DocWright.Fonts
1.1.1
dotnet add package DocWright.Fonts --version 1.1.1
NuGet\Install-Package DocWright.Fonts -Version 1.1.1
<PackageReference Include="DocWright.Fonts" Version="1.1.1" />
<PackageVersion Include="DocWright.Fonts" Version="1.1.1" />
<PackageReference Include="DocWright.Fonts" />
paket add DocWright.Fonts --version 1.1.1
#r "nuget: DocWright.Fonts, 1.1.1"
#:package DocWright.Fonts@1.1.1
#addin nuget:?package=DocWright.Fonts&version=1.1.1
#tool nuget:?package=DocWright.Fonts&version=1.1.1
DocWright.Fonts
Font discovery, OpenType parsing, substitution and Word-compatible measurement for DocWright.
Zero dependencies.
Install
dotnet add package DocWright.Fonts
Most people should install DocWright
instead — it includes this package, and font handling then happens automatically.
What it does
- Discovers the fonts installed on the machine, wherever the platform keeps them
- Parses TrueType, OpenType/CFF and TrueType Collections
- Reads metrics, kerning and cluster advances so text measures the way Word measures it
- Decodes glyph outlines for rendering, and subsets them for embedding
- Substitutes a metric-compatible face when a document asks for a font you do not have, and tells you it did
Controlling font resolution
using DocWright;
var converter = new DocWrightConverter();
var options = new ConvertOptions
{
WarnOnFontSubstitution = true, // report every substitution
FailOnFontSubstitution = false, // or refuse to convert at all
};
options.FontDirectories.Add("/opt/fonts");
converter.Convert(input, output, options);
Substitutions are reported through diagnostics, so a document that rendered with the wrong fonts is something you can detect rather than something you discover later from a customer.
Embedded fonts
Fonts embedded in a document are loaded and used in preference to substituting, including
obfuscated (.odttf) payloads.
Bundled fonts
The package carries metric-compatible fallback faces so output is reasonable on a machine
with no fonts installed at all — a bare container, for example. These are OFL-licensed;
see THIRD-PARTY-NOTICES.md in the package.
Performance
Indexing the fonts on a machine costs about a second. DocWrightConverter caches the
result per instance, so reuse one converter rather than creating one per document.
Requirements
.NET Framework 4.8, .NET Standard 2.0, .NET 8.0 or .NET 10.0.
License
MIT for the code; bundled fonts under the SIL Open Font License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- DocWright.Core (>= 1.1.1)
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
.NETStandard 2.0
- DocWright.Core (>= 1.1.1)
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
net10.0
- DocWright.Core (>= 1.1.1)
-
net8.0
- DocWright.Core (>= 1.1.1)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on DocWright.Fonts:
| Package | Downloads |
|---|---|
|
DocWright.Formats.Pdf
Dependency-free PDF reader and rasterizer for DocWright. Parses an arbitrary PDF — cross-reference tables and streams, the object graph, stream filters, content streams, colour spaces and embedded font programs — and renders pages to PNG or JPEG. Read and rasterize only: it does not write PDF (see DocWright.Renderers.Pdf) and does not import into the editable document model. Most users should install the DocWright package instead, which includes this one. |
|
|
DocWright.Renderers.Pdf
The PDF writer for DocWright: a single-pass PDF 1.7 renderer with TrueType and CFF font subsetting, hyperlinks, document outline, accessibility structure and PDF/A-2b output. Deterministic — the same document renders byte-identically every time. Zero dependencies. For reading or rasterizing an existing PDF, see DocWright.Formats.Pdf. Most users should install the DocWright package instead, which includes this one. |
|
|
DocWright.Renderers.Imaging
The raster renderer for DocWright: renders document or PDF pages to PNG or JPEG. No System.Drawing, no SkiaSharp and no native binaries — the rasterizer and both encoders are included. Integer arithmetic throughout, so the same page renders byte-identically across platforms and framework versions. Most users should install the DocWright package instead, which includes this one. |
|
|
DocWright.Layout
Style resolution and page layout for DocWright: flattens document defaults, styles, numbering and theme into concrete formatting, then produces positioned pages — line breaking, tab stops, page and column breaks, table row breaking and repeated headers, floating objects and text wrapping, headers, footers and notes. Includes font preflight, which reports the substitutions a document would need before you pay for a conversion. Most users should install the DocWright package instead, which includes this one. |
|
|
DocWright
Convert, render and edit Word documents in .NET — no Microsoft Word, no Office interop, no native dependencies. Reads DOCX and legacy DOC, renders to PDF and PNG/JPEG, saves to DOCX, HTML, Markdown, RTF, text, ODT, EPUB and RDL, rasterizes existing PDFs, and edits documents through a mutable model with find/replace, placeholder filling, content controls and tracked changes. This is the main package: install it for the whole pipeline. |
GitHub repositories
This package is not used by any popular GitHub repositories.
See https://github.com/albahadly/DocWright/releases for release notes.