Skip to content

[web] Wrong font rendering some emojis. #157763

@ditman

Description

@ditman

For some emoji glyph codes, like 0x1f3d5, Flutter web will resolve Noto Sans Symbols instead of Noto Color Emoji.

This is what it looks like:

Screenshot 2024-10-28 at 4 25 53 PM

But the emoji should look like this:

Screenshot 2024-10-28 at 4 26 58 PM

Can we prefer the Noto Color Emoji font whenever there's a tie with Symbols (?)


Repro

On the web (with a non-html renderer) in the default starter app, render this widget:

Text(String.fromCharCode(0x1f3d5));

That'll render the monochrome "camping" emoji, instead of the colorful one.

Full main.dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Demo',
      home: EmojiRepro(),
    );
  }
}

class EmojiRepro extends StatelessWidget {
  const EmojiRepro({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              // Should use Noto Color Emoji, but uses Noto Sans Symbols
              String.fromCharCode(0x1f3d5),
              style: Theme.of(context).textTheme.displayLarge,
            ),
            // Uncomment this so Noto Color Emoji wins the "tie"
            // Text(
            //   String.fromCharCode(0x26fa),
            //   style: Theme.of(context).textTheme.displayLarge,
            // ),
          ],
        ),
      ),
    );
  }
}

Another example:

Screenshot 2024-10-28 at 4 33 07 PM

Designs of 0x1f39e film_frames.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: typographyText rendering, possibly libtxtengineflutter/engine related. See also e: labels.found in release: 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-webOwned by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions