Commit c84f606
committed
fix(text): draw Fabric text with grayscale antialiasing on transparent surfaces
RenderText calls ID2D1RenderTarget::DrawTextLayout without setting a text
antialias mode, inheriting the device context default - ClearType subpixel
antialiasing. The target is transparent: ParagraphComponentView creates the
drawing surface DirectXAlphaMode::Premultiplied and clears it to
ColorF(Black, 0.0f) when the view has no backgroundColor.
ClearType needs an opaque, known background to filter against; with none, its
per-channel coverage lands in the surface colour channels and shows as dark or
colour-tinted fringes along thin glyph stems once composited.
D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE is the documented mode for transparent
render targets.
Saves, sets GRAYSCALE, and restores - mirroring the GetAntialiasMode/
SetAntialiasMode and GetDpi/SetDpi save/restore idioms already in this function.
0.83-stable twin of #16341. Addresses #16340. Verified this branch has the same
omission at the same line: SetTextAntialiasMode and D2D1_TEXT_ANTIALIAS_MODE
have zero occurrences here too.1 parent 8e869d7 commit c84f606
2 files changed
Lines changed: 13 additions & 0 deletions
File tree
- change
- vnext/Microsoft.ReactNative/Fabric/Composition
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
168 | 178 | | |
169 | 179 | | |
170 | 180 | | |
171 | 181 | | |
172 | 182 | | |
173 | 183 | | |
| 184 | + | |
| 185 | + | |
174 | 186 | | |
175 | 187 | | |
176 | 188 | | |
| |||
0 commit comments