Aspose.Words.Shaping.HarfBuzz
24.10.0
See the version list below for details.
dotnet add package Aspose.Words.Shaping.HarfBuzz --version 24.10.0
NuGet\Install-Package Aspose.Words.Shaping.HarfBuzz -Version 24.10.0
<PackageReference Include="Aspose.Words.Shaping.HarfBuzz" Version="24.10.0" />
paket add Aspose.Words.Shaping.HarfBuzz --version 24.10.0
#r "nuget: Aspose.Words.Shaping.HarfBuzz, 24.10.0"
// Install Aspose.Words.Shaping.HarfBuzz as a Cake Addin #addin nuget:?package=Aspose.Words.Shaping.HarfBuzz&version=24.10.0 // Install Aspose.Words.Shaping.HarfBuzz as a Cake Tool #tool nuget:?package=Aspose.Words.Shaping.HarfBuzz&version=24.10.0
Aspose.Words.Shaping.Harfbuzz
Aspose.Words.Shaping.Harfbuzz is an add-on for Aspose.Words for .NET, a widely used document processing library. It utilizes the HarfBuzz text shaping engine to improve the rendering of OpenType fonts within documents.
Text shaping is crucial for properly displaying languages that require intricate glyph positioning and substitution, such as Arabic, Thai, Hebrew and others. By integrating HarfBuzz, Aspose.Words.Shaping.Harfbuzz allows Aspose.Words for .NET to provide more accurate text rendering and better support for OpenType fonts, ensuring that documents are displayed correctly across different platforms.
Please note: Aspose.Words.Shaping.Harfbuzz uses P/Invoke technology for invoking unmanaged functions from HarfBuzz.
Functionality
Shaping is an essential process getting text ready for display. Before rendering a Unicode sequence, the code points must be mapped to the corresponding glyphs from the font, and these glyphs need to be correctly positioned relative to each other.
As mentioned above, shaping is critical for displaying languages that require intricate glyph positioning and substitution. But for other languages based on the Latin or Cyrillic scripts, shaping is also necessary.
For correct display of fonts, shaping implements the following features:
kerning – changing the spacing between glyphs depending on their shape
ligatures (standard, contextual, historical, discretionary)
number spacing (proportional, tabular)
stylistic sets – feature that allows you to apply alternative designs or styles to specific characters or groups of characters within a font
How to Enable Text Shaping in Aspose.Words?
Text shaping is a non-trivial task, so Aspose.Words currently offers users to choose the third-party library that best suits their needs when implementing shaping. Aspose.Words provides the ITextShaper
and ITextShaperFactory
interfaces and expects that a third-party library implements them.
To enable shaping in Aspose.Words, it is needed to initialize the Document.LayoutOptions.TextShaperFactory
property with an instance of a class that implements the ITextShaperFactory
interface.
How to Aspose.Words.Shaping.Harfbuzz Works?
Aspose.Words.Shaping.Harfbuzz implements the ITextShaper
interface, using the harfbuzz.dll library underhood. In fact, Aspose.Words.Shaping.Harfbuzz is just an adapter that allows to use the harfbuzz.dll text shaping library in Aspose.Words.
The package provides class HarfBuzzTextShaperFactory
which implements ITextShaperFactory
and also BasicTextShaperCache
which just wraps up HarfBuzzTextShaperFactory
and supports caching and reusing of the loaded font files.
Aspose.Words.Shaping.Harfbuzz exposes a static property Aspose.Words.Shaping.HarfBuzz.HarfBuzzTextShaperFactory.Instance
which is an instance of the shaper factory supporting caching. Actually, to use Aspose.Words.Shaping.HarfBuzz you just need to initialize the Document.LayoutOptions.TextShaperFactory
property with this static field:
Document.LayoutOptions.TextShaperFactory = Aspose.Words.Shaping.HarfBuzz.HarfBuzzTextShaperFactory.Instance;
Getting Started
Would you like to give it a try? Let us guide you through the process in just a few simple steps. For Windows platforms, no additional efforts are required to install HarfBuzz, as Aspose.Words.Shaping.Harfbuzz already includes the compiled HarfBuzz library.
For other systems, Aspose.Words.Shaping.Harfbuzz relies on the already installed HarfBuzz library. For instance, on many Linux-based systems, HarfBuzz is installed system-wide by default. If not, there is usually a package available for installation through the package manager.
You can run the following code snippets in C# to see how our library works. Also feel free to check out the GitHub Repository for other common use cases.
// Load a Word file from the local drive.
Document doc = new Document("InputWordDocument.docx");
// Initialize TextShaper factory with predefined instance.
doc.LayoutOptions.TextShaperFactory = Aspose.Words.Shaping.HarfBuzz.HarfBuzzTextShaperFactory.Instance;
// Save it to HTML format.
doc.Save("OutputHtmlDocument.pdf");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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. |
.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 | net40 is compatible. net40-client is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. 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.0
- Aspose.Words (= 24.10.0)
-
.NETFramework 4.0 Client
- Aspose.Words (= 24.10.0)
-
.NETStandard 2.0
- Aspose.Words (= 24.10.0)
-
net6.0
- Aspose.Words (= 24.10.0)
-
net7.0
- Aspose.Words (= 24.10.0)
-
net8.0
- Aspose.Words (= 24.10.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Aspose.Words.Shaping.HarfBuzz:
Repository | Stars |
---|---|
aspose-words/Aspose.Words-for-.NET
Aspose.Words for .NET examples, plugins and showcases
|
Version | Downloads | Last updated |
---|---|---|
24.12.0 | 34 | 12/9/2024 |
24.11.1 | 597 | 11/15/2024 |
24.11.0 | 291 | 11/11/2024 |
24.10.0 | 1,576 | 10/8/2024 |
24.9.0 | 1,082 | 9/9/2024 |
24.8.0 | 7,711 | 8/7/2024 |
24.7.0 | 1,128 | 7/8/2024 |
24.6.0 | 1,809 | 6/8/2024 |
24.5.0 | 3,161 | 5/6/2024 |
24.4.0 | 1,350 | 4/3/2024 |
24.3.0 | 4,613 | 3/6/2024 |
24.2.0 | 1,832 | 2/6/2024 |
24.1.0 | 1,618 | 12/29/2023 |
23.12.0 | 3,077 | 12/6/2023 |
23.11.0 | 9,888 | 11/7/2023 |
23.10.0 | 2,477 | 10/6/2023 |
23.9.0 | 3,492 | 9/5/2023 |
23.8.0 | 3,034 | 8/7/2023 |
23.7.0 | 3,674 | 7/10/2023 |
23.6.0 | 6,543 | 6/6/2023 |
23.5.0 | 5,583 | 5/6/2023 |
23.4.0 | 1,447 | 4/5/2023 |
23.3.0 | 5,269 | 3/6/2023 |
23.2.0 | 2,674 | 2/3/2023 |
23.1.0 | 8,913 | 1/6/2023 |
22.12.0 | 1,962 | 12/2/2022 |
22.11.0 | 1,655 | 11/3/2022 |
22.10.0 | 2,446 | 10/6/2022 |
22.9.0 | 1,878 | 9/5/2022 |
22.8.0 | 1,276 | 8/3/2022 |
22.7.0 | 1,267 | 7/5/2022 |
22.6.0 | 12,745 | 6/4/2022 |
22.5.0 | 7,466 | 5/4/2022 |
22.4.0 | 1,321 | 4/2/2022 |
22.3.0 | 4,833 | 2/28/2022 |
22.2.0 | 6,844 | 2/2/2022 |
22.1.0 | 901 | 12/30/2021 |
21.12.0 | 3,514 | 12/8/2021 |
21.11.0 | 732 | 11/8/2021 |
21.10.0 | 11,837 | 10/7/2021 |
21.9.0 | 2,343 | 9/7/2021 |
21.8.0 | 1,126 | 8/4/2021 |
21.7.0 | 30,967 | 7/2/2021 |
21.6.0 | 1,617 | 6/3/2021 |
21.5.0 | 3,483 | 5/5/2021 |
21.4.0 | 819 | 4/2/2021 |
21.3.0 | 22,438 | 3/5/2021 |
21.2.0 | 6,067 | 2/3/2021 |
21.1.0 | 507 | 12/30/2020 |
20.12.0 | 818 | 12/7/2020 |
20.11.0 | 963 | 11/9/2020 |
20.10.0 | 994 | 10/7/2020 |
20.9.0 | 1,925 | 9/4/2020 |
20.8.0 | 1,642 | 8/4/2020 |
20.7.0 | 705 | 7/3/2020 |
20.6.0 | 755 | 6/3/2020 |
20.5.0 | 718 | 5/5/2020 |
20.4.0 | 734 | 4/3/2020 |
20.3.0 | 1,137 | 3/4/2020 |
20.2.0 | 868 | 2/4/2020 |
20.1.0 | 4,676 | 12/30/2019 |
19.12.0 | 729 | 12/9/2019 |
19.11.0 | 683 | 11/7/2019 |
19.10.0 | 606 | 10/8/2019 |
19.9.0 | 1,101 | 9/9/2019 |
19.8.0 | 609 | 9/2/2019 |
19.7.0 | 2,099 | 7/5/2019 |