CosmosTTF 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CosmosTTF --version 2.0.0                
NuGet\Install-Package CosmosTTF -Version 2.0.0                
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="CosmosTTF" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CosmosTTF --version 2.0.0                
#r "nuget: CosmosTTF, 2.0.0"                
#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.
// Install CosmosTTF as a Cake Addin
#addin nuget:?package=CosmosTTF&version=2.0.0

// Install CosmosTTF as a Cake Tool
#tool nuget:?package=CosmosTTF&version=2.0.0                

CosmosTTF

Fast TrueType Font rendering in Cosmos

Note: Only use the main branch. The other branches will not work as of now.

How to use

It is very easy to use this library. Add it to your project (currently, you will have to manually build it yourself, but I will publish this on NuGet soon). Then, you can register a font using TTFManager.RegisterFont(string name, byte[] rawFontData) where rawFontData contains the complete TTF file as a byte array. Then, you can start using the Canvas extension method Canvas.DrawStringTTF(Pen pen, string text, string fontName, float px, Point point, float spacingMultiplier). Please note that spacingMultiplier does nothing as of now.

This project is powered by a slightly modified version of LunarFonts by Relfos!

Some fonts are not working! How to fix?

Sadly, the library used is quite outdated and due to the complexity of TTF rendering, its unlikely that I can change that.

Product Compatible and additional computed target framework versions.
.NET 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 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CosmosTTF:

Package Downloads
com.Samma.forgium

boost your CosmosOS browser with Forgium, The best Html + Css 2/3 Renderer for cosmos yet.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.1 438 3/9/2024
4.0.0 147 3/9/2024
3.0.0 139 3/7/2024
2.0.0 164 1/23/2024
1.0.0 110 1/23/2024