flutter-wonderous-app icon indicating copy to clipboard operation
flutter-wonderous-app copied to clipboard

Visual artifacts above Chinese language fonts

Open youxiachai opened this issue 3 years ago • 1 comments

in chinese language, render text not clean

iPhone 12 ios 15.6.1

QQ图片20220902183849

youxiachai avatar Sep 02 '22 10:09 youxiachai

This seems to go away when not using impeller. Also the text also renders significantly more bold than the Skia version:

Impeller image

Skia image

esDotDev avatar Sep 04 '22 01:09 esDotDev

@esDotDev Could you provide instructions on enabling the Chinese language version? cc @bdero

zanderso avatar Sep 06 '22 18:09 zanderso

@esDotDev Could you provide instructions on enabling the Chinese language version? cc @bdero

You can switch your test device to Chinese, or just uncomment this line here: https://github.com/gskinnerTeam/flutter-wonderous-app/blob/4f55aa253616944b19941a5b19dbfa45fa2162ed/lib/logic/locale_logic.dart#L18

esDotDev avatar Sep 06 '22 19:09 esDotDev

This is due to glyphs leaking into eachother when sampling from the atlas. Here's one of the more extreme cases demonstrating the issue (texture atlas is on the left and on-screen text is on the right):

image

I believe there are two compounding issues:

  1. After the linear sampling change, we're including half a pixel too much on the top and left, and excluding half a pixel on the bottom and right. Fixing this should make most of the issue go away.
  2. There's some aspect of the text bounds we're not considering. The emboldened text is legitimately a couple of pixels taller than the non-boldened text, so figuring out this bug may end up resolving the more extreme comma case visible above.

bdero avatar Sep 07 '22 00:09 bdero

This should be fixed by https://github.com/flutter/engine/pull/35960.

bdero avatar Sep 07 '22 06:09 bdero

ios 1.0.3 fix

youxiachai avatar Sep 11 '22 02:09 youxiachai