Skip to content

Using FontStashSharp in generic game engine

Roman Shapiro edited this page Aug 14, 2025 · 19 revisions

Adding Reference

There's engine agnostic version of FontStashStash available at nuget: https://www.nuget.org/packages/FontStashSharp.PlatformAgnostic/

Usage

In order to use FontStashSharp you need to provide an implementation for any of two interfaces:

  1. IFontStashRenderer
  2. IFontStashRenderer2

IFontStashRenderer

IFontStashRenderer renders data to XNA-like SpriteBatch.

There are two samples demonstrating implementation of that interface:

  1. FontStashSharp.Samples.MonoGameBackend
  2. FontStashSharp.Samples.Silk.NET.TrippyGL

IFontStashRenderer2

IFontStashRenderer2 renders the raw vertex data.

There are two samples demonstrating implementation of that interface:

  1. FontStashSharp.Samples.OpenTK
  2. FontStashSharp.Samples.Silk.NET
Clone this wiki locally