DocWright.Fonts
1.1.4
dotnet add package DocWright.Fonts --version 1.1.4
NuGet\Install-Package DocWright.Fonts -Version 1.1.4
<PackageReference Include="DocWright.Fonts" Version="1.1.4" />
<PackageVersion Include="DocWright.Fonts" Version="1.1.4" />
<PackageReference Include="DocWright.Fonts" />
paket add DocWright.Fonts --version 1.1.4
#r "nuget: DocWright.Fonts, 1.1.4"
#:package DocWright.Fonts@1.1.4
#addin nuget:?package=DocWright.Fonts&version=1.1.4
#tool nuget:?package=DocWright.Fonts&version=1.1.4
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
- Shapes Arabic and Hebrew through the face's own OpenType tables (joining forms, ligatures, mark positioning, pair kerning) with no extra package
- 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.
Documentation
๐ DocWright documentation ยท
Fonts and complex scripts ยท
API reference: DocWright.Fonts
Contact
Questions, support or licensing: salwan@albahadly.com ยท www.albahadly.com
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.4)
- 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.4)
- 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.4)
-
net8.0
- DocWright.Core (>= 1.1.4)
NuGet packages (9)
Showing the top 5 NuGet packages that depend on DocWright.Fonts:
| Package | Downloads |
|---|---|
|
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.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.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. Also assembles pages: delete, extract, reorder, merge, split and duplicate pages of existing PDFs into a new file, without rasterizing or re-encoding a stream, with links, named destinations, outlines and page labels repaired. It does not render a laid-out document to 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.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.
Guides, tutorials and API reference: https://docs.albahadly.com/docwright/