Skip to content

Outline flattens rounded glyph tops (s, a, o) at 2px thickness #127

Description

@vchelaru

Description

With a 2-pixel outline enabled, rounded letters lose their curved tops — the outline forms a flat horizontal cap at the peak instead of following the arc. Vertical stems (h, d) look correct; the problem is specific to curved tops on glyphs like s, a, o, and n.

This appears to be an outline-shape bug, not normal Arial design.

Steps to reproduce

  1. Rasterizer: KernSmith.Rasterizers.FreeType
  2. Font: Arial
  3. Size: 24
  4. Outline thickness: 2
  5. Generate text containing rounded glyphs — e.g. "Shadow and" or "ason"
  6. Zoom in on s, a, o, n peaks

Expected behavior

The outline should follow the curved top of rounded glyphs, matching the underlying glyph silhouette.

Actual behavior

The outline at the top of rounded glyphs is flattened into a straight horizontal segment several pixels wide. Annotated zoom comparisons show the cap on s and a clearly; o and n show the same pattern.

Screenshots

Screenshots will be added in a follow-up comment (zoomed, with annotations on affected peaks).

Environment

  • OS: Windows 10
  • Rasterizer: KernSmith.Rasterizers.FreeType
  • Reproduced in: KernSmith UI

Notes for investigation

Likely related to OutlineEffect EDT binarization — alpha is thresholded at >= 32 before the distance transform, which can turn a graduated anti-aliased peak into a flat binarized row; the 2px outline then traces that flattened silhouette:

// OutlineEffect.cs
binaryAlpha[i] = expandedAlpha[i] >= 32 ? (byte)255 : (byte)0;

OutlinePostProcessor uses a different path (EDT on raw alpha, no binarization) and may be worth comparing.

LayeredRenderingTests checks outline sizing but does not assert outline shape integrity on curved glyphs.

Possible regression test

Generate ason at size 24 with outline=2 via FreeType; sample pixels just outside the glyph peak on s/o and assert the outline boundary is not a perfectly flat horizontal run (or compare against a golden image of outline-only output).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions