Add Forme GPU font wrapper as a new TTF font type#11
Draft
Copilot wants to merge 10 commits into
Draft
Conversation
…e 3.8.4.1)" Agent-Logs-Url: https://github.com/CnCNet/Rampastring.XNAUI/sessions/bae050fc-14c3-4e09-89a7-a38c4c798965 Co-authored-by: SadPencil <11227602+SadPencil@users.noreply.github.com>
…n Path calls Agent-Logs-Url: https://github.com/CnCNet/Rampastring.XNAUI/sessions/bae050fc-14c3-4e09-89a7-a38c4c798965 Co-authored-by: SadPencil <11227602+SadPencil@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
SadPencil
April 7, 2026 11:19
View session
79ee994 to
d089693
Compare
This reverts commit b0cf4e8.
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Introduces AristurtleDev.Forme as a new GPU-accelerated font type alongside the existing FontStashSharp TTF wrapper.
Forme renders text directly from quadratic Bézier glyph outline data on the GPU using the Slug algorithm — no precomputed textures, distance fields, or rasterized atlases. Text remains crisp at any size and scale.
Changes
New file
FontManagement/FormeFontWrapper.cs— implementsIFontusingFormeRenderer+FormeFontDevice. EachDrawStringcall flushes the activeSpriteBatch, usesFormeRenderer.Begin/DrawString/End(which saves and restores allGraphicsDevicestate), then restarts theSpriteBatch. Supports.formepre-processed cache files for faster startup. Guarded by#if !XNA.Modified files
FontManagement/FontType.cs— addsFormeenum value.FontManagement/FontManager.cs— addsCreateFormeFontIndex: loads from a pre-processed.formefile if present (falling back to raw TTF and saving the result), createsFormeFontDevice+FormeFontWrapper. Guarded by#if !XNA.Renderer.cs— stores theGraphicsDeviceand initializes a sharedFormeRendereron startup. Guarded by#if !XNA.Rampastring.XNAUI.csproj:net8.0targets bumped from3.8.1.303→3.8.4.1(required byForme.MonoGame 0.0.3;net48/XNA targets stay on3.8.0.1641).AristurtleDev.Forme 0.0.3andAristurtleDev.Forme.MonoGame 0.0.3(non-XNA only).Usage
Add a Forme font in
Fonts.ini:On first run the TTF is processed and a
NotoSans-Regular.formebinary cache file is written next to the TTF. Subsequent runs load the cache directly, skipping reprocessing.Notes
CharacterSetviaFormeFont.FromTtfand place the resulting.formefile next to the TTF.FormeRendereris shared across all Forme font instances and owned byRenderer.FormeRenderer.Begin/Endexplicitly saves and restores allGraphicsDevicestate, soSpriteBatchalways resumes with correct settings.net48) configurations are unaffected — all Forme code is behind#if !XNAguards.