Skip to content

enhance(native): rasterize Linux text with subpixel coverage - #429

Closed
tiensonqin wants to merge 5 commits into
native-parity-0.1-backportsfrom
devin/linux-subpixel-text
Closed

tiensonqin wants to merge 5 commits into
native-parity-0.1-backportsfrom
devin/linux-subpixel-text

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Rasterize monochrome Linux/Pango glyphs with horizontal RGB subpixel coverage by default, following the mygo/Pango approach, so native text is closer to browser text at scale 1 instead of grayscale-only antialiasing.

  • lui_text_pango now requests Cairo subpixel antialiasing, emits RGBA color-atlas bytes for LCD coverage, and keeps real color fonts on the existing color-bitmap path.
  • The Linux window text engines classify monochrome LCD bitmaps as gsubpixel scene glyphs so renderers tint them with the foreground color instead of treating coverage as literal premultiplied colors.
  • LUI_TEXT_ANTIALIAS=gray or LUI_TEXT_ANTIALIAS=none before startup preserve the old grayscale/aliased behavior.
  • The rasterization test now verifies unequal RGB channel coverage when subpixel rendering is active.

Validation

Isolated real Logseq Linux SDL validation passed after the companion host integration in logseq#14158: GL and raster backends both produced dark/theme-tinted subpixel text, the grayscale fallback produced zero channel deltas, and color emoji retained correct RGB order.

Linux subpixel text comparison

Known limitation: the implementation currently assumes horizontal RGB panel order and does not yet read desktop gtk-xft settings; users with BGR/rotated panels can use the grayscale escape hatch.

Link to Devin session: https://app.devin.ai/sessions/4db1c451562249ac8356dbf66216a01b
Open in Devin Desktop: https://app.devin.ai/desktop/session/4db1c451562249ac8356dbf66216a01b?variant=devin
Requested by: @tiensonqin


🟢 Devin fixed all 4 findings · Follow Devin's work

Devin Review

Use horizontal RGB subpixel rasterization for monochrome Pango glyphs and mark those bitmaps as scene subpixel glyphs. Keep grayscale and aliased rendering available through LUI_TEXT_ANTIALIAS.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 findings. Devin automatically fixed all 4 findings.

Fixed by Devin (4)
  • Mask test assumes grayscale default — Updated the existing rasterization contract test for the new default four-channel subpixel coverage and corrected ink counting for color-atlas bitmaps.
  • Subpixel test accepts grayscale coverage — The coverage test now requires at least one pixel whose red, green, and blue coverage differs when subpixel rasterization is active.
  • Antialiasing overrides break the default test — The test now reads LUI_TEXT_ANTIALIAS and expects the documented one-byte mask format in gray/none modes instead of always requiring four bytes.
  • Untinted text in Linux windows — Fixed the Linux glyph emitter: subpixel masks now set gsubpixel and stay out of the color-glyph branch, while real color fonts remain color glyphs.

View findings in Devin Review · Follow Devin's work

Devin Review

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