FreeTypeSharp 3.0.0
dotnet add package FreeTypeSharp --version 3.0.0
NuGet\Install-Package FreeTypeSharp -Version 3.0.0
<PackageReference Include="FreeTypeSharp" Version="3.0.0" />
paket add FreeTypeSharp --version 3.0.0
#r "nuget: FreeTypeSharp, 3.0.0"
// Install FreeTypeSharp as a Cake Addin #addin nuget:?package=FreeTypeSharp&version=3.0.0 // Install FreeTypeSharp as a Cake Tool #tool nuget:?package=FreeTypeSharp&version=3.0.0
FreeTypeSharp
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
- uap10.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 | 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-android34.0 is compatible. net8.0-browser was computed. net8.0-ios was computed. net8.0-ios17.2 is compatible. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-tvos17.2 is compatible. 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 is compatible. |
.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 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. |
-
.NETCoreApp 3.1
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net8.0
- No dependencies.
-
net8.0-android34.0
- No dependencies.
-
net8.0-ios17.2
- No dependencies.
-
net8.0-tvos17.2
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on FreeTypeSharp:
Package | Downloads |
---|---|
KinsonDigital.Velaptor
2D game or application development framework that provides 2D rendering, audio, keyboard and mouse input, etc. |
|
FontStashSharp.Rasterizers.FreeType
Package Description |
|
Cubic
A fast & easy cross-platform 2D & 3D game engine for C#. |
|
tinybuffer
Package Description |
|
UnoEngine
A high-level abstraction library for facilitating console customization, high-quality console outputs, straightforward audio output, image printing, intelligent and customizable text printing, and key binding to functions. It can be used for learning to program, focusing on program logic, and getting familiar with aesthetic interface design with minimal code. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on FreeTypeSharp:
Repository | Stars |
---|---|
galister/WlxOverlay
A simple OpenVR overlay for Wayland and X11 desktops
|
Version | Downloads | Last updated |
---|---|---|
3.0.0 | 4,828 | 4/14/2024 |
2.2.0 | 1,001 | 3/20/2024 |
2.1.0 | 195 | 3/17/2024 |
2.0.0.12-ci | 1,503 | 6/26/2022 |
2.0.0.10-ci | 199 | 6/23/2022 |
2.0.0.8-ci | 1,897 | 11/20/2021 |
1.1.3 | 25,773 | 9/2/2020 |
1.1.2 | 5,048 | 5/26/2020 |
1.1.0 | 624 | 3/22/2020 |
1.0.0 | 509 | 3/21/2020 |
0.10.1 | 448 | 3/20/2020 |
0.9.0 | 532 | 3/19/2020 |