Skip to content

Fix blurry oversized single large emoji on Retina - #2291

Open
anriltine wants to merge 1 commit into
TelegramMessenger:masterfrom
HyperlinksSpace:fix/large-emoji-retina-pixel-perfect
Open

Fix blurry oversized single large emoji on Retina#2291
anriltine wants to merge 1 commit into
TelegramMessenger:masterfrom
HyperlinksSpace:fix/large-emoji-retina-pixel-perfect

Conversation

@anriltine

Copy link
Copy Markdown

Summary

  • Large emoji-only messages (especially a single emoji) rendered via Apple Color Emoji at 94pt, which is oversized vs Android (TYPE_EMOJIS41dp) and falls between Apple Color Emoji bitmap rungs — on 2×/3× Retina the glyph is upsampled and looks soft/blurry.
  • fontSizeForEmojiString now uses discrete Apple Color Emoji sizes (48/40/32/…); single-emoji TextNode also forces contentsScale to UIScreen.main.scale.

Android check

Android draws large emoji through density-aware sprite bitmaps (Emoji.loadBitmap + chat_msgTextPaintEmoji, ~dp(0.34*120) ≈ 41dp for a single standard emoji). No equivalent Retina upsample bug found; no Android change in this PR.

Related

Test plan

  • iPhone with 3× display, Settings → Large Emoji on
  • Send a single Unicode emoji (no custom emoji) → size looks sane, edges sharp (not soft/blurry)
  • Send 2–3 emoji-only message → still scales down cleanly
  • Messages that resolve to animated emoji stickers unchanged
  • Edit emoji-only count (see Large emoji render does not update correctly after editing emoji count on iOS #2139) still behaves as before for layout type switching

Made with Cursor

Use Apple Color Emoji bitmap rung sizes instead of 94pt, and force the
large-emoji TextNode contentsScale to the screen scale so single emoji
messages stay sharp on 2x/3x displays.

Co-authored-by: Cursor <cursoragent@cursor.com>
@anriltine

Copy link
Copy Markdown
Author

Tracking issue: #2292

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