mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Multiple fixes to text rendering that match skia behavior on almost all bugs I've found, except for the glyphs are still _slightly_ too fine for some CJK text. The fixes are: 1. Compute the gylph size in the typographer context, using text size * scale factor text, instead of computing smaller bounds and scaling it up. This was not accurate and as a result we would positon glyphs incorrect by multiple pixels sometimes, causing uneven rows. 2. Match Skia's rounding behavior. previously we were rounding in multiple places, Skia rounds once. This is important to prevent jumping. 3. Use 4 subpixel X positions for rendering. This is the big one that ensures the visible layout matches exactly. Adds support for Y, both, and none positioning too. I couldn't find any examples of just Y or both. Some fonts may specify that have no subpixel positioning. So we don't bother to compute it for those. Fixes https://github.com/flutter/flutter/issues/138386 / mostly, except slightly not bold enough. Fixes https://github.com/flutter/flutter/issues/147577 / mostly, except slightly not bold enough. Fixes https://github.com/flutter/flutter/issues/140475 Fixes https://github.com/flutter/flutter/issues/141467 Fixes https://github.com/flutter/flutter/issues/135523 Fixes https://github.com/flutter/flutter/issues/127815