Skip to content

fix(linux): text-shadow colour, <input> text-shadow, early wrapping, px gradient stops - #244

Merged
triniwiz merged 6 commits into
mainfrom
fix/linux-text-shadow-color
Nov 30, 2026
Merged

triniwiz merged 6 commits into
mainfrom
fix/linux-text-shadow-color

Conversation

@triniwiz

@triniwiz triniwiz commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Four Linux fixes:

  • Text shadows were drawn in the text's colour. Each run carries its colour as a Pango foreground attribute, and that overrode the colour passed to append_layout for the shadows: white text lost its outline, coloured text with an outline smeared into a blob. Shadows now draw copies of the layouts with the colour attributes removed (foreground, background, decoration colours).
  • <input>/<textarea> had no text-shadow. EditableElement.SetTextShadow hands the shadows to mason_gtk_text_set_shadow, and the input's GTK CSS gets a text-shadow rule built from them, as on Windows and iOS.
  • Short labels wrapped onto two lines. Layout rounding could make a label's box a fraction of a pixel narrower than its measured width, so the text wrapped when drawn. measure_inline now rounds the measured width up to a whole pixel.
  • Gradient stops in px were ignored, and repeating gradients repeated over the whole line. The p/l stop positions are now resolved against the gradient line (the ray for radial) as on Windows, and a repeating gradient repeats over its first-to-last stop span, in backgrounds and masks. repeating-linear-gradient(115deg, transparent 0 26px, rgba(255,255,255,.16) 26px 40px) drew nothing before.
  • Rebuilt libmasonkit.so for x64 and arm64 (glibc 2.28).

cargo test -p mason-linux: pointer::tests::pointer_sequences fails, as it does on main; the rest pass.

- Text: every run carries its colour as a Pango foreground attribute, which
  overrode the colour the shadows were drawn with, so shadows came out in
  the text's colour. Shadows now draw copies of the layouts without the
  colour attributes.
- Input and textarea: hand text-shadow to the GTK text through the
  element's CSS (EditableElement.SetTextShadow), like Windows and iOS.
Layout rounding could shrink a label's box a fraction below its measured
width, and the text then wrapped when drawn (DRESS ME UP! split over two
lines).
@triniwiz triniwiz changed the title fix(linux): paint text-shadow in its own colour, and on <input> fix(linux): text-shadow colour, <input> text-shadow, and labels wrapping early Nov 30, 2026
Stops given in px arrive as `p`/`l` beside the stop list, and were ignored,
so `repeating-linear-gradient(115deg, transparent 0 26px, ... 26px 40px)`
drew nothing. They're now resolved against the gradient line (the ray for
radial), as on Windows, and a repeating gradient repeats over its first to
last stop instead of the whole line. Backgrounds and masks both.
@triniwiz triniwiz changed the title fix(linux): text-shadow colour, <input> text-shadow, and labels wrapping early fix(linux): text-shadow colour, <input> text-shadow, early wrapping, px gradient stops Nov 30, 2026
@triniwiz
triniwiz merged commit bcba8a7 into main Nov 30, 2026
1 of 4 checks passed
@triniwiz
triniwiz deleted the fix/linux-text-shadow-color branch November 30, 2026 18:37
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