stride3d / stride3d/stride

Font Rendering: SDF Kerning and vertical Tracking incorrect

Open
#2,172 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Official 4.2

Version: 4.2.0.2067 on .NET 8.0.2

Platform(s): Windows 11

Describe the bug
Font kerning/tracking for SDF fonts is incorrect, letters are squished together and letters dance up and down on each line.

To Reproduce

  1. download font Baj Jamjuree from Google Fonts
  2. create SDF font, size 20 or 24
  3. create a text block and zoom in (sometimes easier to see at runtime)

In editor (red annotation to show the vertical issues)
image
image

At runtime:
image

Expected behavior
Kerning is as defined and hinted in the font. Tracking and scanning is as defined and hinted in the font.
image
image

Additional context
Related to #2171 (there's a sample project there)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sample project referenced in related issue #2171 and reproduce the SDF font problem using Baj Jamjuree at size 20 or 24, both in the editor and at runtime. Compare kerning, tracking, and vertical placement with the expected font behavior; done means the letters no longer compress or shift vertically between lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.