Skip to content

feature: SlugTextSharp integration for future SlugText operator#1041

Draft
ExtraBinoss wants to merge 1 commit intotixl3d:mainfrom
ExtraBinoss:feature/SlugText
Draft

feature: SlugTextSharp integration for future SlugText operator#1041
ExtraBinoss wants to merge 1 commit intotixl3d:mainfrom
ExtraBinoss:feature/SlugText

Conversation

@ExtraBinoss
Copy link
Copy Markdown
Contributor

@ExtraBinoss ExtraBinoss commented Apr 11, 2026

This pull request introduces support for the Slug font rendering algorithm by integrating the SlugSharp library, adding reference HLSL shaders, and providing utility methods for charset parsing and validation. The main changes are grouped into three areas: shader integration, library dependencies, and charset utility helpers.

Context

Since Slug font rendering has been open-source by Eric Lengyel (https://terathon.com/blog/decade-slug.html), I took the time to create a generator for slug files that can be rendered using the provided shaders from Eric.

This library (SlugTextSharp is made by @ExtraBinoss) It is a small library totally 30 KB of data, and has only one dependency : FreeTypeSharp. It is compiled in Dotnet 9.0 and licenced as MIT.

It adds supports for :

  • The generation of slug files which are the main components for the future rendering
  • Charset files, use any text file to define the charsets needed for your font
  • Works with Korean EASCII as well as rendering Korean characters, 11 k characters takes about 3 seconds to generate.
image

It lacks :

  • Emojis support (harder to do!) but feel free to contribute to the Open Source library if needed.
  • Variable font weight support

These aren't dealbreakers concerning how TiXL needs Text rendering.

Compared to MSDF, Slug provides both advantages and disadvantages.

  • Slug is 10x slower to render than MSDF according to this study
  • Slug is faster to generate than MSDF files. From 80 seconds down to 3 seconds for 11k characters of the EASCII Korean.
  • Slug provides much lesser artifacts than MSDF, and supports better minification and magnification than MSDF.
  • Both provides high quality rendering.

If you need to test out if the .slug that was generated works, you can go onto my port of the same algorithm to Typescript.
Website to view the generated slug file
Click import sluggish and select or drop the slug file into it. You can then render any text.
image

Actions needed

I need someone to help me integrate the Slug rendering algorithm, as I am not familiar on how SharpDX, or how "nested nodes" work. For example, the Text node is an operator coded directly into TiXL.

The rendering shaders are inside this folder :
image

Thanks !

DETAILS of this PR draft

Slug font rendering integration:

  • Added reference Slug vertex and pixel shaders (SlugVertexShader.hlsl, SlugPixelShader.hlsl) to the project, providing the core Slug algorithm for GPU-based font rendering. [1] [2]

Library dependencies:

  • Added a dependency on the SlugText-Sharp NuGet package (version 0.1.2) in Lib.csproj to enable Slug font rendering and charset parsing capabilities.

Charset utility helpers:

  • Introduced SlugCharsetUtils in Utils/Slug/Charset/SlugCharsetUtils.cs, offering helper methods for loading, parsing, and validating character sets using SlugSharp, including detailed error reporting and validation summaries.
  • Added a README.md to get started using the Utilities as well as a latin EASCII.txt which is 300 kbytes large to generate the fonts in TiXL with that charset by default if needed, It can be deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant