FreeTypeSharp.UWP 3.0.1

dotnet add package FreeTypeSharp.UWP --version 3.0.1
                    
NuGet\Install-Package FreeTypeSharp.UWP -Version 3.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FreeTypeSharp.UWP" Version="3.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FreeTypeSharp.UWP" Version="3.0.1" />
                    
Directory.Packages.props
<PackageReference Include="FreeTypeSharp.UWP" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FreeTypeSharp.UWP --version 3.0.1
                    
#r "nuget: FreeTypeSharp.UWP, 3.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FreeTypeSharp.UWP@3.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FreeTypeSharp.UWP&version=3.0.1
                    
Install as a Cake Addin
#tool nuget:?package=FreeTypeSharp.UWP&version=3.0.1
                    
Install as a Cake Tool

FreeTypeSharp

Nuget

A modern managed FreeType2 library which has source code generated from the original C headers.

FreeTypeSharp v2+ provides cross-platform bindings for:

  • netcoreapp3.1;net8.0 (Windows, Linux, macOS)
  • net8.0-android
  • net8.0-ios
  • net8.0-tvos
  • netstandard2.0
  • net9.0 (UWP)

README for release v1.X

FreeType Wrapped

FreeType 2.13.2

Native binaries are built by the CI in https://github.com/ryancheung/freetype/tree/csharp-patch

Installation

dotnet add package FreeTypeSharp

UWP target is in a seperate package

dotnet add package FreeTypeSharp.UWP

Usage

There's no magic(abstraction) based on the original C freetype API. All managed API are almost identical with the original freetype C API.
Import the namespaces like using FreeTypeSharp; and using static FreeTypeSharp.FT;, then you can play the font rendering as what you do in C.

Here are few sample code:

using static FreeTypeSharp.FT;
using static FreeTypeSharp.FT_LOAD;
using static FreeTypeSharp.FT_Render_Mode_;

FT_LibraryRec_* lib;
FT_FaceRec_* face;
var error = FT_Init_FreeType(&lib);

error = FT_New_Face(lib, (byte*)Marshal.StringToHGlobalAnsi("some_font_name.ttf"), 0, &face);
error = FT_Set_Char_Size(face, 0, 16 * 64, 300, 300);
var glyphIndex = FT_Get_Char_Index(face, 'F');
error = FT_Load_Glyph(face, glyphIndex, FT_LOAD_DEFAULT);
error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL);
...

More FreeType docs: https://freetype.org/freetype2/docs/documentation.html

Credits

Special thanks to https://github.com/tonisimakov99/FreeTypeBinding for source code generator.

Product Compatible and additional computed target framework versions.
.NET net9.0-windows10.0.26100 is compatible.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0-windows10.0.26100

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FreeTypeSharp.UWP:

Package Downloads
FNA.NET.FontStashSharp

FontStashSharp for FNA.NET

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.1 500 7/23/2025
3.0.0 177 4/14/2024
2.2.0 162 3/20/2024